php-general Digest 13 Nov 2005 05:02:07 -0000 Issue 3791

Topics (messages 225674 through 225691):

Re: php session in ie
        225674 by: sunaram patir
        225675 by: adriano ghezzi
        225677 by: sunaram patir

Re: emailing MySQL list not working
        225676 by: Bruce Gilbert
        225681 by: Jasper Bryant-Greene
        225688 by: Marco Kaiser

Re: Recommendations for the Zend PHP Certification
        225678 by: Marco Kaiser
        225691 by: Gustavo Narea

php/linux user groups in the east bay area..
        225679 by: bruce
        225680 by: Esteamedpw.aol.com
        225682 by: bruce

Printing to a buffer
        225683 by: Todd Cary
        225684 by: Jasper Bryant-Greene
        225685 by: php-mail
        225686 by: Todd Cary
        225687 by: Todd Cary
        225689 by: Jasper Bryant-Greene

Seg fault in PHP 5.0.5
        225690 by: Dean Householder

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
On 11/12/05, James Benson <[EMAIL PROTECTED]> wrote:
>
>
> sunaram patir wrote:
> > Hi, i am having problem with internet explorer. i am working on
> > $_SESSION['myurl']=$_SERVER['PHP_SELF'];
> > if(!isset($_SESSION['student_username']) &&
> > !isset($_SESSION['student_password']))
> >          header("Location: login.php");
> > ?>
>
>
> You should use an absolute path for the header redirection,
>
> header("Location: http://example.com/login.php";);
>
thanks, but it doesn't still solve the problem.

--- End Message ---
--- Begin Message ---
to be redirected to login must have at least one of (
if(!isset($_SESSION['student_username']) &&
!isset($_SESSION['student_password'])) )

not set, which one (or both) fail under i.e. ???

hth

ag.





2005/11/11, sunaram patir <[EMAIL PROTECTED]>:
> Hi, i am having problem with internet explorer. i am working on a
> project on building a website where i need to keep track of the users
> i.e. i use a login system in there in short. with the following code i
> check whether the user is logged in or not.
> <?php
> session_start();
>
> $_SESSION['myurl']=$_SERVER['PHP_SELF'];
> if(!isset($_SESSION['student_username']) &&
> !isset($_SESSION['student_password']))
>        header("Location: login.php");
> ?>
>
> if the user is not logged in, it redirects to the login page login.php
> as is shown in the above code. now the user is allowed to log in
> through the following code:
>
>
> <?php
> session_cache_limiter('private_no_expire');
> session_set_cookie_params(0,"/","schools.zenrays.com");
> session_start();
>
>
>
> if(isset($_POST['submit'])){
>  include("../database.inc");
>  $login=trim($_POST['login']);
>  $pass=trim($_POST['pass']);
>  $Effectivelogin=strtoupper($login);
>  $auth=false;
>  $connection=mysql_connect($host,$user,$password);
>  mysql_select_db($database,$connection);
>  $query="SELECT password FROM students WHERE userID='$Effectivelogin'";
>  $result=mysql_query($query);
>  if(mysql_num_rows($result)){
>       while($row=mysql_fetch_array($result))
>  {
>
>       if($row[0]!=$pass)
>             echo ("Wrong Username/Password!");
>        else
>              $auth=true;
>  }
>  }
>
>
>  if($auth){
>        $_SESSION["student_username"]=$Effectivelogin;
>        $_SESSION["student_password"]=$pass;
>        if(isset($_SESSION['myurl']))
>           header("Location: http://schools.zenrays.com".$_SESSION['myurl']);
>        else
>           header("Location: http://schools.zenrays.com/students";);
>
>  }
>
>
> }
> ?>
> <html>
> <head>
> <title>User Authentication</title>
> </head>
> <body>
> <form method="post">
> LoginID:
> <input type="text" name="login"><br>
> Password:
> <input type="password" name="pass"><br>
> <input type="submit" name="submit" value="Login">
> </form>
>
>
> </body>
>
>
> </html>
>
> then the user is redirected back to the page he visited. it workd fine
> in firefox and msn explorer. in internet explorer, when i visit to a
> link in any page it asks for the login details again. could anyone
> please help me out?!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On 11/12/05, adriano ghezzi <[EMAIL PROTECTED]> wrote:
> to be redirected to login must have at least one of (
> if(!isset($_SESSION['student_username']) &&
> !isset($_SESSION['student_password'])) )
>
> not set, which one (or both) fail under i.e. ???
>
> hth
>
if both of them aren't set, the user is redirected. but it doesnot
relate to not working in ie or i don't understand what u are meaning.

--- End Message ---
--- Begin Message ---
        I don't suppose you meant like this : $headers = "From: 
$sender";("\r\n").
or is it without the ( )?

thanks

