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

Did you know?Explore Trending and Topic pages for more stories like this.
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

PHP Programming error. Please help!
Hi there,

Am making a website for a friend and have encountered a problem that i need fixing

reating a background image
I am building a site in drupal and have a php form in it, due to certain annoyances with module buil

Storing Values taken from a DB...
Using this code it will generate a short list from my database

<?php
mysql_connect

Check Digits and extracting digits
I think I can figure out the code for this but I am having a very hard time getting past the first s

RFQ Configuration - can you make PLANT field an optional field in ME42
Is there a way to make the plant field on an RFQ optional in change mode (ME42)?

curl javascript problem
Hi Experts.
I'm new curl and wanna to get some info from this http://www.amadeus.net/

when

disable all input buttons
Hello Friends,

suppose i do have a file ( file.php ) has a submit button

Code: [Sele

Problems with strings containing
Hey all,

I have encountered something strange in a script. I am trying to write an XML heade

Add code to enable passing of checkbox variable on login
Ok, I have a login page, but want to add a checkbox that when checked and successful login is made i

Restricted access to sub-folder in iis6 doesn't work?
Basically I'm trying to add restriction to sub-folder (which contains pdf) in web.config for iis6 as

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