Jump to content

how to execute a url from php


Looktrne

Recommended Posts

the following url when run in a browser sends me an email through the contact form of my site..

 

http://www.abmatch.com/index.php?page=contact_admin&name=webscribble%20webdate%20bugs%2
0fixed&[email protected]&message=Have%20you%20fixed%20the%20bugs%20with%20your%20webscribble%20webdate%20site%20yet?%20visit%20my%20webscribble%20webdate%20support%20forum%20for%20more%20information.%20or%20contact%20me%20directly.%20%3Cbr%3EPaul&action=submit_mail

 

how can I run this url in a php script to get it to work

 

I tried $code = file_get_contents($url); and a little bit or curl

 

but I cant get it to submit... when I paste it in firefox it submits when I click go

 

any help is appreciated

 

Paul

Link to comment
https://forums.phpfreaks.com/topic/113002-how-to-execute-a-url-from-php/
Share on other sites

I tried what you mentioned and It does not seem to work... could someone tell me why this form would not submit?

 

I am running the file/form on http://peapull.com

 

and it should submit the form to http://abmatch.com

 

here is the code..

 

<form name="contact_admin" action="http://abmatch.com/index.php?page=contact_admin" method="POST">
<input type="hidden" name="name" value="Webscribble Webdate Bugs Fixed." />
<input type="hidden" name="email" value="[email protected]" />
<input type="hidden" name="message" value="This is the message body" />
<input type="hidden" name="action" value="submit_mail">
</form>

<SCRIPT language="JavaScript">
function submitform()
{
  document.contact_admin.submit();
}
</SCRIPT>

 

is there a reason this won't submit?

 

thanks for any help

 

Paul

Try this:

 

<form name="contact_admin" id="contact_admin" action="http://abmatch.com/index.php?page=contact_admin" method="post">
<input type="hidden" name="name" value="Webscribble Webdate Bugs Fixed." />
<input type="hidden" name="email" value="[email protected]" />
<input type="hidden" name="message" value="This is the message body" />
<input type="hidden" name="action" value="submit_mail">
</form>

<script type="text/javascript" language="JavaScript">
 document.contact_admin.submit();
</script>

Ok this worked once and now stopped working again... what would cause this to work intermittently?

 

here is the code:

 

<?
$url="http://www.abmatch.com/index.php?page=contact_admin&name=Webscribble Webdate Bugs Fixed&[email protected]&message=Testing 123&action=submit_mail";
echo "Sending=>".$url;
$code = file_get_contents($url);

echo $code
?>

 

I ran it last night and it worked it sent me the email....

 

today it echos the contact page... but does not display the email sent succesfully message and I get no email..

 

it worked last night

 

any ideas why this would work once and not the next day?

 

if I copy paste the url into a browser it submits the form no problem

 

is there a better more relliable way of doing this?

 

thanks

 

Paul

 

 

ok considering the file_get_contents($url);

 

was working intermittently I decided to try the form that was posted..

 

it worked fine with this script

 

<form name="contact_admin" id="contact_admin" action="http://abmatch.com/index.php?page=contact_admin" method="post">
<input type="hidden" name="name" value="Webscribble Webdate Bugs Fixed." />
<input type="hidden" name="email" value="[email protected]" />
<input type="hidden" name="message" value="This is the message body" />
<input type="hidden" name="action" value="submit_mail">
</form>

<script type="text/javascript" language="JavaScript">
  document.contact_admin.submit();
</script>
<?

echo "back";
?>

 

my only problem is it lands at http://abmatch.com

 

I need it to submit the form and remain in the script so I can submit multiple forms within the same script..

 

how can I submit this form and have it return to the script

 

thanks

 

Paul

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.