On 11/12/05, Marco Kaiser <[EMAIL PROTECTED]> wrote:
> Hi,
>
> try to add in your $headers linebreaks. ("\r\n").
>
> -- Marco
>
> >         $headers = "From: $sender";
> >         $headers .= "Reply-To: $reply_to";
> >         $headers .= "Return-Path: $return_path";
> >         $headers .= "X-Sender: $x_sender";
> >         $headers .= "X-Mailer: PHP4\n"; //mailer
> >         $headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
> >         $headers .= "Mime-Version:1.0\n Content-Type: text/plain;
> > charset=\"iso-8859-1\nContent-Transfer-Encoding: 8bit\n";
>


--
::Bruce::

--- End Message ---
--- Begin Message ---
Bruce Gilbert wrote:
        I don't suppose you meant like this : $headers = "From: 
$sender";("\r\n").
or is it without the ( )?

I think you should read up on some basic PHP syntax (the manual is your friend. He meant like this:

$headers = "From: $sender\r\n";
$headers .= "Reply-To: $reply_to\r\n";

and so on. If the headers are all on one line then the MTAs and mail clients have no way of telling them apart.

Jasper

On 11/12/05, Marco Kaiser <[EMAIL PROTECTED]> wrote:
Hi,

try to add in your $headers linebreaks. ("\r\n").

-- Marco

        $headers = "From: $sender";
        $headers .= "Reply-To: $reply_to";
        $headers .= "Return-Path: $return_path";
        $headers .= "X-Sender: $x_sender";
        $headers .= "X-Mailer: PHP4\n"; //mailer
        $headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
        $headers .= "Mime-Version:1.0\n Content-Type: text/plain;
charset=\"iso-8859-1\nContent-Transfer-Encoding: 8bit\n";


--
::Bruce::


--- End Message ---
--- Begin Message ---
Hi Bruce,

first, there are just \n in your last header assignment. I think you
should test it a bit mir,
Try to send mails without the optional header. If this not work ask here again.

-- Marco

> >>>         $headers .= "Mime-Version:1.0\n Content-Type: text/plain;
> >>> charset=\"iso-8859-1\nContent-Transfer-Encoding: 8bit\n";

--- End Message ---
--- Begin Message ---
Hi Gustavo,

> I want to take the ZPC test the next year and I am going to buy these books:
>    - Zend PHP Certification Study Guide.
>    - Zend PHP Certification Practice Test Book.

Take the Study Guide from php-architect. Its better than the Zend book.

> By the way, my skills are oriented to LAMP and according to what I read
> on the ZPC's FAQs that is not good. I must know the Standard SQL, not
> only MySQL. So, I have these questions:
>    - Where can I find the Standard SQL? I've been googling for it, but I
> couldn't find it.
>    - AFAIK, there are 3 versions of the Standard SQL (1993, 1999 and
> 2003), but, Which one am I going to need for this test?
>    - Should I learn to use another HTTP server?

i'm certified and i can say, its not necessary that you learn the ANSI
SQL Standard.
Take your book start reading and i think you will pass the exam.

--
Marco Kaiser

--- End Message ---
--- Begin Message ---
Hello, Marco.

Thanks for your response!

Marco Kaiser wrote:
Hi Gustavo,
I want to take the ZPC test the next year and I am going to buy these books:
  - Zend PHP Certification Study Guide.
  - Zend PHP Certification Practice Test Book.
Take the Study Guide from php-architect. Its better than the Zend book.

Aren't they the same books?

I mean, I see the same authors, the same titles and the same pictures.

Cheers.

--
Gustavo Narea.
PHP Documentation - Spanish Translation Team.
Valencia, Venezuela.

--- End Message ---
--- Begin Message ---
hi..

anybody know of any php/linux/apache user groups in the east bay
(dublin/pleasanton/san ramon/etc...) area?

need to join one to find other like minded php/linux guys who are into
developing..

thanks

-bruce

--- End Message ---
--- Begin Message ---
Check the PHP.net site or PHPClasses.org -- they both have a good list of  
these groups.

--- End Message ---
--- Begin Message ---
let me ask the question in a different way?

is there anyone in the bay area (dublin/san jose/santa clara/san
francisco/etc...) who would like to get together to talk code/work on
projects/etc...

checked out the existing user groups.. they look rather empty...

-bruce


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 12, 2005 12:58 PM
To: [EMAIL PROTECTED]; [email protected]
Subject: Re: [PHP] php/linux user groups in the east bay area..


Check the PHP.net site or PHPClasses.org -- they both have a good list of
these groups.

--- End Message ---
--- Begin Message --- My client's new shared server does not allow printing to a file, so I want my print statement to print to a buffer, then I'll send it to the user via Headers. This does not work since "print" does no go to the buffer, or at least appears not to: I get the errors from the header statements;

<?
  ob_start;
  print "This is a test<bf>";
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header("Content-type: application/text");
  header("Content-Length: $len");
  header("Content-Disposition: inline; filename=Sfyc.html");
  print($buf);
?>

Todd

--- End Message ---
--- Begin Message ---
Todd Cary wrote:
My client's new shared server does not allow printing to a file, so I want my print statement to print to a buffer, then I'll send it to the user via Headers. This does not work since "print" does no go to the buffer, or at least appears not to: I get the errors from the header statements;

<?
  ob_start;

You're missing some parentheses on the ob_start function. I think you meant to write:

ob_start();

  print "This is a test<bf>";

You probably meant <br> in that string too.

  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header("Content-type: application/text");

application/text isn't a MIME-Type, is it? Do you mean text/plain?

  header("Content-Length: $len");
  header("Content-Disposition: inline; filename=Sfyc.html");
  print($buf);
?>

Todd


--- End Message ---
--- Begin Message ---

-----Original Message-----
From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] 
[snip]
application/text isn't a MIME-Type, is it? Do you mean text/plain?
[/snip]

Or maybe text/html?

Sent: 12 November 2005 22:46
To: Todd Cary
Cc: [email protected]
Subject: Re: [PHP] Printing to a buffer

Todd Cary wrote:
> My client's new shared server does not allow printing to a file, so I 
> want my print statement to print to a buffer, then I'll send it to the 
> user via Headers.  This does not work since "print" does no go to the 
> buffer, or at least appears not to: I get the errors from the header 
> statements;
> 
> <?
>   ob_start;

You're missing some parentheses on the ob_start function. I think you 
meant to write:

ob_start();

>   print "This is a test<bf>";

You probably meant <br> in that string too.

>   $buf = ob_get_contents();
>   $len = strlen($buf);
>   ob_end_clean();
>   header("Content-type: application/text");

application/text isn't a MIME-Type, is it? Do you mean text/plain?

>   header("Content-Length: $len");
>   header("Content-Disposition: inline; filename=Sfyc.html");
>   print($buf);
> ?>
> 
> Todd
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__________ NOD32 1.1284 (20051111) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com

--- End Message ---
--- Begin Message ---
Yup!  It was the missing parentheses!  Works as planned.

Many thanks....

The "application/text" gives the user the ability; "text/plain" does not seem to do that. I just tried "application/text" since I use "application/pdf" for other applications.

Todd

Jasper Bryant-Greene wrote:
Todd Cary wrote:

My client's new shared server does not allow printing to a file, so I want my print statement to print to a buffer, then I'll send it to the user via Headers. This does not work since "print" does no go to the buffer, or at least appears not to: I get the errors from the header statements;

<?
  ob_start;


You're missing some parentheses on the ob_start function. I think you meant to write:

ob_start();

  print "This is a test<bf>";


You probably meant <br> in that string too.

  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header("Content-type: application/text");


application/text isn't a MIME-Type, is it? Do you mean text/plain?

  header("Content-Length: $len");
  header("Content-Disposition: inline; filename=Sfyc.html");
  print($buf);
?>

Todd


--- End Message ---
--- Begin Message ---
Yup!  It was the missing parentheses!  Works as planned.

Many thanks....

The "application/text" gives the user the ability; "text/plain" does not seem to do that. I just tried "application/text" since I use "application/pdf" for other applications.

Todd

Jasper Bryant-Greene wrote:
Todd Cary wrote:

My client's new shared server does not allow printing to a file, so I want my print statement to print to a buffer, then I'll send it to the user via Headers. This does not work since "print" does no go to the buffer, or at least appears not to: I get the errors from the header statements;

<?
  ob_start;


You're missing some parentheses on the ob_start function. I think you meant to write:

ob_start();

  print "This is a test<bf>";


You probably meant <br> in that string too.

  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header("Content-type: application/text");


application/text isn't a MIME-Type, is it? Do you mean text/plain?

  header("Content-Length: $len");
  header("Content-Disposition: inline; filename=Sfyc.html");
  print($buf);
?>

Todd


--- End Message ---
--- Begin Message ---
Todd Cary wrote:
Yup!  It was the missing parentheses!  Works as planned.

Many thanks....

The "application/text" gives the user the ability; "text/plain" does not

The ability to...?

seem to do that. I just tried "application/text" since I use "application/pdf" for other applications.

Whatever it's giving the user the ability to do, it's probably because the browser doesn't recognise the (invalid) MIME-Type.
--- End Message ---
--- Begin Message --- Has anyone had any problems with PHP 5.0.5 getting seg faults when trying to replace extended ascii characters?

I'm trying to replace the following characters: Â °, with " degrees". I am able to detect these characters in the string, but when I try replacing it, PHP seg faults. I've tried both str_replace() as well as preg_replace(). I've tried replacing the characters by pasting them directly, using chr(176) & chr(194), and even \xC2 and \xB0.

I get the Segmentation fault both through Apache as well as CLI (command line interface) consistently.

Any ideas?

Thanks,
Dean Householder

--- End Message ---

Reply via email to