Hyperlink is adding an extra gap to variable


Posted on 16th Feb 2014 07:03 pm by admin

Hi, here's my problem..

I have a php generated page with a hyperlink which opens in a new window

echo "<tr><td><a onclick="window.open('http://www.***.com/page/options.php?user_id=$user_id&session_id=$session_id','options','width=590,height=200,toolbar=no,scrollbars=yes,resizable=yes,statusbar=no,directories=no,menubar=no,location=no');return false;" href="">$user_id</a></td></tr>";

The problem occurrs at options.php?user_id=$user_id

The resulting hyperlink on the generated page adds a space to the user id after the "="

So when options.php loads.. it results in the user's id having an extra %20 at the beginning of their name

Example..

The first page links to this.. http://www.***.com/page/options.php?user_id= Eejut&session_id=12345

When options.php loads it prints..

"This is %20Eejut's Options Page"

I've tried using trim($user_id) before printing the hyperlink to the main page (that calls options.php) and the space still occurrs in the hyperlink

Anyone know what's going wrong?? thanks in advance

149 Like 31 Dislike
Previous php-forum Next php-forum
Other php-forum

PHP FTP Can't upload Big FIles
Anyone had any success using FTP to upload a file say 90m?

im using ftp_put and it returns fa

Undefined variables
hi
----------------------------------------------------------------------------------------------

adding 0 to numbers
Hey guys i need to create a 00001 number in a loop. Is there a better way of forcing a 5 digit numbe

This is driving me nuts!
This insert query looks to be alright, however I get this error:

QuoteYou have an error in yo

session variable problem
Session variable is not working in Fire fox i am getting null value but it is working fine in IE.

show random images
hey guys

can someone please suggest a way in which the following code can be edited so it onl

Mastering Regular Expressions, Third Edition, is available.
The Third Edition of Mastering Regular Expressions is available.

QuoteThis third edition is 5

How to get variable value on next page
Hello friends
i am working on payentry page ..there i have this code.........

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

OPINIONS WANTED
This is my login page code, and I want your opinion on it please!

Code: // Login ~ CHECKS

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash