Jump to content

andrew121

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

andrew121's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. well let me rephrase "im good in php" sorry lol EDIT: well the search.php lists all the last names. what i want to do is when someone submits one of the last names it will take the person to the results page so that they would be able to edit it.
  2. All i need to know is how to make a URL parameter or what it is. but hold on let me find the script search.php <?php require_once('Connections/Maodatabase.php'); ?> <?php mysql_select_db($database_Maodatabase, $Maodatabase); $query_Recordset1 = "SELECT RegLastName FROM registrants ORDER BY RegLastName ASC"; $Recordset1 = mysql_query($query_Recordset1, $Maodatabase) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Workshop Registration</title> <style type="text/css"> <!-- .style1 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } a:link { color: #330066; } a:visited { color: #330066; } a:hover { color: #330066; } a:active { color: #330066; } --> </style> </head> <body> <table width="700"> <tr> <td><img src="banner.gif" width="700" height="92" /></td> </tr> <tr> <td> </td> </tr> <tr> <td><center> <form id="form1" name="form1" method="get" action="results.php"> <table width="265" border="1"> <tr> <td width="150"><strong>Search by Last Name </strong></td> <td width="99"><label> <select name="select"> <?php do { ?> <option value="<?php echo $row_Recordset1['RegLastName']?>"><?php echo $row_Recordset1['RegLastName']?></option> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); $rows = mysql_num_rows($Recordset1); if($rows > 0) { mysql_data_seek($Recordset1, 0); $row_Recordset1 = mysql_fetch_assoc($Recordset1); } ?> </select> </label></td> </tr> <tr> <td> </td> <td> <input type="submit" name="Submit" value="Submit" /> </td> </tr> </table> </form> </center> <div align="center"><span class="style1"><a href="register.php">Registration</a> | <a href="view.php">View Registrations</a> | <a href="search.php">Edit Registrations</a> </span></div></td> </tr> </table> </body> </html> <?php mysql_free_result($Recordset1); ?> results.php <?php require_once('Connections/Maodatabase.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 = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE registrants SET Username=%s, Password=%s, RegID=%s, RegFirstName=%s, RegAddress=%s, RegPhone=%s, RegEmail=%s, RegPeriod1RM=%s, RegPeriod1=%s, RegPeriod2RM=%s, RegPeriod2=%s, RegPeriod3RM=%s, RegPeriod3=%s, RegPeriod4RM=%s, RegPeriod4=%s, RegPeriod5RM=%s, RegPeriod5=%s, RegPeriod6RM=%s, RegPeriod6=%s, RegPeriod7RM=%s, RegPeriod7=%s, RegPeriod8RM=%s, RegPeriod8=%s, RegAcademy=%s WHERE RegLastName=%s", GetSQLValueString($_POST['Username'], "text"), GetSQLValueString($_POST['Password'], "text"), GetSQLValueString($_POST['RegID'], "int"), GetSQLValueString($_POST['RegFirstName'], "text"), GetSQLValueString($_POST['RegAddress'], "text"), GetSQLValueString($_POST['RegPhone'], "text"), GetSQLValueString($_POST['RegEmail'], "text"), GetSQLValueString($_POST['RegPeriod1RM'], "text"), GetSQLValueString($_POST['RegPeriod1'], "text"), GetSQLValueString($_POST['RegPeriod2RM'], "text"), GetSQLValueString($_POST['RegPeriod2'], "text"), GetSQLValueString($_POST['RegPeriod3RM'], "text"), GetSQLValueString($_POST['RegPeriod3'], "text"), GetSQLValueString($_POST['RegPeriod4RM'], "text"), GetSQLValueString($_POST['RegPeriod4'], "text"), GetSQLValueString($_POST['RegPeriod5RM'], "text"), GetSQLValueString($_POST['RegPeriod5'], "text"), GetSQLValueString($_POST['RegPeriod6RM'], "text"), GetSQLValueString($_POST['RegPeriod6'], "text"), GetSQLValueString($_POST['RegPeriod7RM'], "text"), GetSQLValueString($_POST['RegPeriod7'], "text"), GetSQLValueString($_POST['RegPeriod8RM'], "text"), GetSQLValueString($_POST['RegPeriod8'], "text"), GetSQLValueString($_POST['RegAcademy'], "text"), GetSQLValueString($_POST['RegLastName'], "text")); mysql_select_db($database_Maodatabase, $Maodatabase); $Result1 = mysql_query($updateSQL, $Maodatabase) or die(mysql_error()); $updateGoTo = "thanksedit.php"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $updateGoTo)); } $colname_Recordset1 = "-1"; if (isset($_GET['Select'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['Select'] : addslashes($_GET['Select']); } mysql_select_db($database_Maodatabase, $Maodatabase); $query_Recordset1 = sprintf("SELECT * FROM registrants WHERE RegLastName = '%s'", $colname_Recordset1); $Recordset1 = mysql_query($query_Recordset1, $Maodatabase) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Workshop Registration</title> <style type="text/css"> <!-- .style1 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } a:link { color: #330066; } a:visited { color: #330066; } a:hover { color: #330066; } a:active { color: #330066; } --> </style> </head> <body> <table width="700"> <tr> <td><img src="banner.gif" width="700" height="92" /></td> </tr> <tr> <td><form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">FirstName:</td> <td><input type="text" name="RegFirstName" value="<?php echo $row_Recordset1['RegFirstName']; ?>" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">LastName:</td> <td><input type="text" name="RegFirstName" value="<?php echo $row_Recordset1['RegLastName']; ?>" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Address:</td> <td><input type="text" name="RegAddress" value="<?php echo $row_Recordset1['RegAddress']; ?>" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Phone:</td> <td><input type="text" name="RegPhone" value="<?php echo $row_Recordset1['RegPhone']; ?>" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Email:</td> <td><input type="text" name="RegEmail" value="<?php echo $row_Recordset1['RegEmail']; ?>" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Update record"></td> </tr> </table> <input type="hidden" name="MM_update" value="form1"> <input type="hidden" name="RegLastName" value="<?php echo $row_Recordset1['RegLastName']; ?>"> </form> </td> </tr> <tr> <td><div align="center"><span class="style1"><a href="register.php">Registration</a> | <a href="view.php">View Registrations</a> | <a href="search.php">Edit Registrations</a> </span></div></td> </tr> </table> </body> </html> <?php mysql_free_result($Recordset1); ?> ignore the extra value strings
  3. Ive been working on a search feature for a school club. and i came across the URL parameter. I need to know how to create one ??? i am very good in php but if this is a really easy concept dont flame me please. i have madwares.com/register/search.php it works until it tries to show the information which is at the results page. if any1 can help me here id appreciate it. (please don't register and spam my database.....)
  4. Warning: fsockopen() [function.fsockopen]: unable to connect to allexser.dnsalias.net:90 (Connection timed out) in /home/content/a/l/l/allexser/html/test_login/test3/test.php on line 4 Offline
  5. well apperantly it still doesnt work... it says Offline: 111, Connection refused
  6. kk thanks i am trying to change port to 33 now and see if its the 4 digits that kill it.
  7. oh your right it says online. mmmh, when i change it to my port which is 43594 it says offline. i put it localhost.
  8. es iv tried it without html www.22salon.com/test_login/test3/test.php
  9. i do have an open port ive tried it on many servers.
  10. I am making a website and i have this www.22salon.com/test_login/test3/client.php i have a code that looks like this <?php $ip = "allexser.dnsalias.net"; //put your ipaddress here $port= "43594"; //the port number if (! $sock = @fsockopen($ip, $port, $num, $error, 5)) //Checks the server's status (43594 = port) { echo "<font>Offline</font>"; //When server status is offline, output this } else { echo "<font>Online</font>"; //Else, output this } ?> This code tells whether my RS private server is offline or Online but it doesnt work. it always shows offline. I know how to use this inside an html website so dont tell me that i am doing something wrong in html. All i know is that the script is wrong. all help is appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.