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

login box shows up again after logging in 2nd login works
Hello,

I am having trouble on my site Lockerz.rack111.com where when you login the login box

Asset Transfer from One plant to another within same company code
Hi,

Please advise how to transfer one asset from one plant to another plant within same c

How to sum these output values
Hi

I need sum the month totals
SELECT region_name, area_name ,SUM (CASE WHEN S

foreach and array need help combining
Hi guys.

Here's the code

Code: array(
'tag' => 'code',<

PHP & Java
Hello,

can PHP code be used inside java code?

Code: [Select]<SCRIPT LANGUAGE=&q

asp authentication problem
Hello all, I want to use the asp authentication (from asp.net configuration) in my web site. there

PHP Multiples of 2, Show posts...not working (wordpress)
I have been using this code to show div.example with 6 li columns inside it, each li is a post with

Check before inserting in DB ???
This is my code
---------------
if ( $_POST ['Submit'])
{{
$username = $_POST ['usernm

Deleting a record php
Attempting to setup delete a record page. The below code I put together doesn't seem to work.

How to pass parameter to tag query?
Hi,
I want to get the value of a tag at a specific time (like 10/27/09 15:29:59), I need to giv

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