...

View Full Version : Input not being read and stopping the php listing



Philosophaie
02-18-2012, 05:41 PM
My php program does not execute past the inputs. It does not go past to the mysql_connect etc. It works without the two inputs then manually coded in the INSERT. In my htm program works with two input boxes. Why are my inputs not working?


$name = filter_input(INPUT_POST, "name");
$email = filter_input(INPUT_POST, "email");

Also, in my other programs have 14 inputs. They all fit as fields. Is that a problem?

tangoforce
02-18-2012, 05:55 PM
Unless you show us more code there is no way we can help you.

Philosophaie
02-18-2012, 07:30 PM
table1 has 4 fields ('id', 'datetime', 'user1', 'pass1'). Both name and email have their counterparts in .htm code <input type="text" name="name"> etc.

filter_input(INPUT_POST, "name") gets locked up before it gets to the echoes and does not even get to mysql_connect. This baffles me. Why would a simple input not work?


<?php
$name = filter_input(INPUT_POST, "name");
echo $name;
$email = filter_input(INPUT_POST, "email");
echo $email;
$conn = mysql_connect('localhost', 'username1', 'password1') or die(mysql_error());
echo "Connection made.";
mysql_select_db('database1');
$sql = "INSERT INTO table1 VALUES (null, now(), '$name', '$email');";
$result = mysql_query($sql, $conn) or die('Query failed: ' . mysql_error());
?>

Fou-Lu
02-18-2012, 10:04 PM
And what was the result of the modification I asked for in your thread here: http://www.codingforums.com/showthread.php?t=251813

Philosophaie
02-18-2012, 11:55 PM
Nothing at all happened. The program ran as designed. There must have been a server error or outage due to traffic.


ini_set('display_errors', 1);
error_reporting(E_ALL);

snowdude2004
02-19-2012, 12:00 AM
Nothing at all happened. The program ran as designed. There must have been a server error or outage due to traffic.


ini_set('display_errors', 1);
error_reporting(E_ALL);

By saying there was no errors I presume the issue is now fixed?

Fou-Lu
02-19-2012, 05:17 PM
And you also receive the "Connection made." message?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum