I am trying to get a site up, I just did a test signup and the info I type just disappears when I hit submit nothing else happens, what do people reckon is wrong? Everything looks right but ... nothing happens. I am using PHP and MYSQL database. Whats wrong?
I know its not the loactions and detials of the database that are wrong becuase it won't even allow the site to be opened if the detials are even one digit different. Here is a portion of the code I suspect. I was originally just wanting to know what people thought what combination of factors could cuase nothing to happen when the form was submitted and the inputed information dissapearing and going back to the original form. But if you reckon it will help: require("program.php"); require("top.php"); if ($submit) { $db = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die("Could not connect"); mysql_select_db("$dbname") or die("Could not select database"); $sql = "SELECT * FROM users WHERE email='$email'"; $result = @mysql_query($sql); if (!$email) { echo "Sorry! You didn't fill in all the fields!"; } elseif (!$result) { echo "Sorry! Email not in database!"; } else { $myrow = mysql_fetch_array($result); $id = $myrow["id"]; $first = $myrow["first"]; $last = $myrow["last"]; $pass = $myrow["pass"]; /* recipients */ $to = "$first $last <$email>"; /* subject */ $subject = "$pname Login Information"; /* message */ $message = "Dear $first Here is your login information: Username: $id Password: $pass You can login at: $url/members.php Your referral URL is $url/?r=$id Sincerely, The $pname Staff $url/ "; /* additional headers */ $headers .= "From: $pname <$admin_email>\r\n"; /* and now mail it */ mail($to, $subject, $message, $headers); echo "Thank you, an E-mail has been sent to $email with your login information.\n"; } } else { ?> <center><font size="5"><b>Login</b></font></center><br> <br> Enter your Email address.<br> <form method="post" action="<?php echo $PHP_SELF?>"> <input type="Text" name="email"><br><input type="Submit" name="submit" value="Send Your Password"> </form> <?php } require("bottom.php"); ?>
That until the domain propagates throughout the internet, a lot of submissions, etc are on hold. It could be, if a new site, that it will take up to 72 hours for this to happen. Found this out when my sites were transferred from one server to another, with different ip address. Sites were okay, people could submit, but the submissions never showed up. After about 48-72, they all showed up at once!
That period should be well and truly over for this site, its now been up seven days almost, I did a test signup to see if everything was working and found the form kept blanking out and not going anywhere.
Check your error log files. Looks like your php code has errors. See - /* additional headers */ $headers .= "From: $pname <$admin_email>\r\n"; /* and now mail it */ mail($to, $subject, $message, $headers); echo "Thank you, an E-mail has been sent to $email with your login information.\n"; } } else { ?> Code (markup): Q...
The problem is the . in $headers .= isn't it? Are there any other problems in the code? I'm just new at php. Sorry to ask such stupid questions. that error was repeated about 5 different places with $headers and also $refheaders. Buying scripts has disadvantages. Sometimes I wish, I was better at this so I could do it myself.
dddougal Can you explain why taking the value out of it would work? I have also checked out the form aspect and the form is correct provided that "register_globals" is on. How do I find and change "register_globals"?
Don't take out the . from the .= .= is string concatenation. $x = "This is the begining"; $x .= " this is the end"; at this point $x = "This is the begining this is the end"; Don't take out the value part of your submit button. That will affect how the form appears but will almost certainly not affect how the form works or doesn't work. If this is a 3rd party script that requires register_globals on you can search google for how to turn register_globals on. Given the choice I'd look for a different script. If it's your own script, learn how to write scripts that don't require register_globals.