473,787 Members | 2,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what am I doing wrong

Im a vb guy trying to figure out some php.

For some reason it wont let me append these together.

$variable = "test";

echo "c:\websites\me nu\" . $variable;

dont understand...pl ease help.

Sep 19 '05 #1
7 1100
ho******@hotmai l.com wrote:
Im a vb guy trying to figure out some php.

For some reason it wont let me append these together.

$variable = "test";

echo "c:\websites\me nu\" . $variable;

dont understand...pl ease help.

Is the second quote seen as escaped by the backslash? Maybe it will echo
"c:\\websites\\ menu\\" . $variable

Best regards
Sep 19 '05 #2
ho******@hotmai l.com a écrit :
Im a vb guy trying to figure out some php.

For some reason it wont let me append these together.

$variable = "test";

echo "c:\websites\me nu\" . $variable;

dont understand...pl ease help.


Ho, you do tell him to consider the final " as a text " instead of the
end of the string... (\ is the escape caracter...)

You just need to tell him it is the \ you want to escape... echo
"c:\websites\me nu\\" . $variable;

By the way, isn't variable a reserved word ?

Aphrael...
--
"La demande mondiale d'ordinateurs n'excédera pas cinq machines."
(Thomas Watson, Fondateur d'IBM, 1945)
Sep 19 '05 #3
I noticed that Message-ID:
<11************ **********@g43g 2000cwa.googleg roups.com> from
ho******@hotmai l.com contained the following:
$variable = "test";

echo "c:\websites\me nu\" . $variable;


The backslash is the escape character. For it to be a literal backslash
you have to escape it with...uh...a backslash.

echo "c:\\websites\\ menu\\" . $variable;

Or you could do

echo "c:\\websites\\ menu\\$variable ";
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Sep 19 '05 #4
On Mon, 19 Sep 2005 17:37:08 +0100, Geoff Berrow
<bl******@ckdog .co.uk> wrote:
I noticed that Message-ID:
<11*********** ***********@g43 g2000cwa.google groups.com> from
ho******@hotma il.com contained the following:
$variable = "test";

echo "c:\websites\me nu\" . $variable;


The backslash is the escape character. For it to be a literal backslash
you have to escape it with...uh...a backslash.

echo "c:\\websites\\ menu\\" . $variable;


or put a bit less stress on the server

echo 'c:\websites\me nu\' . $variable;
--
Regards, Paul Herber, Sandrila Ltd. http://www.pherber.com/
SanDriLa - SDL/MSC/TTCN/UML2 application for Visio http://www.sandrila.co.uk/
Sep 19 '05 #5
Need to escape backslashes in PHP. Try echo "c:\\websites\\ menu\\" .
$variable.

Sep 19 '05 #6
JDS
On Mon, 19 Sep 2005 09:20:13 -0700, ho******@hotmai l.com wrote:
For some reason it wont let me append these together.

$variable = "test";

echo "c:\websites\me nu\" . $variable;

dont understand...pl ease help.


Blame it on Microsoft

--
JDS | je*****@example .invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Sep 20 '05 #7
actullay no need for blaming any 1
the correct way is
- to escape the last backslash:
$var="test";

echo "C:\web\menu\\" .$var;
---------------------------------------------
the optimum solution for the case is :
$var='test'; //singl qoutes
echo 'C:\web\menu\\' .$var; //singl qoutes

---------------------------------------------
in double qutes PHP will seek for some varaiable inluded with a string
so in first solution you may make it like :

$var="test";

echo "C:\web\menu\\$ var";

Sep 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

125
14855
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
121
10180
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather than a PHP IDE. It only supports basic IntelliSense (or code completion) and doesn't have anything...
11
2044
by: Alfonso Morra | last post by:
Hi, I am at the end of my tether now - after spending several days trying to figure how to do this. I have finally written a simple "proof of concept" program to test serializing a structure containing pointers into a "flattened" bit stream. Here is my code (it dosen't work). I would be grateful for any feedback that helps fix this. My intention
46
4263
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do believe MSFT should do to improve C#, however. I know that in the "Whidbey" release of VS.NET currently
13
5059
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
2
2711
by: Aaron Ackerman | last post by:
I cannot a row to this bound DataGrid to SAVE MY LIFE! I have tried everything and I am at a loss. The using goes into add mode with the add button adds his data then updates with the update button, seems simple. I am using ALL visual controls (supposedly to simplify things. If I was not using the visual controls and calling an ExecuteNonQuery no prob. Please look at my code and tell me what I am doing wrong. Also, what are the advatages...
16
1993
by: Ajay | last post by:
Hi all, i want to know when i create a class.what all it contains.I know the following things are there by default if i do not declare them by myself.Please tell the other things that are left. 1. constructor 2.Destructor 3.Copy constructor 4. Assignment operator
8
2069
by: watkinsdev | last post by:
Hi, I have created a mesh class in visual studio 6.0 c++. I can create a device, render objects and can edit the objects by for instancnce selecting a cluster of vertices and processing the vertices and can do this multiple times on a sinlge vertex cluster. The problem I have been encoutering is that, if I select a second vertex cluster and try to edit that , the program crashes.
0
1326
by: shapper | last post by:
Hello, I am creating a class with a control. I compiled the class and used it on an Asp.Net 2.0 web site page. I can see the begin and end tags of my control (<oland </ol>) but somehow the child controls (just a literal for testing) of my control is not being added to the page. Could someone tell me what am I doing wrong?
10
1801
by: DavidSeck.com | last post by:
Hi, I am working with the Facebook API right now, an I have kind of a problem, but I don't know what I am doing wrong. So I have a few arrays, f.ex.: User albums: array(2) {
0
9655
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
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
10169
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
8993
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 project—planning, coding, testing, and deployment—without 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
7517
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
5398
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
4067
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
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.