473,546 Members | 2,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

magic quote question

Hello,

I have a search string of 3"CC which comes out 3\"CC with
magic_quotes_gp c set to on. I'm having a difficult time passing the
search string along the url or in a cookie. I've read on php.net of
other programmers who have written a function to add or strip the
slashes regardless of whether magic_quotes_gp c is set to on or not.
Can someone please give some suggestions or a good resource where I
can learn more about how to do this?

Thanks so much for your help!!

Aaron;
Jul 16 '05 #1
1 2014
"Aaron Collins" <aa***@smartweb development.com > wrote in message
news:f1******** *************** ***@posting.goo gle.com...
Hello,

I have a search string of 3"CC which comes out 3\"CC with
magic_quotes_gp c set to on. I'm having a difficult time passing the
search string along the url or in a cookie. I've read on php.net of
other programmers who have written a function to add or strip the
slashes regardless of whether magic_quotes_gp c is set to on or not.
Can someone please give some suggestions or a good resource where I
can learn more about how to do this?

Thanks so much for your help!!

Aaron;


Wow, Aaron, you're so close:

"...add or strip the slashes..."

Take that one step further:

$new_string = addslashes($sti ng);

$old_string = stripslashes($n ew_string);

If you did a search on php.net, this should have turned up. Also, you
really need to look in the PHP manual (download it as PDF or view it online)
and read everything there is about strings. It probably would have saved
you a lot of time. Also, if you want strange characters in Cookies and
URLs, lookup the urlencode() function. It does it all automatically.

HTH,
Zac
Jul 16 '05 #2

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

Similar topics

1
2436
by: Chris Pomasl | last post by:
Does no one have any insight?......please? Chris -------- Original Message -------- Subject: Problem with __FILE__ magic constant Date: Tue, 06 Jan 2004 16:43:41 GMT From: Chris Pomasl <pomaslNOSPAM@starband.net> Organization: Starband Communications Newsgroups: comp.lang.php
4
4414
by: Dave Moore | last post by:
Hi All, Can anybody point me to a FAQ or similar that describes what all this stuff is about please?. I'm interfacing with a MySQL database if that's relavent. I've read a couple of books which refer to stripslahes and 'escaping' but nothing really explains what these terms are and why these are used. Why is 'escaping' (whatever that is)...
19
5149
by: youpak2000 | last post by:
Are MAGIC numbers always bad? Using magic numbers (constant numbers) in programs are generally considered a bad programming practice, and it's recommended that to define constants in single, visible place in a header file. My question is that is there any situation where using magic numbers is not necessarily a bad thing? lets say that we...
51
4412
by: Kuku | last post by:
What is the difference between a reference and a pointer?
3
3543
by: Samuel | last post by:
Hi, How can I determine the type of a file from "magic bytes", similar to what the "file" command on unix does? I found http://docs.python.org/lib/module-mimetypes.html but this only seems to use the filename (extension) for finding the type. Any hints?
16
2576
by: per9000 | last post by:
Hi, I recently started working a lot more in python than I have done in the past. And I discovered something that totally removed the pretty pink clouds of beautifulness that had surrounded my previous python experiences: magic names (I felt almost as sad as when I discovered the strange pink worms that eat you in nethack, not to mention...
2
2564
by: jyck91 | last post by:
i have done the magic square: #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 13 main() { FILE *fp; int i, j, n, row, column;
6
6484
by: tinman77 | last post by:
Hello, I'm having a terrible time using the functions finfo_open and finfo_file. I'm using PHP 5 on IIS 5.1 and Windows XP. I have enabled php_mime_magic.dll and php_fileinfo.dll and also added the lines mime_magic.debug = Off and mime_magic.magicfile = "C:\Program Files\PHP\extras\magic.mime". Now my phpinfo() says fileinfo support is...
9
16121
by: Larry Hale | last post by:
I've heard tell of a Python binding for libmagic (file(1) *nixy command; see http://darwinsys.com/file/). Generally, has anybody built this and worked with it under Windows? The only thing I've been able to find is the python-magic module at http://hupp.org/adam/hg/python-magic/. Is this "THE" python-magic module. (It seems to be to...
3
4179
by: Larry Hale | last post by:
Thank you, again, Michael, for all your help many months ago. I *FINALLY* got a HowTo done up; please see http://wiki.python.org/moin/HowTo/FileMagic I've also emailed Mr. Hupp to see if he'll re-post the SWIG version; he's working on a newer binding (forget... ctypes??) and once that one's working... :) But for now...
0
7507
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...
0
7435
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...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6030
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...
1
5361
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...
0
3492
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...
0
3472
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1922
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
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.