Jump to content

drakecai

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

drakecai's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How to text a phone number in database as well as record recieved textmessages into mysql database. Any help here? i've been googling for ages.
  2. Thanks I just recently found that out, can someone give me the crontab code to clear out my table? Godaddy only needs me to upload a file, it already sets for the me the time to run and the frequency to run it. I know it has something to do with truncate or something.
  3. Thanks I just recently found that out, can someone give me the crontab code to clear out my table? Godaddy only needs me to upload a file, it already sets for the me the time to run and the frequency to run it.
  4. Well I decided to use mysql/phpmyadmin. Can someone give me the code for event scheduling? For... clearing a table of all of its data everyday at 3 am
  5. is there an alternative? I tried and it works for my remote computer but when I tried implementing that same code into godaddy's phpmyadmin it gave me an error. Also for the one that worked it kept on telling me that "this value is not allowed" whether i put 1, a or null i'm trying to get mysql to drop a table every 24 hours at 12:00 and then recreate the table fresh without data inside the table at 12:01 any ideas?
  6. Is there anyway I can make mysql delete the information i entered from php everyday? or every few hours? I want it to do it without any human supervision.
  7. Thank you pawn, I am guess my stubbornness caused this failure. Thank you so much guys I have one more questions, is there anyway I can make mysql delete the information i just inserted everyday? or every few hours? I want it to be automated.
  8. I got, Array ( [firstname] => drake [lastname] => cai [pnumber] => 6263846321 [numberactivated] => 1 [submit] => Submit ) and it is what i entered in
  9. I have deleted mysql info for safety reasons. Here are the two webpage's codes i'm using right now menu.php <? session_start(); if(!session_is_registered(myusername)){ header("location:login.php"); } ?> <html><title>ChronoServe - Saving Time</title> <link href="style.css" rel="stylesheet" type="text/css"> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="container"> <tr> <td> <table width="335px" height="50%" border="1" align="center" cellpadding="0" cellspacing="0" class="centered"> <tr> <td> <form method="post" action="insertvalues.php"> <table width="100%" border="0" align="center" cellpadding="3" cellspacing="10"> <tr> <td colspan="2"><div align="center" class="font2">Activation Information</div></td> </tr> <tr> <td colspan="2"></td> </tr> <tr> <td width="40%" class="font3">First Name :</td> <td width="60%"> <div align="center"> <input name="firstname" type="text" class="font3" id="firstname" maxlength="25" /> </div></td> </tr> <tr> <td class="font3">Last Name :</td> <td> <div align="center"> <input name="lastname" type="text" class="font3" id="lastname" maxlength="25" /> </div></td> </tr> <tr> <td height="28" class="font3">Phone Number :</td> <td> <div align="center"> <input name="pnumber" type="text" class="font3" id="pnumber" maxlength="10" /> </div></td> </tr> <tr> <td class="font3">Personnel Activated :</td> <td> <div align="center"> <input name="numberactivated" type="text" class="font3" id="numberactivated" maxlength="3" /> </div></td> </tr> <tr> <td height="37" colspan="2"></td> </tr> <tr> <td colspan="2"><div align="center"> <input name="submit" type="Submit" class="font3" value="Submit" /> </div> </td> </tr> </table> </form></td> </tr> </table> </td> </tr> </table> </body> </html> insertvalues.php <?php if(isset($_POST['Submit'])) { $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $pnumber = $_POST['pnumber']; $numberactivated = $_POST['numberactivated']; mysql_connect ("deleted", "deleted", "deleted") or die ('Error: ' . mysql_error()); mysql_select_db ("deleted"); $query = "INSERT INTO disney_database (id, firstname, lastname, pnumber, numberactivated, date) VALUES ('NULL', '".$firstname."', '".$lastname."', '".$pnumber."', '".$numberactivated."', 'NULL')"; mysql_query($query) or die('Error updating database'); header("location:menu.php"); echo "Database Updated With: ".$firstname."" - "".$lastname."" - "".$pnumber."" - "".$numberactivated.""; } else { echo "Database Error" { ?> Here is my problem. I set a one <form> on every form field I have including the submit button. Now whenever I press the submit button it redirects to insertvalues.php which it should be doing. In insertvalues i told it to query the form data and post it into my database's table. Its not doing that and tells me that it has a database error which i set it to tell me if something goes wrong. Anyone can help me? BTW I can manually query in the information using sql with phpmyadmin. so can someone please review my code for me? thanks big help! You can see what is happening. Visit www.chronoserve.com The username and password are "admin"
  10. Well i'm trying to have a main login screen for someone to login to. After logging in they will be checked by checklogin.php. Afterwards they will be directed to login_sucess in which they can enter their first name, last name, phone number, and number of people their inviting. What i'm having trouble with is having those 4 details entered into a mysql database. I have the login_success page which has all the proper forms and I had it redirect to formentered.php which it would then enter those form values into the mysql database. Sorry if its a bit confusing. I think there is a problem in the login_success.php perhaps I placed the <form> wrong. EDIT: No, it doesn't post any of the forms.
  11. First off, thanks for helping! Much appreciated. But the problem still isn't solved. Here is the revised code I got. It still doesn't enter the forms into the mysql table and neither does it redirect. <?php print_r($_POST); exit(); $host=""; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name=""; // Database name $tbl_name=""; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Define $myusername and $mypassword $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $pnumber=$_POST['pnumber']; $numberactivated=$_POST['numberactivated']; // To protect MySQL injection (more detail about MySQL injection) $firstname = stripslashes($firstname); $lastname = stripslashes($firstname); $firstname = mysql_real_escape_string($firstname); $lastname = mysql_real_escape_string($lastname); $pnumber = stripslashes($pnumber); $numberactivated = stripslashes($numberactivated); $pnumber = mysql_real_escape_string($pnumber); $numberactivated = mysql_real_escape_string($numberactivated); $sql="INSERT INTO $tbl_name (firstname, lastname, pnumber, numberactivated,) VALUES ('$firstname','$lastname','$pnumber','$numberactivated')")or die(mysql_error()); $r = mysql_query($sql); //if success, redirec to success page if($r) { header("location:login_success.php"); exit(); } else { //else error $err=mysql_error(); print $err; exit(); } ?>
  12. I have two webpages, login_success.php and formentered.php login_success.php is a page where i am entering new information and enteredvalues.php is supposed to be a script to enter the information into mysql. So far I got the login_success page to redirect to enteredvalues.php when submit is clicked but the information in the fields isn't transferring to mysql and neither is the page redirecting back to login_success. Here are both my codes Login_success.php <? session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } ?> <html><title>ChronoServe - Saving Time</title> <link href="style.css" rel="stylesheet" type="text/css"> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="container"> <tr> <td><form name="form2" method="post" action="entervalues.php"> <table width="335px" height="50%" border="1" align="center" cellpadding="0" cellspacing="0" class="centered"> <tr> <td><table width="100%" border="0" align="center" cellpadding="3" cellspacing="10"> <tr> <td colspan="2"><div align="center" class="font2">Activation Information</div></td> </tr> <tr> <td colspan="2"></td> </tr> <tr> <td width="40%" class="font3">First Name :</td> <td width="60%"> <div align="center"> <input name="firstname" type="text" class="font3" id="firstname" /> </div></td> </tr> <tr> <td class="font3">Last Name :</td> <td> <div align="center"> <input name="lastname" type="text" class="font3" id="lastname" /> </div></td> </tr> <tr> <td height="28" class="font3">Phone Number :</td> <td> <div align="center"> <input name="pnumber" type="text" class="font3" id="pnumber" /> </div></td> </tr> <tr> <td class="font3">Personnel Activated :</td> <td> <div align="center"> <input name="numbactivated" type="text" class="font3" id="numbactivated" /> </div></td> </tr> <tr> <td height="37" colspan="2"></td> </tr> <tr> <td colspan="2"><div align="center"> <input name="insert" type="submit" class="font3" value="Submit" /> </div></td> </tr> </table></td> </tr> </form> </table> </td> </tr> </table> </body> </html> Here is enteredvalues.php <?php $host=""; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name=""; // Database name $tbl_name=""; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Define $myusername and $mypassword $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $pnumber=$_POST['pnumber']; $numberactivated=$_POST['numberactivated']; // To protect MySQL injection (more detail about MySQL injection) $firstname = stripslashes($firstname); $lastname = stripslashes($firstname); $firstname = mysql_real_escape_string($firstname); $lastname = mysql_real_escape_string($lastname); $pnumber = stripslashes($pnumber); $numberactivated = stripslashes($numberactivated); $pnumber = mysql_real_escape_string($pnumber); $numberactivated = mysql_real_escape_string($numberactivated); $sql="INSERT INTO $tbl_name (firstname, lastname, pnumber, numberactivated,) VALUES ('$firstname','$lastname','$pnumber','$numberactivated')")or die(mysql_error()); $r = mysql_query($sql); if(!$r) { $err=mysql_error(); print $err; header("location:login_success.php"); exit(); } ?>
  13. TY, I will go study some CSS and HTML. But can you guys just help me code the register button real quick to redirect to register.php? its really urgent so I need it done. Thanks in advance.
×
×
  • 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.