Jump to content

coupe-r

Members
  • Posts

    328
  • Joined

  • Last visited

    Never

Everything posted by coupe-r

  1. You posted this in a PHP forum?
  2. Very simple. function homework() { for ($i = 2; $i <= 100; $i++) { if ($i % 2 == 0) { echo $i.'<br />'; } } } homework();
  3. Hey All, I have a sessions table that is used to see if a user is online. It only gets deleted when they click the Logout button. What I need to do is have it so it gets deleted even if they close the browser. Should I add a column in the sessions table with a time stamp and check on each page for every user to make sure its great than 30 min? Is there a better way to do this, without so many queries? Thanks
  4. if($tbilled < 0) { $tbilled = $tbilled + 24; } ?????
  5. Shouldn't the query also read: Select Username, Lastname, Firstname From customer where Username='".$Username."' AND Lastname='".$Lastname."' AND Firstname='".$Firstname."' You are missing the AND as well as quotes.
  6. You can add it to the URL and use a $_GET['whatever']. so on each of your options, you could have if(isset($_GET['whatever']) && $_GET['whatever'] == 'OPTION' {echo selected=selected;} Something like that. That way, your drop down option is based on the URL.
  7. How are those 2 tables related? Meaning, what column do they share (Some sort of ID).
  8. Only kidding. Glad it worked out.
  9. Hey Hey Hey, don't forget me!!!
  10. What if you rename your index.html to index.php? Then see if your menu shows up?
  11. OK, Ill just leave it so when I click ok it give me the ...id=123&del=1. Then I will do this: if(isset($_GET['id']) && isset($_GET['del']) && $_GET['del'] == 1) CODE HERE header(SAME PAGE) Thanks for all your help !!!!!!!
  12. Alright, now we're getting somewhere. OK, now when the dialog box pop up and I hit OK, it takes me to index.php?id=98&del=1. Is there a way, instead of taking me to a URL, that it executes the delete query? Or is my only option to have an if(isset($_GET['id']) && isset($_GET['del'])) { DELETE CODE HERE; }
  13. $del_text = '<a onclick="delete(\'index.php?id='.$id.'&del=1\');">';$del_text.'<img src="../images/delete_sm.png" title="Delete Application" alt="Delete Application" width="20" height="20" border="0" /></a>';
  14. I really appreciate your help. Unfortunately, nothing happens when I click the icon.
  15. Well, what I have is a .png icon and when you click it, the URL changes to del=true?id=123, instead of an actual delete button. Here is what I have "<a href='index.php?id=".$id."&del=1'>".'<img src="../images/delete_sm.png" title="Delete Application" alt="Delete Application" width="20" height="20" border="0" />'
  16. Well, maybe Ill just have the box pop up, when they click yes, delete the record and forget about the other pop up that says its deleted. would you still recommend jQuery?
  17. Yes, your img src isn't pointing to the file, its pointing to a URL. You need to have it point directly to a .jpg/.gif/.png file.
  18. I am trying to display a js dialog box when someone wants to delete something. Currently I have it all with buttons and PHP in the background. When they click the delete icon, I want a dialog box to appear with OK or Cancel. On cancel, return back to the same page, If OK, I want it to run the PHP/mysql code that deletes the record from the DB. Once deletes, I want the box to appear again saying it was deleted successfully. I found this but now sure how to make it work. function show_confirm() { var r=confirm("Press a button"); if (r==true) { alert("You pressed OK!"); } else { alert("You pressed Cancel!"); } }
  19. I am trying to display a js dialog box when someone wants to delete something. Currently I have it all with buttons and PHP in the background. When they click the delete icon, I want a dialog box to appear with OK or Cancel. On cancel, return back to the same page, If OK, I want it to run the PHP/mysql code that deletes the record from the DB. Once deletes, I want the box to appear again saying it was deleted successfully. I found this but now sure how to make it work. function show_confirm() { var r=confirm("Press a button"); if (r==true) { alert("You pressed OK!"); } else { alert("You pressed Cancel!"); } }
  20. The default value is automatically NULL, but it still reads a blank field, not NULL. Here is the var: $workphone = trim(mysql_real_escape_string($_POST['workphone_txt']));
  21. OK, no problem. So it is OK if the DB fields dont say NULL and are just empty?
×
×
  • 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.