Jump to content

amylou

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Everything posted by amylou

  1. i have the form and the code for the form all done and it works, i just need the validation so that the user doesn't send an empty form.
  2. i would like to use php as i do not know how to do java script and the code is written in php thank you for your help
  3. is there a simple code that will check to see if users have filled in required fields on a form?
  4. i was wondering if there was a simple code for greying out a radio buttons when another button is checked. example: radio button A radio button B radio button C when C is checked i would like A and B not usable
  5. the line of code that it goes to is the $last=$_POST['last']; $first=$_POST['first'] maybe i did not put it in the right spot i put it before the if statement
  6. the program lets a person go to a form input first and last name click submit and the results are shown with their name , date, adn a check box after the last checkbox there is a link for delteing not sure how i would validate them in this code. if($_GET['m'] == 'del' ) { $requestId = $_GET['id']; $query ="DELETE FROM timeoff WHERE last = '$last' AND first = '$first' "; $result= mysql_query($query) or die(mysql_error());
  7. that is the error i am getting this is the line of code $query ="DELETE FROM timeoff WHERE last = '$last' AND first = '$first' ";
  8. i did that and the error is that i have undefined variables last=$last and first=$first. how would I define the variables in the delete code thanks for your help
  9. when i echoed out the query the following it printed the following DELETE FROM timeoff where last =" AND first=" and when i echoed out the result of query i get the number 1
  10. is there a way to make the box itself or the text bigger
  11. i have the following code that works, i was wondering if there is a way to disable the x(close) so that the user has to hit okay and also is there away to make the window bigger?? <script type="text/JavaScript"> function HandleTimeOff(bPaid) { if( bPaid ) { alert("Paid Time Off Notice: Please Remember to fill out PAYROLL REQUEST form."); } else { } } </script>
  12. my problem now is that it will tell the user that it has been deleted but does not delete from database. any ideas
  13. i have turned on the error reporting in my php.ini file, and i tried the following code to make sure it worked <?php print("The next line generates an error.<br>"); printaline("PLEASE?"); print("This will not be displayed due to the above error."); ?> and the only thing that worked on it was the first line---print("the next line generates and error.<be>"); and i am still not getting any errors when i run my program
  14. i have all the validation stuff turned on and the only errors i am getting has to do with linking of my css files
  15. okay i have been looking and i don't think i have the correct error reporting function thing going. could you tell me where its at so that i might be able to see also i don't have access to another server to test it to see if it works
  16. yes i have error reporting on and no errors. i checked the source code of the blank page and there is nothing there except the following <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"></HEAD> <BODY></BODY></HTML> so some where it is not registering
  17. yes i did and i still got the blank screen
  18. i did this no errors just a white page after hitting the delete link
  19. requestId is an auto incremented number in the database to use as primary key in database.
  20. micmania1 i tried that it also does not work, when i click the delete link all i get is a white page so i ran it again and the date that i tried to delete was still there
  21. tried that and i get the following 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 '* FROM timeoff WHERE requestId = ''' at line 1 and the line of code that its pertaining to is: $query ="DELETE * FROM timeoff WHERE requestId = '$requestId'"; any other suggestions
  22. i have also posted in the mysql forum not sure which place would be the right one. I finally got the program to show the results with check boxes and a link for delete. when the user hits the delete button it will tell them that the selected items have been deleted but when checking the database it is still there. checkdates.php is the code for checking and seeing the results <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <?php /*this program was designed to eliminate paper work for the sift supervisors and the csps that work at Sitel here at loring. this program was written and developed by Amy Coppola on July 2007 */ ?> <?php include'mysqlconnectsitel.inc.php'; ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Check The Dates</title> <link href= "links.css" rel="stylesheet" type="text/css"/> <link href= "general.css" rel="stylesheet" type="text/css"/> <?php function getmonth($m=0) { return (($m==0 ) ? date('F') : date('F', mktime(0,0,0,$m))); } ?> </head> <body> <br> <img src="33720001.jpg" alt="sitel" width="300" height="100" /> <?php if(isset($_POST['action'])){$action=$_POST['action'];}else{$action="";} if( $action == 'updated' ) { extract ($_POST); $todaysDate = date("Y-m-d",time()); // Need to query database to see if this request is valid echo "<p><strong>These are the dates that you have requested off!!!!</strong></p>"; $sql ="SELECT first, last, requestedDate FROM timeoff WHERE last = '$last' AND first = '$first'"; $query=mysql_query($sql) or die("Query failed : " . mysql_error()); while($row = mysql_fetch_assoc($query)) { echo "<p>"; echo $row['first'] ." ". $row['last']. " ". " ". $row['requestedDate']; echo "<td><input type=\"checkbox\" name=\"deleted_items[]\" "; echo "</p>"; } $action=""; $_html ="<tr> <td>$_rw->requestId</td> <td>$_rw->first</td> <td>$_rw->last</td> <td>$_rw->requestedDate</td> <td> <a href=\"index.php?id=$_rw->requestId&m=del\">DELETE </a></td> </tr>"; echo $_html; echo "<p><strong>To start at the begining page.<a href='members.php'>Click here</a></strong></p>"; } else { ?> <form name='checkdate' method='post' action='checkdates.php'> <table width="500" border="0"> <tr> <td>First Name </td> <td><input name="first" type="text" size="20" maxlength="20"></td> </tr> <tr> <td>Last Name </td> <td><input name="last" type="text" size="30" maxlength="30"></td> </tr> <tr><td><b>Todays Date:</b></td> <td> <?php $todaysDate = date("m-d-Y",time()); echo "$todaysDate"; ?> </td> </tr> <tr><td colspan="2" align="center"> <input type= 'hidden' name= 'action' value= 'updated'> <input type = "submit" name = "submit" value= "Submit"> </td></tr></table> </form> <?php } ?> </body> </html> index.php has the delete code <?php /*this program was designed to eliminate paper work for the sift supervisors and the csps that work at Sitel here at loring. this program was written and developed by Amy Coppola on July 2007 */ ?> <?PHP include 'mysqlconnectsitel.inc.php';// this has my database connection stuff if($_GET['m'] == 'del' ) { $requestId = $_GET['id']; $query ="DELETE FROM timeoff WHERE requestId = '$requestId'"; $result= mysql_query($query) or die(mysql_error()); echo" <center><font color=\"#00CC00\">Your Info Was Deleted!</font></center> "; } echo "<p><strong>To start at the begining page.<a href='members.php'>Click here</a></strong></p>"; echo "<p><strong>To check your dates again.<a href ='checkdates.php'>Click here</a></strong></p>"; ?> </body> </html> if this can be done easier i would like that. i know that this is going to be a dumb newbbe mistake but i just can not find it
  23. you are welcome, glad to help. i to am new to using mysql that is why i have a few posts in here. but i help when i know the answer
  24. $query ="SELECT * FROM tablename ORDER BY 'number'; tablename= the name of your table. hope that helps you
  25. i finally got the program to show what i want but now the delete does not work, it will tell the user that what they have selected to delete has been deleted but does not take it out of the database. I know that I am over looking something but not sure what. I will post the codes that i am useing. checkdates.php- allows the user to enter their first and last name hit submit and it will show them the results for there name with check box next to each result and then a delete link to delete. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <?php /*this program was designed to eliminate paper work for the sift supervisors and the csps that work at Sitel here at loring. this program was written and developed by Amy Coppola on July 2007 */ ?> <?php include'mysqlconnectsitel.inc.php'; ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Check The Dates</title> <link href= "links.css" rel="stylesheet" type="text/css"/> <link href= "general.css" rel="stylesheet" type="text/css"/> <?php function getmonth($m=0) { return (($m==0 ) ? date('F') : date('F', mktime(0,0,0,$m))); } ?> </head> <body> <br> <img src="33720001.jpg" alt="sitel" width="300" height="100" /> <?php if(isset($_POST['action'])){$action=$_POST['action'];}else{$action="";} if( $action == 'updated' ) { extract ($_POST); $todaysDate = date("Y-m-d",time()); // Need to query database to see if this request is valid echo "<p><strong>These are the dates that you have requested off!!!!</strong></p>"; $sql ="SELECT first, last, requestedDate FROM timeoff WHERE last = '$last' AND first = '$first'"; $query=mysql_query($sql) or die("Query failed : " . mysql_error()); while($row = mysql_fetch_assoc($query)) { echo "<p>"; echo $row['first'] ." ". $row['last']. " ". " ". $row['requestedDate']; echo "<td><input type=\"checkbox\" name=\"deleted_items[]\" "; echo "</p>"; } $action=""; $_html ="<tr> <td>$_rw->requestId</td> <td>$_rw->first</td> <td>$_rw->last</td> <td>$_rw->requestedDate</td> <td> <a href=\"index.php?id=$_rw->requestId&m=del\">DELETE </a></td> </tr>"; echo $_html; echo "<p><strong>To start at the begining page.<a href='members.php'>Click here</a></strong></p>"; } else { ?> <form name='checkdate' method='post' action='checkdates.php'> <table width="500" border="0"> <tr> <td>First Name </td> <td><input name="first" type="text" size="20" maxlength="20"></td> </tr> <tr> <td>Last Name </td> <td><input name="last" type="text" size="30" maxlength="30"></td> </tr> <tr><td><b>Todays Date:</b></td> <td> <?php $todaysDate = date("m-d-Y",time()); echo "$todaysDate"; ?> </td> </tr> <tr><td colspan="2" align="center"> <input type= 'hidden' name= 'action' value= 'updated'> <input type = "submit" name = "submit" value= "Submit"> </td></tr></table> </form> <?php } ?> </body> </html> index.php has the delete code . <?php /*this program was designed to eliminate paper work for the sift supervisors and the csps that work at Sitel here at loring. this program was written and developed by Amy Coppola on July 2007 */ ?> <?PHP include 'mysqlconnectsitel.inc.php';// this has my database connection stuff if($_GET['m'] == 'del' ) { $requestId = $_GET['id']; $query ="DELETE FROM timeoff WHERE requestId = '$requestId'"; $result= mysql_query($query) or die(mysql_error()); echo" <center><font color=\"#00CC00\">Your Info Was Deleted!</font></center> "; } echo "<p><strong>To start at the begining page.<a href='members.php'>Click here</a></strong></p>"; echo "<p><strong>To check your dates again.<a href ='checkdates.php'>Click here</a></strong></p>"; ?> </body> </html> if this can be done easier like on one page (which i have tried but then the form does not work) let me know or show me how to do it. any help will be 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.