Old 06-29-2005   #1 (permalink)
Invicible Snake
 
ParaSnake's Avatar
 
Join Date: Sep 2004
Location: Ho Chi Minh City,Vietnam
Posts: 668

Send a message via MSN to ParaSnake Send a message via Yahoo to ParaSnake
Unhappy How can i combine Javascript with PHP?

I dont know if this is an easy problem or not,but i tried and i failed,for example,i got some javascript codes that return the value of 1,i call it num=1.
Then if i would like to display it,i would write
Code:
<script language = "JavaScript">
document.write(num);
</script>
But i have a PHP file(the same page as the js script above)and an var called $num,how can i give $num the value of num???
thx much.
__________________
ParaSnake is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-29-2005   #2 (permalink)
Red Dawn
 
BlodoPKNZ's Avatar
 
Join Date: May 2004
Location: Eastern Europe
Posts: 302

Since php is server side and javascript is client side, php is always done first since it has to parse the output to send to the recieving user. The one of the ways to send a js var to php would be thru a form. You could fill a hidden field in the form with the javascript variable, then after submit you can get the field contents on another page. Another would be to format a link to the next page so as to give it a get variable, which can then be recieved on the other page by php. There is no way to send javascript to php then parse php without changing pages though.
__________________
BlodoPKNZ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 06-29-2005   #3 (permalink)
Invicible Snake
 
ParaSnake's Avatar
 
Join Date: Sep 2004
Location: Ho Chi Minh City,Vietnam
Posts: 668

Send a message via MSN to ParaSnake Send a message via Yahoo to ParaSnake
Uhm..after several times of trying,i`ve done it,but i was too happy to reedit this post,sorry for annoy you :P
Thx for you helps
__________________
ParaSnake is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Tutorial Trio! Man1c M0g Announcements 3 07-09-2005 09:15 AM
PHP Login Help Space Cowboy HTML / PHP / ASP / JS 11 06-01-2005 10:02 AM
PHP template Help fewtion HTML / PHP / ASP / JS 8 02-26-2005 04:55 PM
PHP Help! Someone please help me LimitLess HTML / PHP / ASP / JS 12 05-16-2004 08:59 AM
Digital's Quick and Dirty Guide to PHP Order HTML / PHP / ASP / JS 15 05-05-2004 01:18 AM


All times are GMT +1. The time now is 06:00 PM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT