Jump to content

CrownVictoriaCop

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

CrownVictoriaCop's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, the operator fix worked. But now there's only one problem: when I enter valid data into the form, nothing happens. I changed <input type="submit" name="button" id="button" value="Check" /> to <input type="submit" name="submit" id="submit" value="Check" /> to satisfy the if condition, but still, no result.
  2. I'm having trouble with a script and I just can't figure out what's wrong with it. The script is located at http://www.qlhosting.com/ham/check.php Here's the code for it <?php if (isset($_POST['submit'])) { $domain = $_POST['domain']; $password = md5($_POST['password']); include 'db.php'; mysql_query("SELECT * FROM apps WHERE domain='$domain' AND WHERE cpassmd5='$password' LIMIT 1"); $stat = $row['status']; } else { } ?> <!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=utf-8" /> <title>Quotaless Web Hosting | Check Status</title> <style type="text/css"> body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } </style> </head> <body> <h1>Check Application/Account Status</h1> <?php if ($stat="PENDING") { echo "<hr />"; echo "Your application is currently listed as PENDING. Our staff have not viewed your application yet. Please be patient, and watch your email for a response. Thank you!"; } elseif ($stat="NMI") { echo "<hr />"; echo "We need more information from you in order to take action on your application. Please check your e-mail inbox for a message from our staff specifically stating what we need. If you did not get this message, please post a message on our support forum. Thank you!"; } else { } ?> <hr /> <h2>To check the status of your application or account, login using the form below.</h2> <form id="check" name="check" method="post" action="<?php echo $PHP_SELF;?>"> <p>Domain: <input type="text" name="domain" id="domain" /> <br /> Password: <input type="password" name="password" id="password" /> <br /> <input type="submit" name="button" id="button" value="Check" /> </p> </form> <hr /> <p> </p> </body> </html> The part under if ($stat="PENDING") is performed upon page load, even when the if condition relating to it is false. I can't seem to figure out what exactly is wrong here. Please help me out. I would really appreciate the help. Thanks! Anthony
  3. I am trying to create a form where a user uploads a file and it sends it to an email address. Unfortunately, I've tried almost every online resource, and nothing has worked for me so far. I am trying to use PHPMailer to handle the form, since my server seems like it doesn't allow mail() or sendmail(). Can anyone help me out with this? Anthony
  4. What am I supposed to do with these? Edit: I changed the code to that, but I am still having the same problem.
  5. Hey Guys, I'm currently coding a script for a driving school. I programmed the code below, which goes on their homepage. They have two different locations, so I created the script below, which displays the class schedule for the two locations in a single table. Unfortunately, it is not displaying all of my test values. I have three test entries for when location is set to "27th" and four test entries for when location is set to "greenfieldhs", but it's only displaying three entries per variable. Can someone please take a look at this and see what's going on? Thanks! Anthony <table width="100%" border="0" align="center"> <tr> <td colspan="2" class="tablehead" width="50%" align="center">Milwaukee (27th Street)</td> <td colspan="2" class="tablehead" width="50%" align="center">Greenfield High School</td> </tr> <?php include 'db.php'; $query="SELECT * FROM classes WHERE location='27th'"; $query2="SELECT * FROM classes WHERE location='greenfieldhs'"; $result=mysql_query($query); $result2=mysql_query($query2); $num=mysql_numrows($result); $num2=mysql_numrows($result2); mysql_close(); ?> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"date"); $f2=mysql_result($result,$i,"time"); $f3=mysql_result($result2,$i,"date"); $f4=mysql_result($result2,$i,"time"); ?> <tr> <td width="30%" class="tablecontent"><?php echo $f1; ?></td> <td width="20%" class="tablecontent"><?php echo $f2; ?></td> <td width="30%" class="tablecontent"><?php echo $f3; ?></td> <td width="20%" class="tablecontent"><?php echo $f4; ?></td> </tr> <?php $i++; } ?> </table>
  6. I'll be sure to do that. It's for an administration area, though, that is secured by 401 authorization.
  7. It works! Thank you guys so much! You guys deserve something in return for this. One thing is for sure - I'll never use Dreamweaver's form generator again - it didn't put my post method in for some reason. Thank you, thank you, thank you! Anthony
  8. Hmmm...here's the form I am using. <form action="editinfo.php"> Student ID: <input name="id" type="text" > <input type="submit"> </form>
  9. Doing this brings the up the error Fatal error: SQL: select * from Students where ID = , ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 in /home2/safetyfi/public_html/secure/managementv2/editinfo.php on line 9
  10. Thanks guys for your advice. Here's my new code: <?php $SID = $_POST['id']; mysql_connect("localhost","safetyfi_secure","hidden") or die("Error: ".mysql_error()); mysql_select_db("safetyfi_students"); $result = mysql_query("select * from Students where ID = $SID"); while ($row = mysql_fetch_array($result)){ $id = $row['ID']; $studentname = $row['StudentName']; $parentfirstname = $row['ParentFirstName']; $lastname = $row['ParentLastName']; $class = $row['Class']; $address = $row['Address']; $city = $row['City']; $state = $row['State']; $zip = $row['ZIP']; $phone = $row['Phone']; $school = $row['School']; $birthmonth = $row['BirthMonth']; $birthday = $row['BirthDay']; $birthyear = $row['BirthYear']; $paymentmethod = $row['PaymentMethod']; } mysql_free_result($result); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>ODISM Instructor Control Panel</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" type="text/css" href="styles.css" /> <link rel="stylesheet" href="menu.css" type="text/css" /> <script type="text/javascript"> <!-- function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } } //--> </script> </head> <body> <!-- Begin Wrapper --> <div id="wrapper"> <!-- Begin Header --> <div id="header"> <h1><img src="banner.png" width="907" height="100" alt="Imponente Web Services" /></h1> </div> <!-- End Header --> <!-- Begin Left Column --> <div id="leftcolumn"> <div align="center"><font size="4">Student Management</font><br /> </div> <div id="menu"> <ul> <li><a href="directory.php">List Students</a></li> <li><a href="addstudent.php">Add Student</a></li> <li><a href="editstudent.php">Edit Student</a></li> <li><a href="deletestudent.php">Delete Student</a></li> </ul> </div></div> <!-- End Left Column --> <!-- Begin Content Column --> <div id="content"> <p>Edit Student</p> <br /> <p>The student record is displayed below for you to edit.</p> <br /> <form action="updateinfo.php" method="post"> <p>Student's First Name: <input type="text" value="<?php echo $studentname;?>" name="studentname"/><br /> Parent's First Name: <input type="text" value="<?php echo $parentfirstname;?>" name="parentfirstname"/><br /> Parent's Last Name: <input type="text" value="<?php echo $lastname;?>" name="lastname"/><br /> Phone Number: <input type="text" value="<?php echo $phone;?>" name="phone"/><br /> Class: <input type="text" value="<?php echo $class;?>" name="class"/><br /> Address: <input type="text" value="<?php echo $address;?>" name="address"/><br /> City: <input type="text" value="<?php echo $city;?>" name="city"/> <br /> State: <input type="text" value="<?php echo $state;?>" name="state"/><br /> Zip: <input type="text" value="<?php echo $zip;?>" name="state"/><br /> DOB: <input name="state" type="text" value="<?php echo $birthmonth;?>" size="20"/> <input name="state" type="text" value="<?php echo $birthday;?>" size="5"/> <input name="state" type="text" value="<?php echo $birthyear;?>" size="5"/><br> School: <input name="state" type="text" value="<?php echo $school;?>" /><br /> <input name="submit" type="submit" value="Edit Student" /> </form> </p> </div> <!-- End Content Column --> <!-- Begin Right Column --> <div id="rightcolumn"> <div align="center"><font size="4">Other Tools</font><br /> <div id="menu"> <ul> <li><a href="email.php">Email Developer</a></li> <li><a href="http://www.paypal.com">PayPal Management</a></li> </ul> </div> </div> <p> </p> </p> </div> <hr noshade> <!-- End Right Column --> <!-- Begin Footer --> <div id="footer"><b><font color="white">Online Driving School Management 2.00</font></b></div> <!-- End Footer --> </div> <!-- End Wrapper --> </body> </html> But I'm still getting the same errors
  11. This is my code for a PHP page. <?php $SID = $_POST['id']; mysql_connect("localhost","safetyfi_secure","hidden") or die("Error: ".mysqlerror()); mysql_select_db("safetyfi_students"); while ($row = mysql_fetch_array("select * from Students where ID = $SID")){ $id = $row['ID']; $studentname = $row['StudentName']; $parentfirstname = $row['ParentFirstName']; $lastname = $row['ParentLastName']; $class = $row['Class']; $address = $row['Address']; $city = $row['City']; $state = $row['State']; $zip = $row['ZIP']; $phone = $row['Phone']; $school = $row['School']; $birthmonth = $row['BirthMonth']; $birthday = $row['BirthDay']; $birthyear = $row['BirthYear']; $paymentmethod = $row['PaymentMethod']; } mysql_free_result($query); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>ODISM Instructor Control Panel</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" type="text/css" href="styles.css" /> <link rel="stylesheet" href="menu.css" type="text/css" /> <script type="text/javascript"> <!-- function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } } //--> </script> </head> <body> <!-- Begin Wrapper --> <div id="wrapper"> <!-- Begin Header --> <div id="header"> <h1><img src="banner.png" width="907" height="100" alt="Imponente Web Services" /></h1> </div> <!-- End Header --> <!-- Begin Left Column --> <div id="leftcolumn"> <div align="center"><font size="4">Student Management</font><br /> </div> <div id="menu"> <ul> <li><a href="directory.php">List Students</a></li> <li><a href="addstudent.php">Add Student</a></li> <li><a href="editstudent.php">Edit Student</a></li> <li><a href="deletestudent.php">Delete Student</a></li> </ul> </div></div> <!-- End Left Column --> <!-- Begin Content Column --> <div id="content"> <p>Edit Student</p> <br /> <p>The student record is displayed below for you to edit.</p> <br /> <form action="updateinfo.php" method="post"> <p>Student's First Name: <input type="text" value="<?php echo $studentname;?>" name="studentname"/><br /> Parent's First Name: <input type="text" value="<?php echo $parentfirstname;?>" name="parentfirstname"/><br /> Parent's Last Name: <input type="text" value="<?php echo $lastname;?>" name="lastname"/><br /> Phone Number: <input type="text" value="<?php echo $phone;?>" name="phone"/><br /> Class: <input type="text" value="<?php echo $class;?>" name="class"/><br /> Address: <input type="text" value="<?php echo $address;?>" name="address"/><br /> City: <input type="text" value="<?php echo $city;?>" name="city"/> <br /> State: <input type="text" value="<?php echo $state;?>" name="state"/><br /> Zip: <input type="text" value="<?php echo $zip;?>" name="state"/><br /> DOB: <input name="state" type="text" value="<?php echo $birthmonth;?>" size="20"/> <input name="state" type="text" value="<?php echo $birthday;?>" size="5"/> <input name="state" type="text" value="<?php echo $birthyear;?>" size="5"/><br> School: <input name="state" type="text" value="<?php echo $school;?>" /><br /> <input name="submit" type="submit" value="Edit Student" /> </form> </p> </div> <!-- End Content Column --> <!-- Begin Right Column --> <div id="rightcolumn"> <div align="center"><font size="4">Other Tools</font><br /> <div id="menu"> <ul> <li><a href="email.php">Email Developer</a></li> <li><a href="http://www.paypal.com">PayPal Management</a></li> </ul> </div> </div> <p> </p> </p> </div> <hr noshade> <!-- End Right Column --> <!-- Begin Footer --> <div id="footer"><b><font color="white">Online Driving School Management 2.00</font></b></div> <!-- End Footer --> </div> <!-- End Wrapper --> </body> </html> Getting the following errors Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/safetyfi/public_html/secure/managementv2/editinfo.php on line 8 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home2/safetyfi/public_html/secure/managementv2/editinfo.php on line 27 Can anyone tell me what is wrong?
  12. Nothing shows up on the results page. [code]<?php $dbhost = 'localhost'; $dbuser = 'safetyfi_secure'; $dbpass = 'hidden'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'safetyfi_students'; mysql_select_db($dbname); if(isset($_POST['Row'])) { $Row = mysql_real_escape_string($_POST['Row']); $Search = mysql_select("SELECT * FROM Students WHERE `ID`='$Row'"); $Search = mysql_fetch_assoc($Search); echo "<form action=\"\" method=\"post\"> ID: <input type=\"text\" name=\"RowID\"><br>"; foreach($Search as $k=>$v) { echo "$k: <input type=\"text\" name=\"$k\" value=\"$v\"><br>"; } echo "<input type=\"submit\" value=\"Edit\">"; } if(isset($_POST['RowID'])) { $RowID = mysql_real_escape_string($_POST['RowID']); foreach($_POST as $k=>$v) { if($k == "submit" || $k == "RowID") { continue; } $k = mysql_real_escape_string($k); $v = mysql_real_escape_string($v); mysql_query("UPDATE `table` SET `$k`='$v' WHERE ID='$RowID'"); } } ?>
  13. Hello, Here's what I'm trying to do. Build a page where a user enters a MySQL row number in. Then, a new page appears with an HTML form where the user can edit the information in that row. Like for example, there's an input field for name, address, phone, etc. How would I possibly do this? I tried looking online, but nothing is working for me. Anthony
  14. Found out the error and fixed it. Thank you guys again for helping a n00b!
×
×
  • 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.