IsSet Problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fariquzeli
Forum Contributor
Posts: 144
Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:

IsSet Problems

Post by fariquzeli »

I read the new documentation about IsSet($_POST['formvariable']) things in the forums here and I have that setup properly, but my form still seems to just refresh blankly before getting to my name/password verification and sending an email as well as sending users a thank you page. The link to what I'm working on is: http://www.pancorp.com/techs/techsignup.php I have the code pasted here below to that page (with the exception of the graphics/html template)

Code: Select all

<?php

//include files
include("webvars.php");

if (!IsSet($_POST&#1111;'Submit'])):

?>

<form action="<?=$PHP_SELF?>" method="post" name="TechnicianSignUp" id="TechnicianSignUp">
              <table width="100%" border="0" cellspacing="4">
                <tr> 
                  <td width="20%" class="medium"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">User 
                    Name:</font></td>
                  <td width="80%"><input name="username" type="text" id="username" size="15" maxlength="12">
</td>
                </tr>
                <tr> 
                  <td class="medium"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Password: 
                    </font></td>
                  <td><input name="password" type="password" id="password" size="10"></td>
                </tr>
                <tr>
                  <td class="medium">Confirm Password:</td>
                  <td><input name="confirmpassword" type="password" id="confirmpassword" size="10"></td>
                </tr>
                <tr> 
                  <td class="medium"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Email:</font></td>
                  <td><input name="email" type="text" id="email" size="30"></td>
                </tr>
                <tr> 
                  <td class="medium"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">First 
                    Name:</font></td>
                  <td><input name="firstname" type="text" id="firstname" size="24"></td>
                </tr>
                <tr> 
                  <td class="medium"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Last 
                    Name:</font></td>
                  <td><input name="lastname" type="text" id="lastname" size="24"></td>
                </tr>
                <tr> 
                  <td class="medium"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Phone 
                    Number:</font></td>
                  <td><input name="phonenumber" type="text" id="phonenumber" size="10" maxlength="10"></td>
                </tr>
                <tr> 
                  <td class="medium"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Location:</font></td>
                  <td><input name="location" type="text" id="location" size="30"></td>
                </tr>
                <tr> 
                  <td colspan="2">&nbsp;</td>
                </tr>
                <tr> 
                  <td colspan="2"><div align="center"> 
                      <input type="Submit" name="Submit" value="Submit">
                      <input type="reset" name="Reset" value="Reset">
                    </div></td>
                </tr>
              </table>
</form>

<?php
else :
// Process signup submission

mysql_connect($hostname, $user, $pass) 
or die("The site database appears to be down.");

mysql_select_db("pancorp");
  $usertest = $username; 
  $sql = "SELECT username FROM technicians WHERE username = '$usertest'";
  $result = mysql_query($sql) or die(mysql_error()); 
  
  if ($password != $confirmpassword) &#123;
  echo  ("Your passwords must match in order to register.");
  exit();
  &#125;
  if (mysql_num_rows($result) != 0) &#123; 
    echo "Username taken, please choose another username."; 
	exit();
&#125; 
	else &#123; 

 $sql2 = "INSERT INTO technicians (id,username,password,firstname,lastname,email,location,phonenumber)".
  "VALUES ('NULL', '$username', '$password', '$firstname', '$lastname', '$email', '$location', '$phonenumber')";
  $result=mysql_query($sql2) or die(); //Insert into db
		 
  // Email the new password to the person.    
$message = "You have successfully registered your Technician's Account at Pancorp.com. To log in, proceed to the following address:

http://tech.pancorp.com/

Your personal login ID and password are as follows:
Username: $username   
Password: $password

Feel free to login and change your password and if you have any questions or comments don't hesitate to send mail to

<ttoomey@yiinc.com>.
-Tim Toomey";
    mail($email,"Your Login/Username for Pancorp.com", $message, "From: Tim Toomey <ttoomey@yiinc.com>");
&#125;
  ?>
  
<title>Thanks for Signing Up!</title>

<h3>Registration Complete!</h3>
            <p>Your username and password have been emailed to <strong> 
              <?=$email?>
              </strong>, the email address you just provided in your registration 
              form. To log in, click <a href="index.php">here</a> to return to 
              the login page, and enter your new personal username and password.</p>
<?php
endif;
?>
If anyone can help me out with this I'd really appreciate it.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

this script is working on my box (despite that I don't have the database ;) )
fariquzeli
Forum Contributor
Posts: 144
Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:

Post by fariquzeli »

How does it work on your box?
lol

I still get the same problem with the from refreshing itself
Post Reply