Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 589 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

My brain aches.

Thread title: My brain aches.
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
03-08-2005, 01:06 AM
#1
seen.to is offline seen.to
seen.to's Avatar
Status: unusual suspect ™
Join date: Feb 2005
Location: Lancaster, PA from London UK
Expertise:
Software:
 
Posts: 1,814
iTrader: 0 / 0%
 

seen.to is on a distinguished road

  Old  My brain aches.

I'm using this (created by my programmer)

Code:
$mystring = $_SERVER['QUERY_STRING'];
But it's turning out the URL with & instead of & which is needed for total validation (as required by the client).

I've changed

Code:
arg_separator.output = "&"
to

Code:
arg_separator.output = "&"
in PHP.ini which fixed some previous issues with the same problem but not this time.

I tried
Code:
str_replace ("&","&amp");
but wasn't quite sure of the syntax, where to put it in the string, or if it's even the right thing :-/

Any ideas you PHP guru's out there?

03-08-2005, 01:08 AM
#2
mike.fro is offline mike.fro
mike.fro's Avatar
Status: I love this place
Join date: Mar 2005
Location: Burnsville
Expertise: Design
Software:
 
Posts: 674
iTrader: 5 / 100%
 

mike.fro is on a distinguished road

  Old

Originally Posted by seen.to
I'm using this (created by my programmer)

Code:
$mystring = $_SERVER['QUERY_STRING'];
But it's turning out the URL with & instead of & which is needed for total validation (as required by the client).

I've changed

Code:
arg_separator.output = "&"
to

Code:
arg_separator.output = "&"
in PHP.ini which fixed some previous issues with the same problem but not this time.

I tried
Code:
str_replace ("&","&amp");
but wasn't quite sure of the syntax, where to put it in the string, or if it's even the right thing :-/

Any ideas you PHP guru's out there?
Code:
str_replace ("&","&amp");
You missed a ";" so try this:
Code:
str_replace ("&","&");
Let me know if that works, if not i'll try something else.

03-08-2005, 01:11 AM
#3
seen.to is offline seen.to
seen.to's Avatar
Status: unusual suspect ™
Join date: Feb 2005
Location: Lancaster, PA from London UK
Expertise:
Software:
 
Posts: 1,814
iTrader: 0 / 0%
 

seen.to is on a distinguished road

  Old

Oops! That was just as I was typing it in here though... the ; is in the version I tried

03-08-2005, 01:13 AM
#4
mike.fro is offline mike.fro
mike.fro's Avatar
Status: I love this place
Join date: Mar 2005
Location: Burnsville
Expertise: Design
Software:
 
Posts: 674
iTrader: 5 / 100%
 

mike.fro is on a distinguished road

  Old

Originally Posted by seen.to
Oops! That was just as I was typing it in here though... the ; is in the version I tried
Ahh I see. Alright. Do you have any messenger service? Cause I think i'm going to need to check out your script in order to help you out, just so I can get an idea of what i'm working with. Just hit me up on any messenger service and i'll be glad to help you out.

03-08-2005, 04:05 AM
#5
mike.fro is offline mike.fro
mike.fro's Avatar
Status: I love this place
Join date: Mar 2005
Location: Burnsville
Expertise: Design
Software:
 
Posts: 674
iTrader: 5 / 100%
 

mike.fro is on a distinguished road

  Old

Sorry for double post but I think I have a solution. Here is an example of the str_replace() function and then i'll use your code and hopefully it works:

My Example:
PHP Code:
<?php
$author 
"mike.froseth@onlydev.com";
$author str_replace("@""(at)"$author);
echo(
"Contact the author of this tutorial at $author.");
?>
That will result in the following:
"Contact the author of this tutorial at mike.froseth(at)onlydev.com

Now using your code:
PHP Code:
<?php
$mystring 
$_SERVER['QUERY_STRING'];
$mystring str_replace("&""&amp;"$mystring);
echo(
"whatever is needed here... $mystring");
?>
Let me know if that doesnt work. If it does, then awesome If not let me know and i'll try something else. It might not work though because I havent seen the application/script yet and not sure if you are working with anything else. Lets hope it works though.

03-08-2005, 04:22 AM
#6
seen.to is offline seen.to
seen.to's Avatar
Status: unusual suspect ™
Join date: Feb 2005
Location: Lancaster, PA from London UK
Expertise:
Software:
 
Posts: 1,814
iTrader: 0 / 0%
 

seen.to is on a distinguished road

  Old

Totally awesome Mike - many many thanks :-D

03-08-2005, 04:27 AM
#7
mike.fro is offline mike.fro
mike.fro's Avatar
Status: I love this place
Join date: Mar 2005
Location: Burnsville
Expertise: Design
Software:
 
Posts: 674
iTrader: 5 / 100%
 

mike.fro is on a distinguished road

  Old

Originally Posted by seen.to
Totally awesome Mike - many many thanks :-D
Ah, so I take it that it worked?

03-08-2005, 04:29 AM
#8
seen.to is offline seen.to
seen.to's Avatar
Status: unusual suspect ™
Join date: Feb 2005
Location: Lancaster, PA from London UK
Expertise:
Software:
 
Posts: 1,814
iTrader: 0 / 0%
 

seen.to is on a distinguished road

  Old

Originally Posted by mike.fro
Ah, so I take it that it worked?
Absolutely all back to validated XHTML/CSS

03-08-2005, 04:31 AM
#9
mike.fro is offline mike.fro
mike.fro's Avatar
Status: I love this place
Join date: Mar 2005
Location: Burnsville
Expertise: Design
Software:
 
Posts: 674
iTrader: 5 / 100%
 

mike.fro is on a distinguished road

  Old

Originally Posted by seen.to
Absolutely all back to validated XHTML/CSS
Awesome man, glad I could be of assistance Let me know if you need any other help with anything PHP & mySQL related. I love helping out others!

03-08-2005, 08:53 PM
#10
kiswa is offline kiswa
Status: Junior Member
Join date: Feb 2005
Location: Florida
Expertise:
Software:
 
Posts: 91
iTrader: 0 / 0%
 

kiswa is on a distinguished road

  Old

I know this is already 'solved', but I thought I'd mention the way I use it. I set this line of PHP code at the beginning of the PHP file I'm using:
PHP Code:
ini_set('arg_separator.output','&amp;'); 
and that makes all the output argument separators the valid markup for & instead of the & symbol itself.

I only mention it because it means you wouldn't have to rewrite the existing function that PHP already has working for you. But good job on that Mike.

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed