Current location: Hot Scripts Forums » General Web Coding » JavaScript » Include PHP via javascript


Include PHP via javascript

Reply
  #1 (permalink)  
Old 02-18-05, 06:37 AM
bkbenson bkbenson is offline
Newbie Coder
 
Join Date: Feb 2005
Location: HK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Include PHP via javascript

(I don't know if this is the right place to post this...sorry if not)
Is it possible to include a PHP file through javascript? Like including html in PHP.
I have a server which supports javascript only (no php), but I want to have an php on another server to be displayed in that.
Reply With Quote
  #2 (permalink)  
Old 02-18-05, 05:41 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
No, you can't include PHP files (and parse them) since JavaScript is a clientside language. But can't you just link to the PHP page from the non-PHP server like you would with a normal off-site link?
Reply With Quote
  #3 (permalink)  
Old 02-18-05, 11:21 PM
jasong jasong is offline
Wannabe Coder
 
Join Date: Feb 2004
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Well, you can include a php file through javascript...but when php leaves the other server, it will be processed and turned into html (because PHP is a server side language, JS is client side).
If this is the effect you are going for, then yes, it is possible.
__________________
SnapSlides.Com - Create slideshows online to share with friends and family.
Reply With Quote
  #4 (permalink)  
Old 02-19-05, 12:39 AM
bkbenson bkbenson is offline
Newbie Coder
 
Join Date: Feb 2005
Location: HK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by TwoD
No, you can't include PHP files (and parse them) since JavaScript is a clientside language. But can't you just link to the PHP page from the non-PHP server like you would with a normal off-site link?
But the tags <iframe> and <frameset> are disallowed, I want to include that page inside an html. Any alternative ways?

Last edited by bkbenson; 02-19-05 at 12:54 AM.
Reply With Quote
  #5 (permalink)  
Old 02-19-05, 12:40 AM
bkbenson bkbenson is offline
Newbie Coder
 
Join Date: Feb 2005
Location: HK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by jasong
Well, you can include a php file through javascript...but when php leaves the other server, it will be processed and turned into html (because PHP is a server side language, JS is client side).
If this is the effect you are going for, then yes, it is possible.
Yes, I want the php to output html code and display it. How to do it?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a PHP variable in Javascript??? todayscoffee JavaScript 2 01-08-05 09:45 AM
Passing a PHP variable in Javascript??? todayscoffee PHP 2 01-04-05 01:56 PM
javascript and php clashes, need expert help nassau JavaScript 2 11-12-04 07:19 AM
javascript multiple select menu for php? isaacmlee JavaScript 1 10-15-04 09:53 AM
Random PHP include brduran PHP 4 08-16-04 06:34 AM


All times are GMT -5. The time now is 10:42 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.