...

View Full Version : PHP logs into multiple sites (new windows)



glish_dreams
07-31-2007, 12:40 AM
Summary

I am making a portal which users log into. Everything is pointing to a DB, Tables are linked to other tables.

EX.

Tables
portal_users
email_users
ticket_users


I am trying to set it up. where the User logins into the Portal, clicks on the link that states its EMail, or Ticket.

It will then look at the portal_users ID, to match to email_users ID, to pull the correct Users UN and PASS.

___

How can I make my portal log users into an external site, such as our OWA

StupidRalph
07-31-2007, 01:13 AM
Look into using cURL (http://www.php.net/curl) Also, make sure whoever sites you are trying to log in via the portal allows it.

glish_dreams
07-31-2007, 01:40 PM
I have setup a Way so far, I havent started using this method after logging into my portal yet,, but im just demoing IDs in the URL... so sessions will keep track of the data



<?php
$email_id=$_GET['email_id'];
$user="demo";
$password="baby";
$database="owa_email";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query=" SELECT * FROM users WHERE email_id='$email_id'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$user_name=mysql_result($result,$i,"user_name");
$pass_word=mysql_result($result,$i,"pass_word");

$i++;
}
?>


<FORM action="https://owa.atlarge.net/exchweb/bin/auth/owaauth.dll" method="POST" name="logonOWA" autocomplete="off" target="_blank">
<INPUT type="hidden" name="destination" value="https://owa.atlarge.net/">
<INPUT type="hidden" name="flags" value="0">
<TABLE align="center" border="1" height="100" width="400" bordercolor="#cc66ff">
<TR>
<TD>
<TABLE border="0" align="center" width="400" bordercolor="#cc66ff" height="150">
<TR>
<TD colspan="2">
<P align="center"><U><FONT>Only use First initial Last name</FONT></U></P>
</TD>
</TR>
<TR>
<TD align="right"><FONT>FLast:</FONT> </TD>
<TD>
<INPUT type="text" id="username" name="username" size="25" maxlength="256" value="<?php echo $user_name; ?>"></TD>
</TR>
<TR>
<TD align="right"><FONT>Password:</FONT> </TD>
<TD>
<INPUT type="password" autocomplete="off" id="password" name="password" size="25" maxlength="256" value="<?php echo $pass_word; ?>">
</TD>
</TR>
<TR>
<TD colspan="2" align="center">
<INPUT type="submit" value="Check your eMail" id="SubmitCreds" name="SubmitCreds"></TD>
</TR>
</TD>
</TABLE>
</TD>
</TR>
</TABLE>
</FORM>


Now thats working, so, I already have my portal that can be logged into
So all im needing to figure out.

A way for, after you login, Portal_ID=# says in the URL always.
When you click link for. email, ticket, ftp, and so on.
Ill have it load the form, with hidden boxes, in a frame, then lunch the site in a new window.

Figuring out how to have my php look at the portal ID and say, 1 is 6 in email_id

glish_dreams
08-02-2007, 09:17 PM
I have figured out a great way to make this work

if anyone needs anything similar please fill free to see me and PM or email



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum