[PHP] inner workings of extract

2001-03-16 Thread dempsejn

Hi all,

I've recently discovered the extract function (thanks to the poster 
regarding it), and have found it to save lots of time. 
I'm having a problem though. 99 times out of 100 when someone thinks 
they've found a "bug" it's actually their misuse of the function, so i'm 
pretty sure this is the case with me. Anyway, here's the deal:

I have a function. Inside this function i have

global $name, $type, $location; (and others)

I make a call to a mysql database and get the result in $result.
Then I used to do this:

$name = $row["name"];
$type = $type["type"];
etc.

extract makes this a lot nicer. However, at the end of this function i 
call another function. This also uses the same global variables. Previous 
this worked fine. But now that i'm using extract, while i do have access 
to the variables in the function, i can't get them in the next. 

My guess is that the way extract works, (somehow, who knows), its 
creating a local variable named $name and setting my info to that, as 
opposed to $name = $row["name"] which sets the global. So, even though i 
can access $name in the function, its lost to the next. 
This isn't a huge issue--i can go back to the old way, or pass the 
variables in the function, but there are enough that i wanted to know if 
anyone else has experienced this. Is there some way to tell extract to 
extract the variables and set the results to the global versions?
Maybe i'm way off and its a small code error, but I really do doubt this, 
as i've commented out lines and gone back and forth and get the same 
result. here's the basic idea though:
function tester(){
global $name;
$row = mysql_fetch_array($sql_result);
$name = $row["name"];
nextone();
/*this works fine, but if i have extract($row) and comment out
the $name = $row["name"] line, then i can't see the variable in the 
next function*/

}
function nextone(){
global $name;
echo $name;
}

any ideas?

thanks,
jack



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] search string

2001-04-15 Thread dempsejn

Even better, try strstr...it'll be faster than a regexp for a simple 
search of a string for another string.

-jack

- Original Message -
From: "Tobias Talltorp" <[EMAIL PROTECTED]>
Date: Sunday, April 15, 2001 7:20 pm
Subject: Re: [PHP] search string

> I think you want regular expressions...
> 
> Try this on for size:
> $str = "http://www.yahoo.com/somedir/somepage.html";
> 
> if (preg_match("/www.yahoo.com/i", $str)) {
> print "Your submission cannot be accepted";
> } else {
> print "You are good";
> }
> 
> If you want to read up on regular expressions:
> http://www.php.net/manual/en/ref.pcre.php (Faster than ereg)
> http://www.php.net/manual/en/ref.regex.php
> 
> // Tobias Talltorp
> 
> 
> ""Joseph Bannon"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > What is the function to search a string? Basically, I want 
> search a string
> > (a url) to see if it has "www.yahoo.com" in it and if yes, tell 
> the user
> > their submission cannot be accepted.
> >
> > J
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]>
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: RE: [PHP] cell iterations in loop

2001-04-26 Thread dempsejn

ok, again, trying to understand "blank space"...but, try this:
if you print out  you'll get something i think you're referring to as blank 
space...
try using a nonbreaking space in there...either   or a space in the code; this 
will force 
the "emptiness" to show up...

-jack

- Original Message -
From: "Jerry Lake" <[EMAIL PROTECTED]>
Date: Thursday, April 26, 2001 4:54 pm
Subject: RE: [PHP] cell iterations in loop

> Thanks, that worked with the removal
> of the first if clause for part 2 of
> my question, as far as part one, I will
> try to explain better. if you view the
> chunk of code in a browser you will get
> a table with borders number 1-43 however
> there will be a blank space at the end
> where 44 & 45 would be. how can I make
> the loop echo enough " " lines
> to show empty cells instead of blank space
> regardless of the number of cells I am
> creating ?
> 
> Jerry Lake- [EMAIL PROTECTED]
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online- http://www.pacifier.com
> 
> 
> -Original Message-
> From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 1:18 PM
> To: [EMAIL PROTECTED]; Jerry Lake
> Subject: RE: [PHP] cell iterations in loop
> 
> 
> I'm a little unclear as to what you're trying to do, but here's my
> interpretation:
> 
> problem 2: if it ends on a complete row...
> solution: put the echoing of the first and last tr's inside your
> conditional. When $x is initialized to 0, the if will return true, 
> and you
> will output the very first tr...same at the end...so i'd have 
> something like
> this:
> 
> 
> 
>  $x = 0;
> #different here for later reason
> $length = 42;
> while ($x <= $length)
>{
>$x++;
>if ($x % 5 == 0)
>{
>echo "\n";
>}
>echo "".$x."\n";
>if ($x % 5 == 0)
>{
>echo "\n";
>}
> 
>}
> 
> #also added in
> if($length % 5 != 0){
> {
>#then we know that it did not end completely, so echo 
> you're final 
>echo "\n";
> }
> #no need for an else block because it would do nothing
> ?>
> 
> 
> 
> Now if it ends on a complete row, you're fine!
> 
> problem 1: what about if it ends at 42 or something, with just a 
> closing?
> solution: make a final check to see if you need that closing 
> That is the if statement after you're loop...
> 
> I hope this helps.
> 
> -jack
> 
> 
> 
> -Original Message-
> From: Jerry Lake [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 2:32 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] cell iterations in loop
> 
> 
> I've got some code that I am
> creating that creates a table with
> a loop. and it works fine for what
> it is, but my question is how do I
> compensate for rows that aren't divisible
> by 5 ? i.e. the empty cells at the table.
> additionally if it ends on a complete row
> (divisible by 5) I end up with an additional
> empty row at the end of the table, I can
> see why it does, I'm just trying to get around
> it. no big hurry on this, I'm just trying to
> learn more.
> 
> 
> 
>
>  $x = 0;
> while ($x <= 42)
>{
>$x++;
>if ($x % 5 == 0)
>{
>echo "".$x."\n";
>echo "\n\n";
>}
>else
>{
>echo "".$x."\n";
>}
>}
> ?>
>
> 
> 
> 
> Jerry Lake- [EMAIL PROTECTED]
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online- http://www.pacifier.com
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: RE: RE: [PHP] cell iterations in loop

2001-04-26 Thread dempsejn

ah, i got it...
ok, try this:
$length is arbitrary...
$x is your counter...
do the loop as before, but each time through the loop, $loopcount++;
So, if you do the loop 5 times, $loopcount == 5.
Then, at the end, $length - ($loopcount*$x) gives you the amount of  's to
echo. Put another for loop with these parameters after you've printed your normal 
td's...you could do this all in one for loop, and would just need some more if 
statements...
i think this is what you need...let me know how it goes...

-jack
- Original Message -
From: "Jerry Lake" <[EMAIL PROTECTED]>
Date: Thursday, April 26, 2001 5:20 pm
Subject: RE: RE: [PHP] cell iterations in loop

> Right, I understand that
> if I use  it is blank space
> if I use   it is an empty cell
> 
> right now $length is set at 42 (this is arbitrary)
> and there needs to be two empty cells at the end of
> the last row. if length is 41 I will need 3 and 40
> will need 4. but if I don't know what the value of
> $length is going to be on a dynamic page such as
> showing "x" amount of images from a folder. I need
> for the loop to know how many " " to
> echo out at the end depending on the $length;
> 
> I apologize if I am not explaining this very well.
> I usually am quite concise.
> 
> Jerry Lake- [EMAIL PROTECTED]
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online- http://www.pacifier.com
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 2:00 PM
> To: Jerry Lake
> Cc: [EMAIL PROTECTED]
> Subject: Re: RE: [PHP] cell iterations in loop
> 
> 
> ok, again, trying to understand "blank space"...but, try this:
> if you print out  you'll get something i think you're 
> referring to
> as blank space...
> try using a nonbreaking space in there...either   or a space in the
> code; this will force
> the "emptiness" to show up...
> 
> -jack
> 
> - Original Message -
> From: "Jerry Lake" <[EMAIL PROTECTED]>
> Date: Thursday, April 26, 2001 4:54 pm
> Subject: RE: [PHP] cell iterations in loop
> 
> > Thanks, that worked with the removal
> > of the first if clause for part 2 of
> > my question, as far as part one, I will
> > try to explain better. if you view the
> > chunk of code in a browser you will get
> > a table with borders number 1-43 however
> > there will be a blank space at the end
> > where 44 & 45 would be. how can I make
> > the loop echo enough " " lines
> > to show empty cells instead of blank space
> > regardless of the number of cells I am
> > creating ?
> >
> > Jerry Lake- [EMAIL PROTECTED]
> > Interface Engineering Technician
> > Europa Communications - http://www.europa.com
> > Pacifier Online- http://www.pacifier.com
> >
> >
> > -Original Message-
> > From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 26, 2001 1:18 PM
> > To: [EMAIL PROTECTED]; Jerry Lake
> > Subject: RE: [PHP] cell iterations in loop
> >
> >
> > I'm a little unclear as to what you're trying to do, but here's my
> > interpretation:
> >
> > problem 2: if it ends on a complete row...
> > solution: put the echoing of the first and last tr's inside your
> > conditional. When $x is initialized to 0, the if will return true,
> > and you
> > will output the very first tr...same at the end...so i'd have
> > something like
> > this:
> >
> > 
> > 
> >  > $x = 0;
> > #different here for later reason
> > $length = 42;
> > while ($x <= $length)
> >{
> >$x++;
> >if ($x % 5 == 0)
> >{
> >echo "\n";
> >}
> >echo "".$x."\n";
> >if ($x % 5 == 0)
> >{
> >echo "\n";
> >}
> >
> >}
> >
> > #also added in
> > if($length % 5 != 0){
> > {
> >#then we know that it did not end completely, so echo
> > you're final 
> >echo "\n";
> > }
> > #no need for an else block because it would do nothing
> > ?>
> > 
> > 
> >
> > Now if it ends on a complete row, you're fine!
> >
> > problem 1: what about if it ends at 42 or something, with just a
> > closing?
> > solution: make a final check to see if you need that closing 
> > That is the if statement after you're loop...
> >
> > I hope this helps.
> >
> > -jack
> >
> >
> >
> > -Original Message-
> > From: Jerry Lake [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 26, 2001 2:32 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] cell iterations in loop
> >
> >
> > I've got some code that I am
> > creating that creates a table with
> > a loop. and it works fine for what
> > it is, but my question is how do I
> > compensate for rows that aren't divisible
> > by 5 ? i.e. the empty cells at the table.
> > additionally if it ends on a complete row
> > (divisible by 5) I end up with an additional
> > empty row at the end of the table, 

Re: [PHP] Parsing Phone Numbers

2001-05-16 Thread dempsejn

this was just asked yesterday...if you have a phone number and it has 10 digits,
then use easily use substr to add slashes at the right points...same for the other
number...

-jack

- Original Message -
From: "Jason Caldwell" <[EMAIL PROTECTED]>
Date: Wednesday, May 16, 2001 10:58 pm
Subject: [PHP] Parsing Phone Numbers

> Is there a way I can modify a phone number programmatically -- for 
> example,if I have the following phone number:
> 
> 1234567890
> 
> Now there are no "-" or "." separators... and I would like to 
> automaticallyadd them when the user hits submit...
> 
> 123-456-7890
> 
> Also, I would like to account for optional International Codes...
> 
> from 0001234567890
> 
> to 000-123-456-7890
> 
> Thanks
> Jason
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP and XHTML

2001-05-18 Thread dempsejn

i won't pretend to be an XML guru, but isn't saying "php won't work with XHTML" akin 
to saying
"php won't work with javascript1.3, dhtml, netscape 6" etc? 
php generates code...html, dhtml, whatever...i fail to see how php couldn't generate
what anyone would need for XHTML, or anything else along those lines

-jack

- Original Message -
From: Rasmus Lerdorf <[EMAIL PROTECTED]>
Date: Friday, May 18, 2001 6:59 pm
Subject: Re: [PHP] PHP and XHTML

> > I would like to start using the XHTML syntax for my future 
> projects, but I
> > heard that PHP is not compatible with XHTML. For example, in 
> XHTML the ID
> > attribute is used in place of the deprecated NAME tag. But PHP 
> depends on
> > the NAME attribute in forms, etc. Is there any way around this? 
> Has anyone
> > used XHTML and PHP together successfully, and if so how did you 
> get around
> > the previously mentioned problem? Any help woould be much 
> appreciated,> thanks in advance.
> 
> Completely false.  PHP works fine with XHTML.
> 
> -Rasmus
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] language question

2001-10-23 Thread dempsejn

david,

the syntax needs a single variable there...not a list, or multiple 
vars...plus, if you look at http://php.net/list, you'll see it returns 
void, and foreach($table as void) doesn't make much sense...

jack

- Original Message -
From: David Otton <[EMAIL PROTECTED]>
Date: Tuesday, October 23, 2001 4:14 pm
Subject: Re: [PHP] language question

> On Mon, 22 Oct 2001 16:47:56 +0200, you wrote:
> 
> >On Monday 22 October 2001 14:28, David Otton wrote:
> >> why does this work:
> >>
> >>foreach ($table as $row)
> >>list ($a, $b) = $row;
> >>
> >> but this doesn't?
> >>
> >>foreach ($table as list ($a, $b));
> >
> >because the correct syntax is
> > foreach ($table as $key => $val) {
> >   ...
> > }
> 
> >RTFM :)
> 
> Well... no. The manual says "There are two syntaxes; the second is a
> minor but useful extension of the first:
> 
> foreach(array_expression as $value) statement
> foreach(array_expression as $key => $value) statement"
> 
> Ok, let me rewrite my examples, so they're definitely not about
> dictionaries :
> 
> $table is an array of arrays. Each inner array has three values.
> 
> Roughly $table = ((1,2,3),(4,5,6),(7,8,9))
> 
> foreach ($table as $row)
>list ($a, $b, $c) = $row;
> 
> foreach ($table as list($a, $b, $c));
> 
> I still don't see what it is about list() that precludes it's use in
> this way. Anyone?
> 
> >BTW: overwriting $a, $b in each iteration isn't particularly 
> useful...
> But it is a minimal example of the construct I don't understand.
> 
> djo
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: RE: [PHP] This PHP list

2001-03-28 Thread dempsejn

Hey Peter,

not to keep this discussion going (which of course i do by typing 
this), but i wanted to add a quick comment on what you wrote...in a lot 
of ways, i'm a "newbie" to PHP...i've only been using it seriously for 
a couple months (max)but, i hate having others figure things out 
for me when i feel like i have the chance at figuring it out...so, i 
really take the time and put in the effort to look through the 
discussions, check the website, think and search, etc...i speak for 
myself of course, but i think the most frustrating thing (in any list, 
not just PHP) is NOT when a "newbie" asks "hey, how come i can't get 
variables within a function" ( the answer being "use global $variable 
name), but when someone posts a question like "i want to connect to 
mysql and display some stuff. how do i do this" Its not really a 
personal insult or anything, but to me, a post like that means that the 
person did not take the time to even read a tutorial; they just want 
someone to do it for them. Also, the "can you give me an example" thing 
is fine; sometimes things are tricky, and i would never tell someone to 
hold a question back. recently i was curious about authentication 
systems, so i looked around on the net, read some posts, looked through 
some books i had, and learned about it on my own, rather than 
typing "can someone tell me how to write an authentication system". 
So, IMHO, the part that gets people riled up is when its pretty obvious 
that the person has not even taken time to read a tutorial or try it on 
their own; the flipside is this: (at least when I see a post like 
this) "ok, i've looked EVERYWHERE, and i can't figure out why 
echo "$ARRAY{VARIABLE}"; won't work? any thoughts? 
That kinda question, in my eyes, is totally understandable. "what does 
echo do?" however is not...
I'm not so much responding to you as giving my .02c about this whole 
topic...and for people who don't know, especially since the really good 
php coders on this list won't say "Sincerely, Rasmus, ( look for my 
name in the credits)" or "Julie, (author of that book people keep 
recommending), there are some SERIOUSLY GOOD coders on this list; 
respect everyone's time and try to figure out what you can for yourself-
-its the best way to learn. When you get stuck, then ask. And for 
people who get really frustrated with the repeated "what's the best PHP 
editor", hell, i just smile and delete the e-mail, waiting to see 
who'll give that poster a nice reply...
ok, sorry for those who're still readingits 2:30 EST and i'm coding 
a minimum spanning tree in java, so this is a nice break...

best regards to all,
jack

- Original Message -
From: "Peter Houchin" <[EMAIL PROTECTED]>
Date: Thursday, March 29, 2001 2:02 am
Subject: RE: [PHP] This PHP list

> Being a newbie, and as i'm sure is the case with alot of other 
> newbies, one that doesn't have a lot of programming back ground, 
> ask stupid questions to this list because for some things that you 
> find easy others, like my self, don't know what to look for in the 
> manual ... so we ask it here...  now if it wasn't for the more 
> knowledgeable people on this list, I like many others, would be 
> stuck with out any where to go .. 
> 
> So thanks to those of you that don't complain and crack the s#$@s 
> when newbie become repetitive.
> 
> Peter
> 
> -Original Message-
> From: Ian Harris [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 29, 2001 4:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] This PHP list
> 
> 
> 
> I was hoping that this PHP list would be of people developing with 
> PHP, who
> have reached some level of familiarity with the product and when 
> they have
> had a fair go at solving a problem, they then posted it to the 
> list.  For
> example, we have a problem in our code where the last object in an 
> array of
> objects sometimes vanishes into thin air depending on whether you
> comment-out a block of unrelated code further up the script.
> 
> Unfortunately, this list is full of people with questions like "I 
> want to
> access a database with PHP. Can someone please send me the source 
> code".
> Does anyone know of any other PHP lists that are more suited to 
> non-trivial,
> expert-related discussions?
> 
> If there aren't any around, I'll start one on Yahoogroups or some 
> othersimilar service.
> 
> regards
> Ian.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] split string value again

2001-03-29 Thread dempsejn

"try again" after 20 minutes...give people some time to 
respond!...anyways, you can explode the variable...

list($junk,$domain) = explode("@",$email);

checkout http://www.php.net/explode 
you'll use it a lot

-jack

- Original Message -
From: "Jacky" <[EMAIL PROTECTED]>
Date: Thursday, March 29, 2001 5:52 pm
Subject: [PHP] split string value again

> Hi again
> have to try again after I have not recieved any advice, I have a 
> vairable that stores email address value. I need to break it so 
> that I will only get the dmain name bit to store in another 
> variable so that I can redirect user to that domain, like if user 
> email is [EMAIL PROTECTED] then I would like to break that and take 
> only foo.com bit to use for navigation.
> How can I do that?
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set 
> for yourself"
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] compiling PHP4

2001-03-30 Thread dempsejn

hey scott,

i compiled  php and gd on my redhat 6.2 box a couple weeks ago..took a 
little tweaking to make sure i had jpeg installed right, etc, but in the 
end its working well...what was your error? maybe that'll shed some 
light...

-jack

- Original Message -
From: "..s.c.o.t.t.. [gts]" <[EMAIL PROTECTED]>
Date: Friday, March 30, 2001 7:42 pm
Subject: [PHP] compiling PHP4

> has anyone had trouble compiling PHP and GD on a linux/redhat
> machine?? (what baffles me the most is that it compiled
> flawlessly on another, almost identical, machine)
> 
> could anyone offer suggestions or hints, or perhaps
> suggest a good website/discussiomight address GD-PHP compilation 
> errors?
> thanks a bunch.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Filtering out \ when a ' is user entered?

2001-06-27 Thread dempsejn

Hey Marcus,

Lots of different ways...first, the \ is being added because you have 
magic_quotes turned on...you can use set_magic_quotes_runtime to turn 
them off in a specific script, edit your php.ini file to turn them off 
completely, or just do a string replace - replace \' with ' and \" 
with "
best of luck,
jack dempsey

- Original Message -
From: Marcus James Christian <[EMAIL PROTECTED]>
Date: Wednesday, June 27, 2001 0:18 am
Subject: [PHP] Filtering out \ when a ' is user entered?

> Hello,
> 
> I'm pretty new to PHP but all I've seen of it so far I pretty much 
> love!
> I've built a web log but when the user enters their data and they 
> use '
> or "  (and you know they will)   php always shows it from the included
> web log as
> 
> \'  How can I filter out these backslashes so they don't appear on the
> final public viewable page?
> 
> Thanks,
> Marcus
> 
> --
> Marcus James Christian - UNLIMITED -
> Multimedia Internet Design
> http://mjchristianunlimited.com
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]