What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [urgent] PHP isn't working

[urgent] PHP isn't working
Author: Message:
Baggins
Full Member
***

Avatar
B000ALFAZO

Posts: 387
Reputation: 13
29 / Male / Flag
Joined: Oct 2006
O.P. Sad  [urgent] PHP isn't working
I need help with this php script, it is for my science fair progect which is due on monday.

When i enter the [access] code, no matter what, it just gives a blank page.

code:
<?php
if(isset($_POST['code']))
{
    $dbh = mysql_connect ("localhost", "user", "passwurd") or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_select_db ("science");
    mysql_real_escape_string($code);
    $query = mysql_query("SELECT * FROM codes WHERE code='$code'");
    if(mysql_num_rows($query) != 0)
    {
        mysql_query("DELETE FROM codes WHERE code='$code'");
        session_start();
        header("Location: http://foo.com/1.php");
    }
}
else
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
  <title></title>
</head>
<body>
Welcome,<br>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" name="validate">Enter
your access code: <input maxlength="6" name="code"><br>
  <br>
  <input type="submit"><br>
</form>
</body>
</html>
<?php
}
?>

Please and thankyou this is really important

This post was edited on 01-30-2007 at 11:45 PM by Baggins.
01-30-2007 11:33 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[urgent] PHP isn't working - by Baggins on 01-30-2007 at 11:33 PM
RE: [urgent] PHP isn't working - by WDZ on 01-30-2007 at 11:47 PM
RE: [urgent] PHP isn't working - by brian on 01-30-2007 at 11:48 PM
RE: [urgent] PHP isn't working - by Baggins on 01-30-2007 at 11:49 PM
RE: [urgent] PHP isn't working - by WDZ on 01-30-2007 at 11:54 PM
RE: [urgent] PHP isn't working - by Baggins on 01-31-2007 at 12:07 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On