Page 1 of 1

src script error

Posted: Wed Jun 29, 2005 5:53 pm
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>

Posted: Wed Jun 29, 2005 6:05 pm
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

Posted: Wed Jun 29, 2005 6:12 pm
by psychotomus
test.php consist of print $_GET['id']

i thought i could use print to output something from another file using src??

Posted: Wed Jun 29, 2005 6:16 pm
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()...