Jump to content

PHP grabbing url for string after question mark


phpfreakjav

Recommended Posts

I have a flash movie that sends data to results.php

var sender = new LoadVars();

sender.xy = "someVariableValue";

sender.send('http://localhost/crazy_experiments/biomed/results.php', '', 'POST');

The result of this command is that the url in results.php appends to the following

http://localhost/crazy_experiments/biomed/results.php?xy=someVariableValue

 

The question: How do I grab the someVariableValue String from the url.

Link to comment
Share on other sites

I solve the problem! The problem was that I was running the movie as a standalone swf file. When I inserted the movie into html

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="550" height="400" accesskey="1" tabindex="2" title="Mouse">
  <param name="movie" value="14.swf">
  <param name="quality" value="high">
  <embed src="14.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="550" height="400"></embed>
</object>

The problem was fixed! thanks for making me think!

Link to comment
Share on other sites

I solved that issue after putting the data into a function call like this : This function shows how to pass an array onclick in flash to php.

 

var testing = new Array();

testing[0]="american explorer";

sData.onRelease = function()

{

sender.testing = testing[0];

sender.send('http://localhost/crazy_experiments/biomed/results.php','','POST');

 

}

 

php code is

$dataReceived= array($HTTP_POST_VARS["testing"]);//multidimensional array

Link to comment
Share on other sites

$variable = $_POST['xy'];

 

Or request if it's coming from the URL..

 

$variable = $_REQUEST['xy'];

 

Actually , The $_REQUEST function can be used to collect form data sent with both the GET and POST methods.

 

Yes, but if you know where the data should be it is best to get it directly from there. $_REQUEST can cause security issues.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.