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
mhouldridge
Forum Contributor
Posts: 267 Joined: Wed Jan 26, 2005 5:13 am
Post
by mhouldridge » Tue Jun 28, 2005 9:08 am
Hi,
I am trying to post three bits of data using a hyperlink to another page. Here is the code;
Code: Select all
<?
echo "<td><font color=\"red\"><ahref="addto.htmlasset=$asset&software=$software&license=$license">remove</a> </font></td> \n";
?>
Any ideas why this comes up with a T String error?
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Tue Jun 28, 2005 9:11 am
Code: Select all
addto.htmlasset=$asset&software=$software&license=$license
What's addto (a constant?) and htmlasset (a constant you're trying to assing a value to?)... it makes no sense... what's it do?
Oh... I see... you're missing escaping quotes if I undertand you correctly.
mhouldridge
Forum Contributor
Posts: 267 Joined: Wed Jan 26, 2005 5:13 am
Post
by mhouldridge » Tue Jun 28, 2005 9:16 am
Sorry, the correct code should have been;
Code: Select all
<?
echo "<td><font color=\"red\"><a href="addto.html?asset=$asset&software=$software&license=$license">remove</a> </font></td> \n";
?>
mhouldridge
Forum Contributor
Posts: 267 Joined: Wed Jan 26, 2005 5:13 am
Post
by mhouldridge » Tue Jun 28, 2005 9:23 am
I have managed to get this going posting one variable, however with three variables and alternate text "remove", I am not having much luck.
Here is the code which works for the single posting one;
Code: Select all
echo "<TD><font color=\"red\"><b><a href='viewall.php?varl=".$row['asset']."'>".$row['asset']."</a></b></font></TD><TD><font size=\"2\">".$row['title']."</TD><TD><font size=\"2\">".$row['customer']."</TD><TD><font size=\"2\">".$row['type']."</TD><TD><font size=\"2\">".$row['IP']."</TD>\n";
Critta
Forum Newbie
Posts: 8 Joined: Fri Jun 24, 2005 1:45 pm
Post
by Critta » Tue Jun 28, 2005 9:24 am
Code: Select all
<?php
echo "e;<td><font color=\"e;red\"e;><a href=\"e;addto.html?asset="e;.$asset."e;&software="e;.$software."e;&license="e;.$license"e;\"e;>remove</a> </font></td> \n"e;;
?>
Should work. Not tested though
Last edited by
Critta on Tue Jun 28, 2005 9:29 am, edited 1 time in total.
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Tue Jun 28, 2005 9:28 am
Hint... please look at our syntax highlighting when you post your code...
Strings should be red.., constants, variables, and functions blue, delimiters green.
Yours is all blue which tell you something about the string....
Critta
Forum Newbie
Posts: 8 Joined: Fri Jun 24, 2005 1:45 pm
Post
by Critta » Tue Jun 28, 2005 9:29 am
wassup with mine, what have I done wrong to make it all green?
d11wtq | Dunno what you're talking about LOL - Joking... you used
CoderGoblin
DevNet Resident
Posts: 1425 Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany
Post
by CoderGoblin » Tue Jun 28, 2005 9:36 am
You may need to use
urlencode if your variables contain special characters.
Critta
Forum Newbie
Posts: 8 Joined: Fri Jun 24, 2005 1:45 pm
Post
by Critta » Tue Jun 28, 2005 9:39 am
d11wtq wrote: Dunno what you're talking about LOL
- Joking... you used
Code: Select all
tags [/color][/quote]
It's always something blindingly obvious isn't it, cheers
mhouldridge
Forum Contributor
Posts: 267 Joined: Wed Jan 26, 2005 5:13 am
Post
by mhouldridge » Tue Jun 28, 2005 10:09 am
Hi,
This is what I have now;
Code: Select all
<?
$remove = "remove";
echo "<a href='removeandstore.php?varl=".$row['asset']."'>".$remove."</a> \n"
?>
On the removeandstore.php page I have two text boxes, one software and the other license. Currently this will only display the value for that field;
I have used the following to show parts of the asset on the removeandstore.php;
My first page has numerous ssoftwares and licenses show, each with it's own remove link. I want the data from each software and license to be posted to the removeandstore.php page. Do I simply use the "&" symbol for this?
thanks
mhouldridge
Forum Contributor
Posts: 267 Joined: Wed Jan 26, 2005 5:13 am
Post
by mhouldridge » Tue Jun 28, 2005 10:19 am
Here is my updated code;
Code: Select all
<?
$remove = "remove";
echo "<a href='removeandstore.php?varl=".$formVars['software']."&var2=".$formVars['license']."'>".$remove."</a> \n"
?>