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

Unable to retreve the values from Mysql Query
Hi,

Here is the php code that I have, Query is running properly in phpmyadmin and is resu

classic dynpro : hide area and auto adjust hights
Hi,

I want to develop a similar user interface as is used in standard transaction MIGO.

All possible combinations of String in PL/SQL
Hi All,

Could you please explain the logic of getting all possible combinations of String

PHP/PKI
I am trying to set up a web application that uses pki. does anyone have a good tutorial to set this

how to populate a drop down box
Hi buddies!

PROCEDURE DOWNLOAD_REPORT_FORM (report_name varchar) is begin DOWNLO

ORA-01655: unable to extend cluster SYS.C_FILE#_BLOCK# by 128
Hi all,

Oracle 10g. Linux.

I'm facing the below error while trying to import a dumpfil

calendar dates and hours compare problem
i have a calendar in wordpress, everything works great except that i can make 2 meetings at the same

Help with page encoding issue and weird characters
I'm trying to write a screen scraper and when I pull out the lines of the html file that I'm interes

Php - mysql store data and use it later?
Hi, i' making a login page at the moment, however my username + password is stored many different pl

Problem with HTML form
Hello,

I made a HTML form with some fields and check box.
Everything works fine except whe

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