Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-26-2006, 06:07 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
requestURL with '&'

It seems that requestURL is still having problems with links that make use of the character '&'. The command was able to find the php file that I provided the address to, but it was not able to differentiate the '&' character. Thus sending two php parameters as one.
Example:
PHP Code:
requestURL("http://255.255.255.0/example.php?pa=test&pb=test2")
// does not work and will seem to read the parameters as 'pa=test&pb=test'
// as one parameter. Thus instead of it reading pa=test and pb=test2, it will
// read pa="test&pb=test2"
requestURL("http://255.255.255.0/example.php?pa=test")
// while this does indeed work. 
Skyld has brought to my attention a way around this problem by sending one giant parameter and having the php code sort out the different data by using a tokenize() like command. However, this problem should still be fixed.
__________________
Reply With Quote
  #2  
Old 02-26-2006, 06:18 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
The sort of method that I used was:
PHP Code:
<?php
  
if (!isset($_GET['foo']))
  {
    die(
"No parameter");
  }

  
$tok explode("_"$_GET['foo']);

  if (
$tok[0] == "param1")
  {
    
// ...
  
}
?>
... and from that, $tok would contain the various components of the paramater if sent like this:
PHP Code:
ob requestURL("http://localhost/example.php?foo=param1_param2_param3"); 
But this seems like a fairly crude workaround.
__________________
Skyld
Reply With Quote
  #3  
Old 02-26-2006, 06:52 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Yes it is, there could also be instances where I may use a "_" in one of the params I send, and thus it would be read as another param. Anyways, whether there is a workaround or not, this should be fixed as it is a bug.
__________________
Reply With Quote
  #4  
Old 02-26-2006, 09:46 PM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Try putting &amp; instead of &, or use ; as a delimiter (PHP supports this by default I believe)
Reply With Quote
  #5  
Old 02-26-2006, 10:50 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by Rick
Try putting &amp; instead of &, or use ; as a delimiter (PHP supports this by default I believe)
Nope, doesn't work. I even tried escaping " and putting those around the parameters.
__________________
Reply With Quote
  #6  
Old 02-27-2006, 06:19 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I guess you are trying this on serverside?
Reply With Quote
  #7  
Old 02-28-2006, 12:34 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by Stefan
I guess you are trying this on serverside?
Yes, it was done serverside.
__________________
Reply With Quote
  #8  
Old 02-28-2006, 12:55 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The stuff on serverside was not updated for some time, I have uploaded the latest npcserver to all machines now.
Reply With Quote
  #9  
Old 02-28-2006, 03:35 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by Stefan
The stuff on serverside was not updated for some time, I have uploaded the latest npcserver to all machines now.
It is still not working. If I remove the 2nd parameter, it does work.
This is happening on N-Pulse Dev. Control-NPC
__________________
Reply With Quote
  #10  
Old 02-28-2006, 02:32 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Restart the npcserver?
Reply With Quote
  #11  
Old 03-01-2006, 01:11 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Thank you, it works.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.