473,395 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem in concatenation

254 100+
Hi

I got problem while concatenating the strings here is the code

<a href=\"javascript:openit('View_Full_Image.php?id=" .$_rows['Image_Id']."&name=".$_name."')\"><img src=\"".$_rows['File_Path']."\" height=\"20\" width=\"20\">

$_name stores the full name(title) of the image.

it shows the full name on the link but when I echo this to next page it shows only the first string means not showing the string after space.

like $name="mukesh kumar"
but on next page $name only shows mukesh. so how can i do that. I also tried to use the \\ but then it is showing nothing.
Dec 28 '07 #1
6 1550
Hi

I got problem while concatenating the strings here is the code

<a href=\"javascript:openit('View_Full_Image.php?id=" .$_rows['Image_Id']."&name=".$_name."')\"><img src=\"".$_rows['File_Path']."\" height=\"20\" width=\"20\">

$_name stores the full name(title) of the image.

it shows the full name on the link but when I echo this to next page it shows only the first string means not showing the string after space.

like $name="mukesh kumar"
but on next page $name only shows mukesh. so how can i do that. I also tried to use the \\ but then it is showing nothing.
Try to use urlencode() and urldecode(). It can solve th problem
Dec 28 '07 #2
mukeshrasm
254 100+
Try to use urlencode() and urldecode(). It can solve th problem
In this code where I need to write urlencode and where to write urldecode.
Dec 28 '07 #3
Markus
6,050 Expert 4TB
it took me forever to work out what you were talking about :P

Do urlencode() on your $_name

[php]
&name=".urlencode($_name)."
[/php]

Hope that helps :)
Dec 28 '07 #4
mukeshrasm
254 100+
it took me forever to work out what you were talking about :P

Do urlencode() on your $_name

[php]
&name=".urlencode($_name)."
[/php]

Hope that helps :)
No this also did not worked on hyperlink it shows the string like mukesh+kumar but when I retrieve this value on other page it shows only mukesh. on other page I used urldecode as well.
Dec 29 '07 #5
Markus
6,050 Expert 4TB
Don't use url decode..

just use $_GET - it'll print out the string and replace + with a space; like the original.

:)
Dec 29 '07 #6
So we create a variable to contain a space character as well:

$Space = " ";

You should note that this quite different from having an empty string. An empty string contains nothing at all, while a string with a space contains a character, albeit an invisible one. Spaces of course can be concatenated just like any other text:

$Car = $CarType . $Space . $EngineSize;

This would produce the desired, nicely spaced-out text Cadillac 2.6. Of course, there's no reason why you can't concatenate variables with actual text phrases as well:

$Car = "Buick" . $Space . "2.0";

Here we added text to a variable to more text, which produces the response Buick 2.0. There would also have been nothing wrong with the following line either:

$Car = "Buick" . " " . "2.0";
Dec 30 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Jonas Galvez | last post by:
Is it true that joining the string elements of a list is faster than concatenating them via the '+' operator? "".join() vs 'a'+'b'+'c' If so, can anyone explain why?
7
by: Paul Davis | last post by:
I'd like to overload 'comma' to define a concatenation operator for integer-like classes. I've got some first ideas, but I'd appreciate a sanity check. The concatenation operator needs to so...
20
by: rhino | last post by:
This worked before October now it does not work. I think I know where the trouble is but I don't know how to fix it. function findVerse() { var d = new Date(); var str; if( (...
1
by: EricRybarczyk | last post by:
I am starting a rewrite of an existing Classic ASP web site in ASP.NET 2.0. The existing ASP application has several types of users, each with a separate login process (separate login page,...
9
by: Justin M. Keyes | last post by:
Hi, Please read carefully before assuming that this is the same old question about string concatenation in C#! It is well-known that the following concatenation produces multiple immutable...
33
by: genc_ymeri | last post by:
Hi over there, Propably this subject is discussed over and over several times. I did google it too but I was a little bit surprised what I read on internet when it comes 'when to use what'. Most...
34
by: Larry Hastings | last post by:
This is such a long posting that I've broken it out into sections. Note that while developing this patch I discovered a Subtle Bug in CPython, which I have discussed in its own section below. ...
3
gregerly
by: gregerly | last post by:
Hello, I think this should be a simple answer, but I haven't found any good resource yet. I have an element that onclick I run a function, passing a reference to the object clicked. I then grab...
12
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi Guys, me again!!!! I've got a little recordset problem, basically I'm trying to build a jobs by email feature, so I have the following - Jobs by Email table which includes - category...
34
by: raylopez99 | last post by:
StringBuilder better and faster than string for adding many strings. Look at the below. It's amazing how much faster StringBuilder is than string. The last loop below is telling: for adding...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.