473,800 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in concatenation

254 Contributor
Hi

I got problem while concatenating the strings here is the code

<a href=\"javascri pt:openit('View _Full_Image.php ?id=".$_rows['Image_Id']."&name=".$_nam e."')\"><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 1560
globalprompt
1 New Member
Hi

I got problem while concatenating the strings here is the code

<a href=\"javascri pt:openit('View _Full_Image.php ?id=".$_rows['Image_Id']."&name=".$_nam e."')\"><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 Contributor
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 Recognized Expert Expert
it took me forever to work out what you were talking about :P

Do urlencode() on your $_name

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

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

Do urlencode() on your $_name

[php]
&name=".urlenco de($_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 Recognized Expert Expert
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
sumeetk
6 New Member
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
3648
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
8034
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 something like this: 1) e = (a, b, c, d); // concatenate a,b,c,d into e 2) (a, b, c, d) = e; // get the bits of e into a,b,c, and d For example, in the second case, assume that a,b,c,d represent 2-bit integers, and e represents an 8-bit...
20
551
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( ( d.getMonth()+1 ) < 10 ) { str = '0'; }
1
4539
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, separate DB tables, etc). For one of these user types, the current application has an additional input field required for login… they have a username, password, and another “location code” field. Please don’t make me explain or justify this…...
9
2053
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 String objects for each statement: String a = "a"; a += "b";
33
4695
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 of articles I read from different experts and programmers tell me that their "gut feelings" for using stringBuilder instead of string concatenation is when the number of string concatunation is more then N ( N varies between 3 to max 15 from...
34
2669
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. ____________ THE OVERVIEW I don't remember where I picked it up, but I remember reading years ago that the simple, obvious Python approach for string concatenation: x = "a" + "b"
3
2504
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 the id of that object which is a number, 1, 2 ,15, 37, whatever Looks like below: <img src='img/src.gif' id='12' onclick='somefunction(this)' /> Here is the somefunction() somefunction(el){ var rowId = el.getAttribute('id');
12
1817
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 location keyword
34
3561
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 200000 strings of 8 char each, string took over 25 minutes while StringBuilder took 40 milliseconds! Can anybody explain such a radical difference?
0
9695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9555
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10514
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10287
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7588
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6826
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4156
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.