Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   requestURL with '&' (https://forums.graalonline.com/forums/showthread.php?t=64380)

ZeLpH_MyStiK 02-26-2006 06:07 PM

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.

Skyld 02-26-2006 06:18 PM

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.

ZeLpH_MyStiK 02-26-2006 06:52 PM

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.

Rick 02-26-2006 09:46 PM

Try putting &amp; instead of &, or use ; as a delimiter (PHP supports this by default I believe)

ZeLpH_MyStiK 02-26-2006 10:50 PM

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.

Admins 02-27-2006 06:19 PM

I guess you are trying this on serverside?

ZeLpH_MyStiK 02-28-2006 12:34 AM

Quote:

Originally Posted by Stefan
I guess you are trying this on serverside?

Yes, it was done serverside.

Admins 02-28-2006 12:55 AM

The stuff on serverside was not updated for some time, I have uploaded the latest npcserver to all machines now.

ZeLpH_MyStiK 02-28-2006 03:35 AM

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

Admins 02-28-2006 02:32 PM

Restart the npcserver?

ZeLpH_MyStiK 03-01-2006 01:11 AM

Thank you, it works.


All times are GMT +2. The time now is 02:01 AM.

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