src script error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

src script error

Post by psychotomus »

whats wrong with this. i want the title of the link to be test. keeps saying done but with errors. http://www.po2.net/test.html im trying to get it to print the value of id.

Code: Select all

<a href=&quote;http://www.test.com&quote;> <script src=&quote;http://po2.net/test.php?id=test&quote;></script></a>
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

One question: Why?
Another question: Why?
Another: Why?

:P

Ok now I have that cleared up....

Source code of test.php

Code: Select all

test
Why?

I'm completely confused. I'll make it work but... ermm.... why? :P

you need test.php to have document.write('test');

and you need type="text/javascript" in your <script> tag.

Did I ask why? LOL

EDIT | I have one last question.... WHY???? Seriously... I'm stumped :P
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

Post by psychotomus »

test.php consist of print $_GET['id']

i thought i could use print to output something from another file using src??
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

The <script> tag is for client side script... JavaScript, VBScript, JScript.

If you just want to print the link to the page... rename your html file to .php and put:

Code: Select all

<a href="http://www.test.com"><?php echo $_GET['id']; ?></a>
EDIT | Or if there's a good reason you're using a separate file use include()...
Post Reply