LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP and JavaScript (https://www.linuxquestions.org/questions/programming-9/php-and-javascript-173030/)

Gerardoj 04-21-2004 05:42 PM

PHP and JavaScript
 
Hi, Im Trying to use PHP and JavaScript and I would like some help.

I would like to show a Message Box (Confirmation YES/NO) when the user click on the href, if the user answer is YES, then execute this code

PHP Code:

{echo "<a href= \"WebPage.php?accion=$row[1]\"><Font class=\"TBLROW\">$row[$i]</a>";} 

if the user answer is NO, then dont execute any code..
Thanks for your help..

mandeltuete 04-21-2004 06:04 PM

That doesn't work.
JavaScript is run on the users machine, while PHP code is run on the server. So your PHP code is run before the yes/no decision is made by the user.

Gerardoj 04-21-2004 06:30 PM

Thanks, how can you suggest me to ask the decision before redirecct to the other webpage?

mandeltuete 04-22-2004 09:36 AM

Hmm, I would suggest you to make a confirmation page using PHPand HTML forms.
Otherwise you can't do that, I think.

HTH

Ashkhan 04-22-2004 02:02 PM

Yes, you make a html form with Javascript confirmation box triggered onSubmit and php code, which will be run if user confirms the confirmation box.


All times are GMT -5. The time now is 04:18 PM.