PHP submit form script causing blank page


Posted on 16th Feb 2014 07:03 pm by admin

Im trying to submit a form using this script, however nothing shows up on the page, does anyone know why it's not working?

Thanks

Code: <?php

// Connects to your Database
mysql_connect("localhost","xxxx","xxxx") or die(mysql_error()); //CHANGE ME BACK!!!!!
mysql_select_db("xxxx") or die(mysql_error());

//This code runs if the form has been submitted
if (isset($_POST['submit'])) {

$date = date("y-m-d H:i:s");

$insert = sprintf("INSERT INTO members set
title = '%s' ,
body = '%s',
image = '%s',
category = '%s',
date = '%s'
",
mysql_real_escape_string($_POST['title']),
mysql_real_escape_string($_POST['body']),
mysql_real_escape_string($_POST['image']),
mysql_real_escape_string($_POST['category']),
mysql_real_escape_string($date])
);
$add_member = mysql_query($insert) or die(mysql_error());

?>
<p>Article posted</p>
<?php
}
else
{
?>

No comments posted yet

Your Answer:

Login to answer
195 Like 11 Dislike
Previous forums Next forums
Other forums

PHP & Java
Hello,

can PHP code be used inside java code?

Code: <SCRIPT LANGUAGE="Java

styling a RadioButtonList
HiI need to have a radio button and close to it, its lable, then a space then another set of those.

Call db table from any PHP file
Hi,

I want to be able to call a database table that will be setup in another file called init

this code is strange !
Hi i got this code from the web.. It checks for live and dead socks
It is working perfectly on my

why isn't this PHP code working ???
it's suppose to find a name on the database.

<?php

$s = $_POST["lname&

Page not Loading After Test
Hey All

It seemed that an inlcude statement wasn't working for some reason, so I tried a more

problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of poin

Displaying an image using echo command
I had done a query on my database, one of the fields being an image reference to a directory where a

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

php code to accept and delete incoming data
Using following HTML Code please show me how to write PHP code to accept and delete the incoming dat

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash