Trevor Ackermann
Trevor Ackermann

Reputation: 31

PHP String help required

I need to call the following parameters on a string

control_lbsresulted.php?lat=-25.74546&long=28.11222&dist=300&msisdn=0831231234

I have this string currently

<a href="control_lbsresulted.php?msisdn=<? echo $rows['msisdn']; ?>" class="update">Look Up</a>

I can only seem to get the above to draw the MSISDN for me, do i need to add semi-colon with spacing to get the other as required as such:

<a href="control_lbsresulted.php?msisdn=<? echo $rows['msisdn']; ?> , dist=<? echo $rows['dist']; ?>" class="update">Look Up</a>

Upvotes: 0

Views: 109

Answers (7)

Mayur Dosi
Mayur Dosi

Reputation: 1

You need to separate the string with ampersand no with coma's. you try this way-

<a href="control_lbsresulted.php?msisdn=<? echo $rows['msisdn'];?>&dist=<? echo $rows['dist'];?>" class ="update">Look Up</a>

Upvotes: 0

bluewind
bluewind

Reputation: 998

use & separate parameters. like this

<a href="control_lbsresulted.php?msisdn=<? echo $rows['msisdn']; ?>&paramter2=<?=$row['param']?>" class="update">Look Up</a>

Upvotes: 0

Borniet
Borniet

Reputation: 3546

You first variable goes behind the "?", the others are seperated by an ampersand "&"

 <a href="control_lbsresulted.php?lat=<?php echo $rows['lat'] ?>&long=<?php echo $rows['long'] ?>&dist=<?php echo $rows['dist']; ?>&msisdn=<?php echo $rows['msisdn']; ?>" class="update">Look Up</a>

Oh, and it is recommended to use the long tags:

Upvotes: 0

Amir
Amir

Reputation: 4111

<a href="control_lbsresulted.php?msisdn=<? echo $rows['msisdn']; ?>&dist=<? echo $rows['dist']; ?>" class="update">Look Up</a>

Upvotes: 0

Suresh Kamrushi
Suresh Kamrushi

Reputation: 16076

just try below:

<a href="control_lbsresulted.php?lat=<? echo $rows['lat']; ?>&long=<? echo $rows['long']; ?>&dist=<? echo $rows['dist']; ?>&msisdn=<? echo $rows['msisdn']; ?>" class="update">Look Up</a>

Upvotes: 1

user1914292
user1914292

Reputation: 1556

I'd say you need to separate them with an ampersand (&) as you described in the first line. It would look something like:

<a href="control_lbsresulted.php?msisdn=<? echo $rows['msisdn']; ?>&dist=<? echo $rows['dist']; ?>" class="update">Look Up</a>

Upvotes: 1

user2193789
user2193789

Reputation:

try this

<a href="control_lbsresulted.php?lat=-25.74546&long=28.11222&dist=<? echo $rows['dist']; ?>&msisdn=<?php echo $rows['msisdn']; ?>" class="update">Look Up</a>

Upvotes: 0

Related Questions