Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. can you add this // Do update statement. @mysql_query("update P_Leader set UCAS_Code='$UCAS_Code', CourseName='$CourseName', PLTitle='$PLTitle', PLFirstName='$PLFirstName', PLName='$PLName', PLemailAddress='$PLemailAddress', PLTelNo='$PLTelNo', PLContractStart='$PLContractStart', PLContractEnd='$ContractEnd', PLActive='$PLActive' where ID_Number='$ID_Number'"); die("update P_Leader set UCAS_Code='$UCAS_Code', CourseName='$CourseName', PLTitle='$PLTitle', PLFirstName='$PLFirstName', PLName='$PLName', PLemailAddress='$PLemailAddress', PLTelNo='$PLTelNo', PLContractStart='$PLContractStart', PLContractEnd='$ContractEnd', PLActive='$PLActive' where ID_Number='$ID_Number'"); // Re-direct this page to updateZX.php. $ID_Number=$_POST['ID_Number']; header("location: updateZX.php?ID_Number=$ID_Number"); exit; comment out the ob_start(); it should display update P_....... paste that into SQL in the phpMyAdmin, and let me know the results
  2. was missing the ID_number <?php ob_start(); // Connect database. @include("opendbincludeA.php"); // ***** This part will process when you Click on "Submit" button ***** // Check, if you clicked "Submit" button if($_POST['Submit']) { // Get parameters from form. $ID_Number=$_POST['ID_Number']; $UCAS_Code=$_POST['UCAS_Code']; $CourseName=$_POST['CourseName']; $PLTitle=$_POST['PLTitle']; $PLFirstName=$_POST['PLFirstName']; $PLName=$_POST['PLName']; $PLemailAddress=$_POST['PLemailAddress']; $PLTelNo=$_POST['PLTelNo']; $PLContractStart=$_POST['PLContractStart']; $PLContractEnd=$_POST['PLContractEnd']; $PLActive=$_POST['PLActive']; // Do update statement. @mysql_query("update P_Leader set UCAS_Code='$UCAS_Code', CourseName='$CourseName', PLTitle='$PLTitle', PLFirstName='$PLFirstName', PLName='$PLName', PLemailAddress='$PLemailAddress', PLTelNo='$PLTelNo', PLContractStart='$PLContractStart', PLContractEnd='$ContractEnd', PLActive='$PLActive' where ID_Number='$ID_Number'"); // Re-direct this page to updateZX.php. $ID_Number=$_POST['ID_Number']; header("location: updateZX.php?ID_Number=$ID_Number"); exit; }else{ // ************* End update part ************* // *** Select data to show on text fields in form. *** // Get id parameter (GET method) from updateZX.php $ID_Number=$_GET['ID_Number']; // Get records in all columns from table where column id equal in $id and put it in $result. $result=mysql_query("select * from P_Leader where ID_Number='$ID_Number'"); // Split records in $result by table rows and put them in $row. $row=mysql_fetch_assoc($result); ?> <!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>Update Programme Leader*</title> </head> <body> <!-- set this form to POST method and target this form to itself ($PHP_SELF;)--> <form id="form1" name="form1" method="post" action="<?php echo $PHP_SELF; ?>"> <p> <input name="ID_Number" type="hidden" id="ID_Number" value="<?php echo $row['ID_Number']; ?>"/> UCAS Code : <!-- name of this text field is "UCAS_Code" --> <input name="UCAS_Code" type="text" id="UCAS_Code" value="<?php echo $row['UCAS_Code']; ?>"/> Title : <!-- name of this text field is "CourseName" --> <input name="CourseName" type="text" id="CourseName" value="<?php echo $row['CourseName']; ?>"/> Title : <!-- name of this text field is "PLTitle" --> <input name="PLTitle" type="text" id="PLTitle" value="<?php echo $row['PLTitle']; ?>"/> First Name : <!-- name of this text field is "PLFirstName" --> <input name="PLFirstName" type="text" id="PLFirstName" value="<?php echo $row['PLFirstName']; ?>"/> Name : <!-- name of this text field is "PLSName" --> <input name="PLSName" type="text" id="PLSName" value="<?php echo $row['PLSName']; ?>"/> email : <!-- name of this text field is "PLemailAddress" --> <input name="PLemailAddress" type="text" id="PLemailAddress" value="<?php echo $row['PLemailAddress']; ?>"/> Tel No : <!-- name of this text field is "PLTelNo" --> <input name="PLTelNo" type="text" id="PLTelNo" value="<?php echo $row['PLTelNo']; ?>"/> <br /> Contract Start : <!-- name of this text field is "PLContractStart" --> <input name="PLContractStart" type="text" id="PLContractStart" value="<?php echo $row['PLContractStart']; ?>"/> <br /> Contract End : <!-- name of this text field is "PLContractEnd" --> <input name="PLContractEnd" type="text" id="PLContractEnd" value="<?php echo $row['PLContractEnd']; ?>"/> <br /> Active : <!-- name of this text field is "PLActive" --> <input name="PLActive" type="text" id="PLActive" value="<?php echo $row['PLActive']; ?>"/> </p> <p> <input type="submit" name="Submit" value="Submit" /> </p> </form> <?php // Close database connection. } ob_end_flush(); mysql_close(); ?> </body> </html>
  3. move $date_stamp =$row2['datestamp'] ; $new_id = $row2['ID']; into the whileloop
  4. Cool
  5. change , to . on echo "date - ", $newdate," - ",$new_id;
  6. ok this i think is the root of the problem.. for testing comment out the ob_start(); and change <?php @mysql_query("update P_Leader set UCAS_Code='$UCAS_Code', CourseName='$CourseName', PLTitle='$PLTitle', PLFirstName='$PLFirstName', PLName='$PLName', PLemailAddress='$PLemailAddress', PLTelNo='$PLTelNo', PLContractStart='$PLContractStart', PLContractEnd='$ContractEnd', PLActive='$PLActive' where ID_Number='$ID_Number'"); // Re-direct this page to updateZX.php. header("location: updateZX.php"); exit; ?> to <?php $SQLq = "update P_Leader set UCAS_Code='$UCAS_Code', CourseName='$CourseName', PLTitle='$PLTitle', PLFirstName='$PLFirstName', PLName='$PLName', PLemailAddress='$PLemailAddress', PLTelNo='$PLTelNo', PLContractStart='$PLContractStart', PLContractEnd='$ContractEnd', PLActive='$PLActive' where ID_Number='$ID_Number'"; mysql_query($SQLq) or die("query error: $SQLq<br>".mysql_error()); // Re-direct this page to updateZX.php. exit; ?> and lets review the error,
  7. of course, this should work! i forgot to move a chunk down PS that error message helped <?php ob_start(); // Connect database. @include("opendbincludeA.php"); // ***** This part will process when you Click on "Submit" button ***** // Check, if you clicked "Submit" button if($_POST['Submit']) { // Get parameters from form. $ID_Number=$_POST['ID_Number']; $UCAS_Code=$_POST['UCAS_Code']; $CourseName=$_POST['CourseName']; $PLTitle=$_POST['PLTitle']; $PLFirstName=$_POST['PLFirstName']; $PLName=$_POST['PLName']; $PLemailAddress=$_POST['PLemailAddress']; $PLTelNo=$_POST['PLTelNo']; $PLContractStart=$_POST['PLContractStart']; $PLContractEnd=$_POST['PLContractEnd']; $PLActive=$_POST['PLActive']; // Do update statement. @mysql_query("update P_Leader set UCAS_Code='$UCAS_Code', CourseName='$CourseName', PLTitle='$PLTitle', PLFirstName='$PLFirstName', PLName='$PLName', PLemailAddress='$PLemailAddress', PLTelNo='$PLTelNo', PLContractStart='$PLContractStart', PLContractEnd='$ContractEnd', PLActive='$PLActive' where ID_Number='$ID_Number'"); // Re-direct this page to updateZX.php. header("location: updateZX.php"); exit; }else{ // ************* End update part ************* // *** Select data to show on text fields in form. *** // Get id parameter (GET method) from updateZX.php $ID_Number=$_GET['ID_Number']; // Get records in all columns from table where column id equal in $id and put it in $result. $result=mysql_query("select * from P_Leader where ID_Number='$ID_Number'"); // Split records in $result by table rows and put them in $row. $row=mysql_fetch_assoc($result); ?> <!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>Update Programme Leader*</title> </head> <body> <!-- set this form to POST method and target this form to itself ($PHP_SELF;)--> <form id="form1" name="form1" method="post" action="<?php echo $PHP_SELF; ?>"> <p> UCAS Code : <!-- name of this text field is "UCAS_Code" --> <input name="UCAS_Code" type="text" id="UCAS_Code" value="<?php echo $row['UCAS_Code']; ?>"/> Title : <!-- name of this text field is "CourseName" --> <input name="CourseName" type="text" id="CourseName" value="<?php echo $row['CourseName']; ?>"/> Title : <!-- name of this text field is "PLTitle" --> <input name="PLTitle" type="text" id="PLTitle" value="<?php echo $row['PLTitle']; ?>"/> First Name : <!-- name of this text field is "PLFirstName" --> <input name="PLFirstName" type="text" id="PLFirstName" value="<?php echo $row['PLFirstName']; ?>"/> Name : <!-- name of this text field is "PLSName" --> <input name="PLSName" type="text" id="PLSName" value="<?php echo $row['PLSName']; ?>"/> email : <!-- name of this text field is "PLemailAddress" --> <input name="PLemailAddress" type="text" id="PLemailAddress" value="<?php echo $row['PLemailAddress']; ?>"/> Tel No : <!-- name of this text field is "PLTelNo" --> <input name="PLTelNo" type="text" id="PLTelNo" value="<?php echo $row['PLTelNo']; ?>"/> <br /> Contract Start : <!-- name of this text field is "PLContractStart" --> <input name="PLContractStart" type="text" id="PLContractStart" value="<?php echo $row['PLContractStart']; ?>"/> <br /> Contract End : <!-- name of this text field is "PLContractEnd" --> <input name="PLContractEnd" type="text" id="PLContractEnd" value="<?php echo $row['PLContractEnd']; ?>"/> <br /> Active : <!-- name of this text field is "PLActive" --> <input name="PLActive" type="text" id="PLActive" value="<?php echo $row['PLActive']; ?>"/> </p> <p> <input type="submit" name="Submit" value="Submit" /> </p> </form> <?php // Close database connection. } ob_end_flush(); mysql_close(); ?> </body> </html>
  8. <?php phpinfo(); ?> should show it
  9. oooops updated <!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>Update Programme Leader*</title> </head> <body> <?php ob_start(); // Connect database. @include("opendbincludeA.php"); // ***** This part will process when you Click on "Submit" button ***** // Check, if you clicked "Submit" button if($_POST['Submit']) { // Get parameters from form. $ID_Number=$_POST['ID_Number']; $UCAS_Code=$_POST['UCAS_Code']; $CourseName=$_POST['CourseName']; $PLTitle=$_POST['PLTitle']; $PLFirstName=$_POST['PLFirstName']; $PLName=$_POST['PLName']; $PLemailAddress=$_POST['PLemailAddress']; $PLTelNo=$_POST['PLTelNo']; $PLContractStart=$_POST['PLContractStart']; $PLContractEnd=$_POST['PLContractEnd']; $PLActive=$_POST['PLActive']; // Do update statement. @mysql_query("update P_Leader set UCAS_Code='$UCAS_Code', CourseName='$CourseName', PLTitle='$PLTitle', PLFirstName='$PLFirstName', PLName='$PLName', PLemailAddress='$PLemailAddress', PLTelNo='$PLTelNo', PLContractStart='$PLContractStart', PLContractEnd='$ContractEnd', PLActive='$PLActive' where ID_Number='$ID_Number'"); // Re-direct this page to updateZX.php. header("location: updateZX.php"); exit; }else{ // ************* End update part ************* // *** Select data to show on text fields in form. *** // Get id parameter (GET method) from updateZX.php $ID_Number=$_GET['ID_Number']; // Get records in all columns from table where column id equal in $id and put it in $result. $result=mysql_query("select * from P_Leader where ID_Number='$ID_Number'"); // Split records in $result by table rows and put them in $row. $row=mysql_fetch_assoc($result); ?> <!-- set this form to POST method and target this form to itself ($PHP_SELF;)--> <form id="form1" name="form1" method="post" action="<?php echo $PHP_SELF; ?>"> <p> UCAS Code : <!-- name of this text field is "UCAS_Code" --> <input name="UCAS_Code" type="text" id="UCAS_Code" value="<?php echo $row['UCAS_Code']; ?>"/> Title : <!-- name of this text field is "CourseName" --> <input name="CourseName" type="text" id="CourseName" value="<?php echo $row['CourseName']; ?>"/> Title : <!-- name of this text field is "PLTitle" --> <input name="PLTitle" type="text" id="PLTitle" value="<?php echo $row['PLTitle']; ?>"/> First Name : <!-- name of this text field is "PLFirstName" --> <input name="PLFirstName" type="text" id="PLFirstName" value="<?php echo $row['PLFirstName']; ?>"/> Name : <!-- name of this text field is "PLSName" --> <input name="PLSName" type="text" id="PLSName" value="<?php echo $row['PLSName']; ?>"/> email : <!-- name of this text field is "PLemailAddress" --> <input name="PLemailAddress" type="text" id="PLemailAddress" value="<?php echo $row['PLemailAddress']; ?>"/> Tel No : <!-- name of this text field is "PLTelNo" --> <input name="PLTelNo" type="text" id="PLTelNo" value="<?php echo $row['PLTelNo']; ?>"/> <br /> Contract Start : <!-- name of this text field is "PLContractStart" --> <input name="PLContractStart" type="text" id="PLContractStart" value="<?php echo $row['PLContractStart']; ?>"/> <br /> Contract End : <!-- name of this text field is "PLContractEnd" --> <input name="PLContractEnd" type="text" id="PLContractEnd" value="<?php echo $row['PLContractEnd']; ?>"/> <br /> Active : <!-- name of this text field is "PLActive" --> <input name="PLActive" type="text" id="PLActive" value="<?php echo $row['PLActive']; ?>"/> </p> <p> <input type="submit" name="Submit" value="Submit" /> </p> </form> <?php // Close database connection. } ob_end_flush(); mysql_close(); ?> </body> </html>
  10. please click solved
  11. as for the SMTP i would used the domain name, i don't know where the setting is, but i think its a "mail relaying" but i am probably wrong!
  12. please read the header post
  13. try this <!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>Update Programme Leader*</title> </head> <body> <?php ob_start(); // Connect database. @include("opendbincludeA.php"); // ***** This part will process when you Click on "Submit" button ***** // Check, if you clicked "Submit" button if($_POST['Submit']) { // Get parameters from form. $ID_Number=$_POST['ID_Number']; $UCAS_Code=$_POST['UCAS_Code']; $CourseName=$_POST['CourseName']; $PLTitle=$_POST['PLTitle']; $PLFirstName=$_POST['PLFirstName']; $PLName=$_POST['PLName']; $PLemailAddress=$_POST['PLemailAddress']; $PLTelNo=$_POST['PLTelNo']; $PLContractStart=$_POST['PLContractStart']; $PLContractEnd=$_POST['PLContractEnd']; $PLActive=$_POST['PLActive']; // Do update statement. @mysql_query("update P_Leader set UCAS_Code='$UCAS_Code', CourseName='$CourseName', PLTitle='$PLTitle', PLFirstName='$PLFirstName', PLName='$PLName', PLemailAddress='$PLemailAddress', PLTelNo='$PLTelNo', PLContractStart='$PLContractStart', PLContractEnd='$ContractEnd', PLActive='$PLActive' where ID_Number='$ID_Number'"); // Re-direct this page to updateZX.php. header("location: updateZX.php"); exit; }else( // ************* End update part ************* // *** Select data to show on text fields in form. *** // Get id parameter (GET method) from updateZX.php $ID_Number=$_GET['ID_Number']; // Get records in all columns from table where column id equal in $id and put it in $result. $result=mysql_query("select * from P_Leader where ID_Number='$ID_Number'"); // Split records in $result by table rows and put them in $row. $row=mysql_fetch_assoc($result); ?> <!-- set this form to POST method and target this form to itself ($PHP_SELF;)--> <form id="form1" name="form1" method="post" action="<?php echo $PHP_SELF; ?>"> <p> UCAS Code : <!-- name of this text field is "UCAS_Code" --> <input name="UCAS_Code" type="text" id="UCAS_Code" value="<?php echo $row['UCAS_Code']; ?>"/> Title : <!-- name of this text field is "CourseName" --> <input name="CourseName" type="text" id="CourseName" value="<?php echo $row['CourseName']; ?>"/> Title : <!-- name of this text field is "PLTitle" --> <input name="PLTitle" type="text" id="PLTitle" value="<?php echo $row['PLTitle']; ?>"/> First Name : <!-- name of this text field is "PLFirstName" --> <input name="PLFirstName" type="text" id="PLFirstName" value="<?php echo $row['PLFirstName']; ?>"/> Name : <!-- name of this text field is "PLSName" --> <input name="PLSName" type="text" id="PLSName" value="<?php echo $row['PLSName']; ?>"/> email : <!-- name of this text field is "PLemailAddress" --> <input name="PLemailAddress" type="text" id="PLemailAddress" value="<?php echo $row['PLemailAddress']; ?>"/> Tel No : <!-- name of this text field is "PLTelNo" --> <input name="PLTelNo" type="text" id="PLTelNo" value="<?php echo $row['PLTelNo']; ?>"/> <br /> Contract Start : <!-- name of this text field is "PLContractStart" --> <input name="PLContractStart" type="text" id="PLContractStart" value="<?php echo $row['PLContractStart']; ?>"/> <br /> Contract End : <!-- name of this text field is "PLContractEnd" --> <input name="PLContractEnd" type="text" id="PLContractEnd" value="<?php echo $row['PLContractEnd']; ?>"/> <br /> Active : <!-- name of this text field is "PLActive" --> <input name="PLActive" type="text" id="PLActive" value="<?php echo $row['PLActive']; ?>"/> </p> <p> <input type="submit" name="Submit" value="Submit" /> </p> </form> <?php // Close database connection. } ob_end_flush(); mysql_close(); ?> </body> </html> if this fails please comment out the ob_end_flush(); and ob_flush(); and post the errors
  14. rule 1, don't trust ANY input from the use, filter it all, mysql_real_escape_string is a simple solution
  15. the statement looks fine to me.. check the fields exists etc, also try printing the statement and use it in myphpadmin and see what's returned, it may show the error !
  16. check the email setup for your mail server, also does it accept requests from remote domains (if its not on the same server)
  17. the window that opens, check the code for anything that says session ie $_SESSION, $session_destory() etc
  18. for email you can try <?php if (eregi('\\A\\b[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b\\z', $email)) { echo "valid"; } ?> this is untested
  19. ooow that looks cool, thanks emehrkay & utexas_pjm & 448191, i guess its testing time, i don't have time until the weekend but i have some ideas to play with.. will report back note (will leave unsolved as a expect problems)
  20. mandukar Read the post
  21. Oh this is used for active members for in the last hour, if you want then to be removed from the list on logout add this to the logout $id = $_SESSION['tznUserId']; mysql_query("UPDATE `surv_member` SET timestamp=NOW() WHERE memberId='$id' LIMIT 1"); Oh this would work better <?php $query=mysql_query("SELECT * FROM `surv_member` WHERE `timestamp` <= (NOW()-60*60)") or die(mysql_error()); ?> OK well i am drained, i need sleep, catch ya later
  22. correct, runs by time alone if they are inactive for an hour then they are off the list, $query=mysql_query("SELECT * FROM `surv_member` WHERE (`timestamp`+60*60) >= NOW()") or die(mysql_error()); change (`timestamp`+60*60) to (`timestamp`+30*60) for 30 minutes etc
  23. ok 1:21am i'm out night i hope its truly working.
  24. i had to re-work the dates, they can be a pain sometimes
  25. ok na don't use mIRC or any IRc's <?php $id = $_SESSION['tznUserId']; mysql_query("UPDATE `surv_member` SET timestamp=NOW() WHERE memberId='$id' LIMIT 1"); $query=mysql_query("SELECT * FROM `surv_member` WHERE (`timestamp`+60*60) >= NOW()") or die(mysql_error()); $display = array(); while($row=mysql_fetch_array($query)) { $display[] = $row['username']; } //spit out the results mysql_close(); foreach($display as $d) { print "$d<br />"; } ?>
×
×
  • 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.