Jump to content

Recommended Posts

can you give us a clue?  We prolly could help, but we would need to know what kind of data it returns. if it's a standard website, You'll most likely need to use CuRL, if it's XML or SOAP, that's different. There are many ways to do it, but we would need more information to give a decent answer.

your subject line says "remote file" but your message say's "remote site" which is it?

 

the first one is easy, the latter is a bit trickier as cross-site-scripting is difficult if you don't administer the second site.  your best bet then is screen-scraping.

 

what exactly are you trying to do?

Sorry about the delay everyone,

I've been searching the internet and trying stuff .

The problem is, I have to authenticate users using an authentication file from another server. I need to take their data from my page to the remote authentication page then gather the results from that page back to my page.

 

 

CURL is your best bet. But if you want an alternative try this:

<?php
$data=array('foo'=>'bar','bar'=>'baz');
$data=http_build_query($data);
$context_options=array('http'=>array('method'=>'POST',
         'header'=>"Content-type: application/x-www-form-urlencoded\r\n".
         'Content-Length: '.strlen($data)."\r\n",
         'content'=>$data));
$context=stream_context_create($context_options);
$fp=file_get_contents('http://127.0.0.1/test2.php', FALSE, $context);
var_dump($fp);
?>

Hey guys,

I'm using the latest version of phpmailer. Is it possible to authenticate a user without sending them mail?

I'm using SMTP by the way.

That's the only way I could get around my woes right now.

 

Since you state who you are sending the email to, you can define it anyway you want.  Here is an example.

 

require_once "Mail.php";

$to = "Me <me@email.com>";

$headers["From"] = "Me <me@email.com>";
$headers["Subject"] = "My Email";

$smtp["host"] = "localhost";
$smtp["port"] = "26";
$smtp["auth"] = true;
$smtp["username"] = "user@email.com";
$smtp["password"] = "password";

$msg = "This is what I want to say.";

// Sends the email
$mail = Mail::factory('smtp', $smtp);

$mail->send($to, $headers, $msg)
or die('Error while processing your submission.');

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.