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
psychotomus
Forum Contributor
Posts: 487 Joined: Fri Jul 11, 2003 1:59 am
Post
by psychotomus » Wed Jun 29, 2005 5:53 pm
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="e;http://www.test.com"e;> <script src="e;http://po2.net/test.php?id=test"e;></script></a>
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Wed Jun 29, 2005 6:05 pm
One question: Why?
Another question: Why?
Another: Why?
Ok now I have that cleared up....
Source code of test.php
Why?
I'm completely confused. I'll make it work but... ermm.... why?
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
psychotomus
Forum Contributor
Posts: 487 Joined: Fri Jul 11, 2003 1:59 am
Post
by psychotomus » Wed Jun 29, 2005 6:12 pm
test.php consist of print $_GET['id']
i thought i could use print to output something from another file using src??
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Wed Jun 29, 2005 6:16 pm
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()...