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

Did you know?Explore Trending and Topic pages for more stories like this.
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

storing results of a function - previous result overwritten with new result
I have created a function to validate input.

function validate_dimension($value,$name) {
<

Strip Slashes Help
I've got a script that i've downloaded of the net to edit multiple fields from my sql database, and

Join Query Help
Hi all,

I am having problems with the below code, which we shall call 'my first join query'!

[PHP HELP] Php order form.
Hello to everyone @ phpfreaks. Im new to this site and hope to learn lots of things here.

Fir

Alterar a hora do servidor
Se alguém souber, ajude-me a adicionar 6 horas, obrigado
<tr>
&

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

How to disable direct access to a file
Suppose I've 2 Files. 1.php & 2.php

I don't want anybody to access 2.php directly fr

how do i display data on a page from mysql
1 - do i use this code at the top of each of my page i wish to only alow access if there as been a s

need good snippet manager
Hi. as i am coding and learning more, it is becoming difficult to manage code snippets. how you mana

reading xml faster than DB call?
I am trying to optimize a high traffic website, and I enabled a feature where there are three photos

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