5, December 2008

despertly seeking help :(( - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: despertly seeking help :((
« previous next »
Pages: [1] Print

Author Topic: despertly seeking help :((  (Read 1034 times)
Kill the googlebot
*
Gender: Female
Posts: 6
40 credits
Members referred : 0



« on: Jan 14, 2007, 03:30:25 PM »

hey every body

well ... I think it's way not about the class ... but I really need help with this Sad
I need to know what the right code to validate the username and password with session for imap connection ,
see I could connect to the imap but only when I define my username and password , and I wanna to any one in the same server I defined can log in Sad
I have a class project and I can't right the right session code , can any body help !!
there is no db needed

thanx any way Smiley  
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6486
39748 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Jan 14, 2007, 05:06:51 PM »

Maybe this?

Code:
<?php
$mbox 
imap_open("{your.imap.host}""username""password"OP_HALFOPEN)
     or die(
"can't connect: " imap_last_error());

$list imap_getmailboxes($mbox"{your.imap.host}""*");
if (
is_array($list)) {
 
reset($list);
 while (list(
$key$val) = each($list)) {
   echo 
"($key) ";
   echo 
imap_utf7_decode($val->name) . ",";
   echo 
"'" $val->delimiter "',";
   echo 
$val->attributes "<br />\n";
 }
} else {
 echo 
"imap_getmailboxes failed: " imap_last_error() . "\n";
}

imap_close($mbox);
?>


check the php manual, its has a lot of information about IMAP


Last blog : Just a better Internet portal provided by Google
Kill the googlebot
*
Gender: Female
Posts: 6
40 credits
Members referred : 0



« Reply #2 on: Jan 14, 2007, 07:25:18 PM »

it didn't work .. Sad(
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6486
39748 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Jan 14, 2007, 08:03:50 PM »

it didn't work .. Sad(
do you get an error?


Last blog : Just a better Internet portal provided by Google
Kill the googlebot
*
Gender: Female
Posts: 6
40 credits
Members referred : 0



« Reply #4 on: Jan 14, 2007, 08:57:07 PM »

actually I'm getting this warning each time
Warning: imap_open() [function.imap-open]: Couldn't open stream { server name and bath }
Sad
and this without making any session , cuz back then when I was tryin' to make session I was gettin' the same warning over and over no matter what the code is Sad
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6486
39748 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Jan 14, 2007, 11:32:41 PM »

actually I'm getting this warning each time
 Warning: imap_open() [function.imap-open]: Couldn't open stream { server name and bath }
 Sad
and this without making any session , cuz back then when I was tryin' to make session I was gettin' the same warning over and over no matter what the code is Sad
what is the code you're using? (post it here)


Last blog : Just a better Internet portal provided by Google
Kill the googlebot
*
Gender: Female
Posts: 6
40 credits
Members referred : 0



« Reply #6 on: Jan 15, 2007, 01:00:31 PM »

well ,, I used imap-open with define my username and pass and it worked , but I don't wanna connect with my username and pass , I wanna any student be able to connect
I used session code for that and I got that warning msg

<?

// session
session_start();

// convert username and password from _POST or _SESSION

if($_POST){
  $_SESSION['user']=$_POST["user"];
  $_SESSION['pass']=$_POST["pass"]; 
}

// query for a user/pass match
$result=mysql_query("select * from users
  where user='" . $_SESSION['user'] . "' and pass='" . $_SESSION['pass'] . "'");

// retrieve number of rows resulted
$num=mysql_num_rows($result);

?>


Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6486
39748 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Jan 15, 2007, 01:03:42 PM »

well ,, I used imap-open with define my username and pass and it worked , but I don't wanna connect with my username and pass , I wanna any student be able to connect
I used session code for that and I got that warning msg

<?

// session
session_start();

// convert username and password from _POST or _SESSION

if($_POST){
  $_SESSION['user']=$_POST["user"];
  $_SESSION['pass']=$_POST["pass"]; 
}

// query for a user/pass match
$result=mysql_query("select * from users
  where user='" . $_SESSION['user'] . "' and pass='" . $_SESSION['pass'] . "'");

// retrieve number of rows resulted
$num=mysql_num_rows($result);

?>




that should work just enter the session var into the arguments of imap_open

don't forget session_start() at the begin of the script


Last blog : Just a better Internet portal provided by Google
Kill the googlebot
*
Gender: Female
Posts: 6
40 credits
Members referred : 0



« Reply #8 on: Jan 15, 2007, 08:47:42 PM »

ok .... I'll keep tryin

Thanx Olaf
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=5611
Tags : php session Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: despertly seeking help :((
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Dec 05, 2008, 06:16:26 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.995
Total Topics: 7.685
Total Members: 4.468
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: sansthaa

25 Guests, 3 Users online :

10 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.