-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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
-
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>
-
move $date_stamp =$row2['datestamp'] ; $new_id = $row2['ID']; into the whileloop
-
change , to . on echo "date - ", $newdate," - ",$new_id;
-
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,
-
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>
-
<?php phpinfo(); ?> should show it
-
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>
-
please click solved
-
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!
-
please read the header post
-
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
-
rule 1, don't trust ANY input from the use, filter it all, mysql_real_escape_string is a simple solution
-
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 !
-
check the email setup for your mail server, also does it accept requests from remote domains (if its not on the same server)
-
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
-
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)
-
mandukar Read the post
-
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
-
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
-
ok 1:21am i'm out night i hope its truly working.
-
i had to re-work the dates, they can be a pain sometimes
-
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 />"; } ?>