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>
FTP issues
Hi all,I am currently facing some serious problems with a script and really need some advise before I am actually sick To give you a brief overview of the situation, I have a script which is going to
fire away
i launched about 4 months ago as a lagit co. i have 2 paying clients, 1probono, 1 side progect, and 1 chat site. all of this has led to a lot of hits but very few real clients. i just changed from a
Advice on how to delete a mysql row using my form
Hi,I am very new to php and am struggling to work out how to delete a portfolio item (a row from my database using my form which is here):
Do While statement
hi guys,This may sound trivial but im new to php and as part of an assignmenti have to construct the 10 green bottles song using the do while statement. I can do the statement but it is itengrating
Session problem?!?
Hello All! I am very new to the php world but I am working on fixing things that a previous programmer screwed up for a site that I have. Let me explain what the current issue is. I believe it had to
Material Issuing for receiving batch
Dear All experts in MM/ PP,
Where am I going wrong
Been trying to work this out for hours I have two tables called 'Genres' and 'Films'. Genres contains two columns 'Genre_id' and 'Genre_Name'. Films contains a load of columns, the most important
Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop through the dates based on a form and show the title of the event if the start date of the form
Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter seems incredibly boring, daunting and complicated, it looks so awful that I haven't yet read it so I
FROM_UNIXTIME($phpdate);
Hello, I tried to use this : $date = FROM_UNIXTIME($phpdate); ANd I was told that FROM_UNIXTIME() is an 'unidentified function'. Any ideas why this might be? I've used it before with no problems.