RE: PHP/MySQL and passing url params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The first question is is $row_rsID actually an array when you run the
script?

If it is, is $row_rsID['userID'] set?

If it isn't, is $row_rsID['userid'] set?

If you want to set the variable $row_rsID statically do this:

$row_rsID = array("userID"=>1);

Where does $row_rsID get set?  Does it set $row_rsID['userID']?

Peter

On Sun, 27 Oct 2002, alex hogan wrote:

> Sorry..., my bad.  Too wrapped up in the problem.
>
>
>
> Notice: Undefined variable: row_rsID in
> D:\web\hogana\demo\login\TMPbl2tw4o24u.php on line 48
>
> Warning: Cannot add header information - headers already sent by (output
> started at D:\web\hogana\demo\login\TMPbl2tw4o24u.php:48) in
> D:\web\hogana\demo\login\TMPbl2tw4o24u.php on line 53
>
> <?php require_once('../../Connections/connReg.php'); ?>
> <?php
> function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
> $theNotDefinedValue = "")
> {
>   $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) :
> $theValue;
>
>   switch ($theType) {
>     case "text":
>       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
>       break;
>     case "long":
>     case "int":
>       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
>       break;
>     case "double":
>       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" :
> "NULL";
>       break;
>     case "date":
>       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
>       break;
>     case "defined":
>       $theValue = ($theValue != "") ? $theDefinedValue :
> $theNotDefinedValue;
>       break;
>   }
>   return $theValue;
> }
>
> $editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
> if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
>   $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
> }
>
> if ((isset($HTTP_POST_VARS["MM_insert"])) &&
> ($HTTP_POST_VARS["MM_insert"] == "frmReg")) {
>   $insertSQL = sprintf("INSERT INTO user (username, fname, lname,
> address, city, `state`, zip, phone, email) VALUES (%s, %s, %s, %s, %s,
> %s, %s, %s, %s)",
>                        GetSQLValueString($HTTP_POST_VARS['txtUserName'],
> "text"),
>                        GetSQLValueString($HTTP_POST_VARS['txtFName'],
> "text"),
>                        GetSQLValueString($HTTP_POST_VARS['txtLName'],
> "text"),
>                        GetSQLValueString($HTTP_POST_VARS['txtAddress'],
> "text"),
>                        GetSQLValueString($HTTP_POST_VARS['txtCity'],
> "text"),
>                        GetSQLValueString($HTTP_POST_VARS['txtState'],
> "text"),
>                        GetSQLValueString($HTTP_POST_VARS['txtZip'],
> "text"),
>                        GetSQLValueString($HTTP_POST_VARS['txtPhone'],
> "text"),
>                        GetSQLValueString($HTTP_POST_VARS['txtEmail'],
> "text"));
>
>   mysql_select_db($database_connHoganMain, $connHoganMain);
>   $Result1 = mysql_query($insertSQL, $connHoganMain) or
> die(mysql_error());
>
> //Line 48 below -
>
>   $insertGoTo = "thanks.php?id=" . $row_rsID['userID'] . "";
>   if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
>     $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
>     $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
>   }
>
> //Line 53 below -
>   header(sprintf("Location: %s", $insertGoTo));
> }
>
> mysql_select_db($database_connHoganMain, $connHoganMain);
> $query_rsID = "SELECT * FROM `user`";
> $rsID = mysql_query($query_rsID, $connHoganMain) or die(mysql_error());
> $row_rsID = mysql_fetch_assoc($rsID);
> $totalRows_rsID = mysql_num_rows($rsID);
> ?>
> <html>
> <head>
> <title>User Registration</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
>
> <body>
> <h1><strong><font size="6" face="Arial, Helvetica, sans-serif">Enter
> Registration
>   Information </font></strong></h1>
> <form action="<?php echo $editFormAction; ?>" method="POST"
> name="frmReg" id="frmReg">
>   <p><font size="2" face="Arial, Helvetica, sans-serif">You must fill in
> all the
>     required fields.</font></p>
>   <table width="51%" border="1">
>     <tr>
>       <td width="29%" bgcolor="#CCCCCC"> <div
> align="right"><strong><font size="2" face="Arial, Helvetica,
> sans-serif">First
>           Name: </font></strong></div></td>
>       <td width="71%"><div align="left">
>           <input name="txtFName" type="text" id="txtFName" size="30"
> maxlength="28">
>         </div></td>
>     </tr>
>     <tr>
>       <td bgcolor="#CCCCCC"> <div align="right"><strong><font size="2"
> face="Arial, Helvetica, sans-serif">Last
>           Name: </font></strong></div></td>
>       <td><div align="left">
>           <input name="txtLName" type="text" id="txtLName" size="30"
> maxlength="28">
>         </div></td>
>     </tr>
>     <tr>
>       <td bgcolor="#CCCCCC"> <div align="right"><strong><font size="2"
> face="Arial, Helvetica, sans-serif">Address:
>           </font></strong></div></td>
>       <td><div align="left">
>           <input name="txtAddress" type="text" id="txtAddress" size="40"
> maxlength="38">
>         </div></td>
>     </tr>
>     <tr>
>       <td bgcolor="#CCCCCC"> <div align="right"><strong><font size="2"
> face="Arial, Helvetica, sans-serif">City:
>           </font></strong></div></td>
>       <td><div align="left">
>           <input name="txtCity" type="text" id="txtCity" size="25"
> maxlength="23">
>         </div></td>
>     </tr>
>     <tr>
>       <td bgcolor="#CCCCCC"> <div align="right"><strong><font size="2"
> face="Arial, Helvetica, sans-serif">State:
>           </font></strong></div></td>
>       <td><div align="left">
>           <input name="txtState" type="text" id="txtState" size="28"
> maxlength="26">
>         </div></td>
>     </tr>
>     <tr>
>       <td bgcolor="#CCCCCC"> <div align="right"><strong><font size="2"
> face="Arial, Helvetica, sans-serif">Zip:
>           </font></strong></div></td>
>       <td><div align="left">
>           <input name="txtZip" type="text" id="txtZip" size="12"
> maxlength="10">
>         </div></td>
>     </tr>
>     <tr>
>       <td bgcolor="#CCCCCC"> <div align="right"><strong><font size="2"
> face="Arial, Helvetica, sans-serif">Phone:
>           </font></strong></div></td>
>       <td><div align="left">
>           <input name="txtPhone" type="text" id="txtPhone" size="14"
> maxlength="12">
>         </div></td>
>     </tr>
>     <tr>
>       <td bgcolor="#CCCCCC"><div align="right"><strong><font size="2"
> face="Arial, Helvetica, sans-serif">UserName:</font></strong></div></td>
>       <td><input name="txtUserName" type="text" id="txtUserName"
> size="27" maxlength="25"></td>
>     </tr>
>     <tr>
>       <td bgcolor="#CCCCCC"> <div align="right"><strong><font size="2"
> face="Arial, Helvetica, sans-serif">eMail
>           Address: </font></strong></div></td>
>       <td><div align="left">
>           <input name="txtEmail" type="text" id="txtEmail" size="40"
> maxlength="38">
>         </div></td>
>     </tr>
>   </table>
>   <br>
>   <input name="Submit" type="submit" id="Submit" value="Submit">
>   <input name="Reset" type="reset" id="Reset" value="Reset">
>   <input type="hidden" name="MM_insert" value="frmReg">
> </form>
> <p><br>
> </p>
> <p><strong><font size="3" face="Arial, Helvetica,
> sans-serif"></font></strong>
> </p>
>
> <?php
> mysql_free_result($rsID);
> ?>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

---------------------------------------------------------------------------
Peter Beckman            Systems Engineer, Fairfax Cable Access Corporation
beckman@purplecow.com                             http://www.purplecow.com/
---------------------------------------------------------------------------


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux