Jump to content

TitusRevised

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TitusRevised's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [quote author=hvle link=topic=101617.msg402305#msg402305 date=1153710195] is this a text search? [/quote] yes, $string is a string...text
  2. Is there an sql function to SELECT any rows in a table most similar to a field... like instead of SELECT * FROM table WHERE field LIKE '%$string%' which finds a row with keyword $string, so if $string is "hi my name is" but there isnt a row like but there is a row "hello my name is" it would pull that row because its most similar. PHP example: <?php $string = trim(strip_tags(addslashes($_POST['usermsg']))); $sql = mysql_query("SELECT * FROM table WHERE field = '%$string%"); // This finds me a row where field "field" has the $string in it exactly somewhere ?> How can I make it so that if it's not exact it pulls out the row with the field "field" most similar to $string? Your great wisdom and intelligence on the matter to assist me is appreciated greatly.
  3. The following code is supposed to give a confirmation popup when the user tries to leave the page the script is on. If he/she selects yes then it goes to the page they wanted to go if not i reloads the page. My question is how do I make it so if they select yes it first directs to a php script which deletes information in the database and then directs them to the page. And if you can somehow get around it reloading if you select no and just close the popup box. Help is much appreciated. [code]<script language="Javascript"> <!-- var your_message = "Are you sure you want to leave this page?"; var times = 0; function onul() { if (times == 0) {   var leave = confirm(your_message);   if (!leave) location = self.location;   times++; } } //--> </script> <body onunload="onul()">[/code]
  4. [quote author=Koobi link=topic=99548.msg392058#msg392058 date=1152121255] this would be a client side trigger so you would have to use JavaScript. i would not use this approach though. many things can go wrong...the user could close the browser or kill the browser process on his OS, the browser could crash, the ISP could drop his connection. too many uncertainties in my...but who knows, maybe someone knows something i don't and this is possible but as far as i know, i don't think this is a good solution. [/quote] Well, the the page information wil be saved in a session so if they close browser then no need to execute a script. But if they navigate away from that single page, then I need a script to run first then send them to where they want to go. If it has to be done in JavaScript, can anyone direct me to help?
  5. Is there any php function that will run only when the page is left. I want a table in my mysql database to erase specific rows once the user leaves the page. Is this possible? Help is much 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.