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

No comments posted yet

Your Answer:

Login to answer
149 Like 31 Dislike
Previous forums Next forums
Other forums

Filename like the user name
I am creating a form and storing the values in file. Could anyone please tell me how to write a code

Count
Getting the same count everytime

Code:
$visitquery = mysql_query("SELECT COUNT(*) FR

Adding meta tags under Zend FW
Hello there, recently has come to my hands the FTP of a website which is running under Zend, I would

output_buffering so rewrite
I'm planning to rewrite some of my scripts so they don't have to use output buffering to accomplish

Data type mismatch
Hi,
I am migrating data from algol to c.I mapped real datatype in algol to double datatype in

how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

Using CSS to format MySQL query
Hi,

If i want to have a news page on my site, which displays all records of a table in descen

Problem with a select distinct
I have a problema with a select distinct, I have the next sql:

select distinct a,b,c,d fr

Is it a good practice to store user info. in sessions?
I am making a user class for my script which stores all the user information in sessions. It takes u

PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va

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