This should be an easy script but I can't get it to run. Can someone please help me?
<html><head><title>Adding a User</title></head>
<body>
<?php
$self = $_SERVER['PHP_SELF'];
$first_name = $_POST['firstname'];
$last_name = $_POST['lastname'];
$user_email = $_POST['useremail'];
if( (!$first_name) or (!$last_name) or (!$user_email) )
{
$form ="Please enter all new user details...";
$form.="<form action="$self"";
$form.=" method="post">First Name: ";
$form.="<input type="text" name="firstname"";
$form.=" value="$first_name">
Last Name: ";
$form.="<input type="text" name="lastname"";
$form.=" value="$last_name">
Email: ";
$form.="<input type="text" name="useremail"";
$form.=" value="$user_email">
";
$form.="<input type="submit" value="Submit">";
$form.="</form>";
echo($form);
}
else
{
#connect to MySQL
$conn = @mysql_connect("localhost","xxxx","xxxx")
or die("Could not connect to MySQL");
#select a database
$db = @mysql_select_db("xxxx",$conn)
or die("Could not select database");
#create the SQL query
$sql = "insert into tablename (firstname, lastname, useremail)
values ("$first_name",'"$last_name","$user_email" )";
#execute the query
$result = @mysql_query($sql,$conn)
or die("Could not execute query");
if($result)
{ echo("New user $user_email added"); }
}
?>
</body></html>
Error with login script
I am getting an error with my login script:Error:Code: Warning: Cannot modify header information - headers already sent by (output started at /home/bucket/public_html/inc/config.php:7) in
help with php
It's not displaying or pulling anything out of the database. Code: <html><head><title>Hale's Music World: Inventory Search
I am stumped
OK. Here is what I am trying to do. I have the conditions set, and if the conditions are met, I want to randomly find a user id, and username from a table, and then store each of these names in the
Solution Manager BPR
Does the SolMan-BPR-ARIS-Integration (http://www.ids-scheer.com/en/ARIS/ARIS_Platform/ARIS_Business_Architect_for_SAP/3743.html ) use an interface open to the public? If yes, were can I finde some
Insert data in Mysql and move to another page
I'm stuck with this simple problem. I need to insert data in Mysql and then hit submit and move to another page. My first thougt was to use Post but that didn't work. How do I use Get and Post to do
What exactly is net neatrality?
What exactly is it? I think it's anti-censorship and... stuff... but I don't really understand it
Error in write byte array into document in SM58
Hi Gurus,
trim function issues
Hi guys, total noob here... So I've been tinkering around with a html and am using php to email the subitted data to me. It's all working fine, except now I've changed the rules of the form a little
Progress bar for webpage
Hi,I want to implement a progress/waiting bar on my webpage - exactly the same thing that the Microsoft Update web page uses when your PC is being searched for available updates (the green bar that
Hardcopy printing is to wide
I want to make a hardcopy at runtime of my active form like this