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

Help: calling function
Hi,
Is it possible to call a php function on page close?
If yes, could you explain how and whe

Compare user input to flat file data
Help...Am a complete newbie to programming so my code is prolly quite long. Am trying to verify a us

Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to re

Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.
Its a sports si

Undefined Variable: PHP_SELF, pls help
Hi,

Im a newbie on PHP / MySQL programming and Im running a script to search one field on my

My XSRF Prevention code isn't working
First of all, thanks for the generous help you guys have given me in the past on this forum.
Seco

How can use this array as a key?
Say I have this array for example:


print_r($array);

Prints:
Code: [Select]Array

need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which style

article site help remaining text
Hi all hope you will be fine
I am creating a article site in this site i want to put some text on

Setting condidtions for an input box
Hi all,

I would like to set a condition in a txt box that says the number a user enters has t

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