document.write("<?php ..

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

jennifer
New php-forum User
New php-forum User
Posts: 2
Joined: Sat Apr 05, 2003 11:39 am
Location: Helena, MT
Contact:

document.write("<?php ..

Postby jennifer » Wed Apr 09, 2003 8:19 am

how can i make javascript write a php page?

document.write("<?php .... doesn't work. why not?

liquedus
php-forum Active User
php-forum Active User
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada
Contact:

Postby liquedus » Wed Apr 09, 2003 9:58 am

correct me if im wrong but since javascript is client side and php is server side.... it wont since the page has been already parsed server side... but you could probably write javascript with php.

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Server first and then client

Postby ruturajv » Thu Apr 10, 2003 4:34 am

Javascript scripts run at client commonly unless specified to run at server, hence after executing the script a new code can't be written and if written that page needs to be executed by the server, the page which is on client where the new script is written can't be executed by the server

liquedus
php-forum Active User
php-forum Active User
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada
Contact:

Postby liquedus » Sun Apr 20, 2003 5:55 am

putting the php code into an variable doesnt make a difference, javascript is processed client side AFTER php is processed server side which is sent to client as HTML


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron