Jump to content


Photo

Simple PHP Post to another script.... I must be retarded


  • Please log in to reply
6 replies to this topic

#1 chaseb

chaseb
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 October 2006 - 02:50 PM

I am sorry, I just can't figure this out, but I know that it must be very simple.  So, please help before I jab my eyes out! 

I have a php file, test.php, and I want to send a simple post to another php file on other server, and get a return.  So something this.

Call test.php > auto post www.mydomain.com/test2.php?myVar=200 > return from www.mydomain.com/test2.php to test.php return=true > test.php returns return=true

Thanks for any help!

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 10 October 2006 - 02:56 PM

set the action of the form to the file you want to process the form. that's really all there is to it.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 Anidazen

Anidazen
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 10 October 2006 - 03:15 PM

Not entirely sure what you want here, but you can use CURL to load another script from within your own - that can entirely simulate posting the form itself - the output from the first script could in itself be a return with this method, assuming you can customise both scripts.

You might be wanting to include the second script. If this is the case, you can use functions from the second script, but all returns need passing through an array: return $whatever.

Third option, if you're wanting to just bounce a user backwards and forwards between scripts, you could just use a simple refer?

#4 chaseb

chaseb
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 October 2006 - 03:55 PM

sorry if my post was a bit confusing.  What I want to be able to to do, is call server1.com/test1.php from Flash, then have server1.com/test1.php do a call to server2.com/test2.php  to post just one variable, then get server2.com/test2.php 's response and have server1.com/test1.php return that to flash. 

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 10 October 2006 - 04:01 PM

flash remoting?
is that what you are talking about?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#6 chaseb

chaseb
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 October 2006 - 04:02 PM

no, just talking to a php script, no remoting involved - which is primarily focused on SOAP/Java/.Net based apps not PHP

#7 chaseb

chaseb
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 October 2006 - 04:46 PM

I am doing some testing now, and I just need to ask, PHP security domain permissions allow one PHP script to call another on a different server and get a return right?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users