LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-21-2004, 05:42 PM   #1
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Rep: Reputation: 30
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..
 
Old 04-21-2004, 06:04 PM   #2
mandeltuete
Member
 
Registered: Mar 2003
Location: Switzerland
Distribution: Fedora 3
Posts: 75

Rep: Reputation: 15
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.
 
Old 04-21-2004, 06:30 PM   #3
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Original Poster
Rep: Reputation: 30
Thanks, how can you suggest me to ask the decision before redirecct to the other webpage?
 
Old 04-22-2004, 09:36 AM   #4
mandeltuete
Member
 
Registered: Mar 2003
Location: Switzerland
Distribution: Fedora 3
Posts: 75

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

HTH
 
Old 04-22-2004, 02:02 PM   #5
Ashkhan
Member
 
Registered: Oct 2003
Distribution: Debian, Ubuntu, RHEL, CentOS, MacOS
Posts: 39

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP,JAVASCRIPT and CheckBox aznita Programming 2 06-17-2005 04:33 AM
Can I use PHP variables in javascript? nickiv Programming 1 06-07-2005 05:41 AM
JavaScript & PHP Gerardoj Programming 1 06-11-2004 12:02 AM
PHP and or Javascript Can they be used the same way? ElementNine Programming 1 03-05-2004 08:22 AM
Executing Javascript within a PHP page Linh Programming 3 09-26-2003 05:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration