OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 1 Jul 2003 15:41:21 -0000 Issue 2150

php-general-digest-helplists.php.net
Date: Tue Jul 01 2003 - 10:41:21 CDT


php-general Digest 1 Jul 2003 15:41:21 -0000 Issue 2150

Topics (messages 153506 through 153573):

Re: php-general as REPLY TO
        153506 by: Rasmus Lerdorf
        153525 by: Ford, Mike [LSS]
        153533 by: Jason Wong
        153551 by: Ford, Mike [LSS]
        153572 by: Jim Lucas

Re: Small Error in Login Script
        153507 by: Shivanischal A

Re: need help w/ sql query - update and select at once
        153508 by: Shivanischal A
        153509 by: Shivanischal A

Re: Refreshing
        153510 by: Tom Rogers
        153511 by: James Hicks
        153515 by: Stephen

Re: IsSet() and $_SESSION - BUG?
        153512 by: John Manko
        153514 by: Jason Wong

Re: Forms
        153513 by: Jason Wong

Subtracting dates in php
        153516 by: Mike Mannakee
        153518 by: Shivanischal A
        153534 by: David Otton

Zend
        153517 by: Gladk

Re: Installation for OS X
        153519 by: Joel Rees
        153535 by: Didier McGillis
        153539 by: Jim McNeely

HTTP Authentication does not work
        153520 by: Peter Holmberg

multi line regular expression?
        153521 by: Tim
        153545 by: Adam i Agnieszka Gasiorowski FNORD

Re: PHP Programmer Needed!
        153522 by: John Coggeshall

Re: MySQL Query
        153523 by: Ford, Mike [LSS]

Re: list() with unknown number of values
        153524 by: Ford, Mike [LSS]

ereg_replace
        153526 by: alexander sundli
        153559 by: Dean E. Weimer

php - printer button
        153527 by: nasar.digilib.umm.ac.id
        153530 by: Dore van Hoorn
        153573 by: nasar.digilib.umm.ac.id

Re: Query for MySQL
        153528 by: David Robley

Form 2 PDF 2 Form
        153529 by: Petre Agenbag
        153531 by: Shivanischal A
        153536 by: Petre Agenbag
        153537 by: Sævar Öfjörð
        153540 by: Shivanischal A
        153541 by: Cesar Cordovez
        153542 by: Kristin Schesonka
        153547 by: Petre Agenbag
        153552 by: Kristin Schesonka
        153560 by: Petre Agenbag
        153571 by: Greg Beaver

GetImageSize-craziness
        153532 by: Bernhard Döbler

Re: Yahoo Stuff.
        153538 by: Mario Oberrauch

Re: PHP Web Based File Management and Security
        153543 by: joel boonstra

Re: web site security: how to hide login info for mysql-connection
        153544 by: Mark

Regular Expression
        153546 by: Dan Joseph
        153548 by: Jay Blanchard
        153549 by: Dan Joseph
        153553 by: Jason Wong
        153556 by: Dan Joseph
        153557 by: Jay Blanchard
        153564 by: Dan Joseph

Basic Auth question
        153550 by: Dave Carrera
        153566 by: ed.homes2see.com

fwrite() question
        153554 by: Adam Williams
        153555 by: Adrian
        153558 by: Adam Williams

HTMLENTITES(); & the pound sign
        153561 by: bob pilly

PHP on one box, Apache on another?
        153562 by: Jay Blanchard
        153568 by: Miles Thompson
        153569 by: Dan Joseph
        153570 by: Jay Blanchard

File upload: type and size question
        153563 by: Dani Matielo
        153565 by: Mário Gamito

Error in doc 'Changes in PHP 5/Zend Engine 2.0?'
        153567 by: Alan D'Angelo - Media Beat Information Technology

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


On Mon, 30 Jun 2003, John Manko wrote:

> >Keep in mind that many people post without being subscribed to the list,
>
> This is false. In fact, I tried sending a message to the list from another account that wasn't subscribed, and I got a reply stating the following:
>
> Because you are not subscribed to "php-generallists.php.net"
> using the email address "jmankomonkeynet.org", your message
> has been held until you can confirm that you are a real person sending
> mail.

Correct, and once you confirm your email goes through whether you are
subscribed or not. Sheez.

-Rasmus

attached mail follows:


> -----Original Message-----
> From: Derick Rethans [mailto:derickphp.net]
> Sent: 30 June 2003 22:47
>
> On Mon, 30 Jun 2003, Doug Essinger-Hileman wrote:
>
> > Having said this, I suspect that you and I will continue to
> disagree,
> > which is perfectly okay. If this list changes the default I will be
> > happy. If it doesn't, I will learn to adjust. One request I make is
> > that folk, including you, Derick, refrain from sending
> replies to my
> > email to both the list *and* my personal inbox. There's no need to
> > waste the bandwidth.
>
> You'll have to learn to adjust then I guess. And do those 2k really
> matter? Come on... Just get a good mailer that defaults to
> "Reply-All"
> (like, mutt, pine, pcpine)

Some of us don't have the choice -- we work in a corporate or institutional environment where the decision is made centrally. (Hence M$ Outlook 98 here!!!)

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


On Tuesday 01 July 2003 18:08, Ford, Mike [LSS] wrote:

> > You'll have to learn to adjust then I guess. And do those 2k really
> > matter? Come on... Just get a good mailer that defaults to
> > "Reply-All"
> > (like, mutt, pine, pcpine)
>
> Some of us don't have the choice -- we work in a corporate or institutional
> environment where the decision is made centrally. (Hence M$ Outlook 98
> here!!!)

If your organisation see fit to use to such broken rubbish when there are much
better alternatives available (eg The Bat!) then you just have to put up --
or you can choose to work in a better environment ;-)

M$ has already done enough harm to standards, netiquette & best practices,
with all the crap settings that they put into Outlook [Express] (like having
Word/HTML as the default message format, top posting, their tnef format for
attachments etc.)

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
grasshopotomaus:
        A creature that can leap to tremendous heights... once.
*/

attached mail follows:


> -----Original Message-----
> From: Jason Wong [mailto:php-generalgremlins.biz]
> Sent: 01 July 2003 12:55
>
> On Tuesday 01 July 2003 18:08, Ford, Mike [LSS] wrote:
>

Watch your quoting attributions -- I didn't say this first bit, Derick did:
 
> > > You'll have to learn to adjust then I guess. And do those
> 2k really
> > > matter? Come on... Just get a good mailer that defaults to
> > > "Reply-All"
> > > (like, mutt, pine, pcpine)
> >
> > Some of us don't have the choice -- we work in a corporate
> or institutional
> > environment where the decision is made centrally. (Hence
> M$ Outlook 98
> > here!!!)
>
> If your organisation see fit to use to such broken rubbish
> when there are much
> better alternatives available (eg The Bat!) then you just
> have to put up --
> or you can choose to work in a better environment ;-)
>
> M$ has already done enough harm to standards, netiquette &
> best practices,
> with all the crap settings that they put into Outlook
> [Express] (like having
> Word/HTML as the default message format, top posting, their
> tnef format for
> attachments etc.)

Oh, I wouldn't argue with you -- and I do what I can to overcome those
limitations (no top posting here!) -- but, in my current position, I have no
choice about what I use as an email client in the first place. I just
thought Derick's response was a bit cavalier, which prompted me to want to
make the point that not everyone actually *does* have the choice.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


You could signup with a company like yahoo.com or hotmail or bend.com and
you could then have a web based email service.

You ALWAYS have choices... :)

Jim Lucas
----- Original Message -----
From: "Ford, Mike [LSS]" <M.Fordlmu.ac.uk>
To: "'Derick Rethans'" <derickphp.net>
Cc: <php-generallists.php.net>
Sent: Tuesday, July 01, 2003 3:08 AM
Subject: RE: [PHP] php-general as REPLY TO

> > -----Original Message-----
> > From: Derick Rethans [mailto:derickphp.net]
> > Sent: 30 June 2003 22:47
> >
> > On Mon, 30 Jun 2003, Doug Essinger-Hileman wrote:
> >
> > > Having said this, I suspect that you and I will continue to
> > disagree,
> > > which is perfectly okay. If this list changes the default I will be
> > > happy. If it doesn't, I will learn to adjust. One request I make is
> > > that folk, including you, Derick, refrain from sending
> > replies to my
> > > email to both the list *and* my personal inbox. There's no need to
> > > waste the bandwidth.
> >
> > You'll have to learn to adjust then I guess. And do those 2k really
> > matter? Come on... Just get a good mailer that defaults to
> > "Reply-All"
> > (like, mutt, pine, pcpine)
>
> Some of us don't have the choice -- we work in a corporate or
institutional environment where the decision is made centrally. (Hence M$
Outlook 98 here!!!)
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS, LS6 3QS, United Kingdom
> Email: m.fordlmu.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


hi,

this is what i found...
----------------------------------

<?
session_start();

error_reporting(E_ALL);

if ( (isset($_POST['validuser'])) && (isset($_POST['password'])) ) {

   mysql_connect( 'localhost', 'abc', 'pwd' ) or die ( 'Unable to connect to
server.' );

   // Select database on MySQL server
     mysql_select_db( 'masterstream' ) or die ( 'Unable to select
database' );

   // Formulate the query

     $sql1 = "SELECT * from admin where admin.username = '$_POST[validuser]'
AND admin.password = '$_POST[password]'";

     $result1 = mysql_query($sql1) or die ( 'Database Error has occured.');

$num_results = mysql_num_rows($result1);

if ($num_results == 1 ) {

     echo "Success!<br>";
        if(!isset($_SESSION['validuser']))
           $_SESSION['validuser'] = $_POST['validuser'];
         }

   else{
         echo "Please try again later<br>";
       }
   }

?>

<html>
<head>
<title>ADMIN-LOGIN</title>
</head>

<?

if (isset($_SESSION['validuser']))
   {
   echo "You are already logged into the system !!!";
    }

else {
    echo "test";
}

echo "
<body bgcolor=\"aaaaaa\">
<form name=\"form1\" method=\"post\" action=\"ADMIN-LOGIN.php\">
   <table width=\"713\" height=\"132\" border=\"1\" cellpadding=\"1\"
cellspacing=\"1\" bgcolor=\"#FFFFFF\">
     <tr>
       <td width=\"787\" height=\"119\"> <table width=\"707\"
border=\"1\" cellspacing=\"3\" cellpadding=\"2\">
           <tr bgcolor=\"99ccff\">
             <td colspan=\"2\"><div align=\"center\"><strong><font
color=\"#FFFFFF\" size=\"2\" face=\"Verdana, Arial, Helvetica,
sans-serif\">Please
                 enter your Username and Password
</font></strong></div></td>
           </tr>
           <tr bgcolor=\"#E7E7E7\">
             <td width=\"214\"><strong><font color=\"#666666\"
size=\"1\" face=\"Verdana, Arial, Helvetica,
sans-serif\">Login</font></strong></td>
             <td width=\"549\"><font size=\"1\">
               <input name=\"validuser\" type=\"text\" id=\"validuser2\">
               </font></td>
           </tr>
           <tr bgcolor=\"#E7E7E7\">
             <td><strong><font color=\"#666666\" size=\"1\"
face=\"Verdana, Arial, Helvetica,
sans-serif\">Password</font></strong></td>
             <td><font size=\"1\">
               <input name=\"password\" type=\"password\"
id=\"password\">
               </font></td>
           </tr>
           <tr bgcolor=\"#E7E7E7\">
             <td height=\"24\" colspan=\"2\"><div align=\"center\">
                 <input type=\"submit\" name=\"Submit\" value=\"Submit\">
               </div></td>
           </tr>
         </table></td>
     </tr>
   </table>
</form>
";
?>

---------------------------------
regards,
-shiva

"Pushpinder Singh Garcha" <pgarchaadelphia.net> wrote in message
news:40A318AE-AB11-11D7-9FC9-000393874598adelphia.net...
Hello All,

  I am trying to setup a simple login script on my development server
running Mac OS Jaguar. I keep getting an error

Parse error: parse error in /Users/psgarcha/Sites/CRM/ADMIN-LOGIN.php
on line 2. I am at a complete loss !

Here is the source code. Please help.

-------------------------------------------------

<?
session_start();

error_reporting(E_ALL);

if ( (isset($_POST['validuser'])) && (isset($_POST['password'])) ) {

   mysql_connect( 'localhost', 'abc', 'pwd' )
      or die ( 'Unable to connect to server.' );

   // Select database on MySQL server
   // mysql_select_db( 'masterstream' )
        or die ( 'Unable to select database' );

   // Formulate the query

   // $sql1 = "SELECT * from `admin` where `admin`.username =
"$_POST['validuser']" AND `admin`.password = "$_POST['password']"";

     $result1 = mysql_query($sql1)
         or die ( 'Database Error has occured.');

$num_results = mysql_num_rows($result1);

if ($num_results == 1 ) {

     echo "Success!<br>";
        if(!isset($_SESSION['validuser']))
           $_SESSION['validuser'] = $_POST['validuser'];
         }

   else{
         echo "Please try again later<br>";
       }
   }

?>

<html>
<head>
<title>ADMIN-LOGIN</title>
</head>

<?

if (isset($_SESSION['validuser']))
   {
   echo "You are already logged into the system !!!";
    }

else {
    echo "test";
}

echo "
<body bgcolor=\"aaaaaa\">
<form name=\"form1\" method=\"post\" action=\"ADMIN-LOGIN.php\">
   <table width=\"713\" height=\"132\" border=\"1\" cellpadding=\"1\"
cellspacing=\"1\" bgcolor=\"#FFFFFF\">
     <tr>
       <td width=\"787\" height=\"119\"> <table width=\"707\"
border=\"1\" cellspacing=\"3\" cellpadding=\"2\">
           <tr bgcolor=\"99ccff\">
             <td colspan=\"2\"><div align=\"center\"><strong><font
color=\"#FFFFFF\" size=\"2\" face=\"Verdana, Arial, Helvetica,
sans-serif\">Please
                 enter your Username and Password
</font></strong></div></td>
           </tr>
           <tr bgcolor=\"#E7E7E7\">
             <td width=\"214\"><strong><font color=\"#666666\"
size=\"1\" face=\"Verdana, Arial, Helvetica,
sans-serif\">Login</font></strong></td>
             <td width=\"549\"><font size=\"1\">
               <input name=\"validuser\" type=\"text\" id=\"validuser2\">
               </font></td>
           </tr>
           <tr bgcolor=\"#E7E7E7\">
             <td><strong><font color=\"#666666\" size=\"1\"
face=\"Verdana, Arial, Helvetica,
sans-serif\">Password</font></strong></td>
             <td><font size=\"1\">
               <input name=\"password\" type=\"password\"
id=\"password\">
               </font></td>
           </tr>
           <tr bgcolor=\"#E7E7E7\">
             <td height=\"24\" colspan=\"2\"><div align=\"center\">
                 <input type=\"submit\" name=\"Submit\" value=\"Submit\">
               </div></td>
           </tr>
         </table></td>
     </tr>
   </table>
</form>
";
?>

</body>
</html>

Thanks in advance.
Pushpinder

attached mail follows:


you probably cant ge this to work in PHP. try creating a temporary table

-shiva

<r-militantenorthwestern.edu> wrote in message
news:200307010232.h612Wgmq016789merle.it.northwestern.edu...
> hi i'm trying to get this sql query to work, i'm trying to update and
> select at the same time, i'm not even sure if this is even possible
>
> update db.tablename set field1='yes' where (select * from
> db.tablename,db.tablename2 where
db.tablename.userid=db.tablename2.userid);
>
> basically i have a column called 'userid'. this column exists in both
> tablename, and tablename2. where the value of userid in tablename is
> equal to the value of userid in tablename2, i'd like to set the value of
> field1 to 'yes'.
>
> can this be done from the command line? or am i better off writing
> another php page to accomplish this?
>
> thanks again
> redmond
>
>

attached mail follows:


you probably cant ge this to work in MySQL. try creating a temporary table

"Shivanischal A" <shivansubexgroup.com> wrote in message
news:20030701040837.66624.qmailpb1.pair.com...
> you probably cant ge this to work in PHP. try creating a temporary table
>
> -shiva
>
>
> <r-militantenorthwestern.edu> wrote in message
> news:200307010232.h612Wgmq016789merle.it.northwestern.edu...
> > hi i'm trying to get this sql query to work, i'm trying to update and
> > select at the same time, i'm not even sure if this is even possible
> >
> > update db.tablename set field1='yes' where (select * from
> > db.tablename,db.tablename2 where
> db.tablename.userid=db.tablename2.userid);
> >
> > basically i have a column called 'userid'. this column exists in both
> > tablename, and tablename2. where the value of userid in tablename is
> > equal to the value of userid in tablename2, i'd like to set the value of
> > field1 to 'yes'.
> >
> > can this be done from the command line? or am i better off writing
> > another php page to accomplish this?
> >
> > thanks again
> > redmond
> >
> >
>
>

attached mail follows:


Hi,

Tuesday, July 1, 2003, 3:41:56 AM, you wrote:

JB> Also, this may not be PHP but...does anyone know how to stop the
JB> annoying click on Internet Explorer when something refreshes?
JB> [/snip]

 control panel -> sounds -> set select to 'none'

--
regards,
Tom

attached mail follows:


On Tuesday 01 July 2003 12:30 am, Tom Rogers wrote:
> Hi,
>
> Tuesday, July 1, 2003, 3:41:56 AM, you wrote:
>
> JB> Also, this may not be PHP but...does anyone know how to stop the
> JB> annoying click on Internet Explorer when something refreshes?
> JB> [/snip]
>
>
> control panel -> sounds -> set select to 'none'
>

I found the answer to this by doing a google search with "annoying clicking
sound in Internet Explorer". I laughed when I actually found the answer on a
page that described the sound as annoying.

In an effort to keep this list on topic, I'd like to point out that you were
correct when you said that this may not be PHP. :)

James

attached mail follows:


When I was asking this question, I wanted to do it on the server so the user
didn't have to do anything. :-P

With bubblegum in my shoe,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.

----- Original Message -----
From: "James Hicks" <freedomadvocatecox.net>
To: "Tom Rogers" <trogerskwikin.com>; "Jay Blanchard"
<jay.blanchardniicommunications.com>
Cc: "Stephen" <webmastermelchior.us>; "PHP List"
<php-generallists.php.net>
Sent: Monday, June 30, 2003 11:39 PM
Subject: Re: [PHP] Refreshing

On Tuesday 01 July 2003 12:30 am, Tom Rogers wrote:
> Hi,
>
> Tuesday, July 1, 2003, 3:41:56 AM, you wrote:
>
> JB> Also, this may not be PHP but...does anyone know how to stop the
> JB> annoying click on Internet Explorer when something refreshes?
> JB> [/snip]
>
>
> control panel -> sounds -> set select to 'none'
>

I found the answer to this by doing a google search with "annoying clicking
sound in Internet Explorer". I laughed when I actually found the answer on a
page that described the sound as annoying.

In an effort to keep this list on topic, I'd like to point out that you were
correct when you said that this may not be PHP. :)

James

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

attached mail follows:


Hello everyone. I was able to determine what was causing my problem
with session variables not being persitant across page requests. I want
to give you the full scope here, so I'm going to paste the code (and if
you have any code tips, please let me know).
I think the problem might be this (and I don't know why it should be,
but maybe you can help):
If you look at file2.php, you will see that ValidAdminLogin() contains
the "global $_SESSION;" declaration., but that's not the problem.
ValidAdminLogin() calls a function ResetSessionVariables(), which also
contains "global $_SESSION;". When "global $_SESSION;" is present in
ResetSessionVariables(), it seems as though the $_SESSION variables are
not being preserved across page requests (notice that
ResetSessionVariables() is called BEFORE the variables are set with the
real data, but it's really $_SESSION['uid'] we are concerned with.)
When I remove "global $_SESSION;" from ResetSessionVariables(), all
works fine across page request. Also note that $_SESSION['uid'] is set
when we return from the file2.php function calls as noted in the "echo"
command. So, why would a double global definintion negate $_SESSION?

------------------------------------ file1.php -------------------------
<?php
session_start();
include "include/DatabaseConnect.php";
include "include/commonphp.php";
DisableClientCaching();

if (!isset($_SESSION['uid'])) {
    if ( !ValidAdminLogin($_POST['adminid'],$_POST['adminpass'])){
forceadminlogin(); }
} elseif ( !ValidAdminSession() ){
    // Not a valid admin session - redirect
    forceadminlogin();
}
?>
<html>
<body>
<?php
//We always get a value for this, but it get lost when we leave the page.
echo $_SESSION['uid'];
?>
<br><br><br><br>
<center>
<a href='additem.php'>Add Item</a>
</center>
</body>
</html>
--------------------------------------- file2.php --------------------------
<?php

include "configvars.php";

function ValidAdminSession(){
    global $_SESSION;
    if ( isset($_SESSION['adminlogin']) ){ return 1; }
    else { return 0;}
}

function DisableClientCaching(){
    header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT"); //
Expire now
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
always modified
    header("Cache-Control: no-store, no-cache, must-revalidate"); //
HTTP/1.1
    header("Cache-Control: post-check=0, pre-check=0", false); //
HTTP/1.0
    header("Pragma: no-cache"); // HTTP/1.0
}

function ResetSessionVariables(){

    // WHEN I REMOVE THIS LINE, EVERYTHING WORKS FINE
    // global $_SESSION;
  
    $_SESSION['uid'] = session_id();
    $_SESSION['username'] = '';
    $_SESSION['adminlogin'] = False;
    $_SESSION['fname'] = '';
    $_SESSION['lname'] = '';
    $_SESSION['email'] = '';
    $_SESSION['errormesg'] = '';
}

function ValidAdminLogin($user, $pass){

    global $_SESSION;
   
    include "DatabaseConnect.php";
    mysql_connect($DBAddress,$DBUser,$DBPassword);
    mysql_select_db($DBDatabase) or die("ERROR");
    $query="SELECT * FROM adminuser WHERE user='" . $user ."' AND
pass='" . md5($pass) . "'";
    $results = mysql_query($query);
    $num = mysql_numrows($results);

    if ($num != 1){
        $returnvar = false; // Make sure the user exist, and is only
one (even though it's a unique SQL field)
    } else {
        ResetSessionVariables();

        $_SESSION['username'] = strtolower(formatformdata($user));
        $_SESSION['adminlogin'] = True;
        $_SESSION['fname'] = mysql_result($results,0,"fname");
        $_SESSION['lname'] = mysql_result($results,0,"lname");
        $_SESSION['email'] = mysql_result($results,0,"email");
        $_SESSION['uid'] = session_id();

        $returnvar = true;
    }
    return $returnvar;
    mysql_close();
}

function forceadminlogin(){
        ResetSessionVariables();
        header("Location: AdminLogin.php");
}

function formatformdata($mystring){
        return addslashes(rawurldecode(chop($mystring)));
}
?>

John Manko wrote:

> I'm having a problem with the value that isset returns on $_SESSION
> variables. For some reason, even if $_SESSION['uid'] is set, isset
> returns FALSE. Here is the code:
>
> ------ file1.php -----------
> include "file2.php";
>
> if (!isset($_SESSION["uid"])) {
> // This first time $_SESSION["uid"] is check, we should
> // end up in here. However, ValidAdminLogin (next test)
> // will set $_SESSION["uid"] so next time we will not
> // get here.
> if ( !ValidAdminLogin($_POST["adminid"],$_POST["adminpass"]))
> forceadminlogin();
>
> } elseif ( !ValidAdminSession() )
> forceadminlogin();
>
>
> // this is done to show that $_SESSION["uid"] is being set
> // but isset still returns false
> echo $_SESSION["uid"];
>
> ------ file2.php -----------
> function ValidAdminLogin($user, $pass){
>
> global $_SESSION;
>
> if (The_MYSQL_Stuff_Is_NOT_OK) return false;
> else
> {
> session_start();
>
> $_SESSION["logged"] = true;
> $_SESSION["username"] = $user;
> $_SESSION["adminlogin"] = true;
> $_SESSION["fname"] = $fname;
> $_SESSION["lname"] = $lname;
> $_SESSION["email"] = $email;
> $_SESSION["uid"] = session_id();
>
> return true;
> }
>
> mysql_close();
>
> }
>
>
>
>

attached mail follows:


On Tuesday 01 July 2003 12:46, John Manko wrote:
> Hello everyone. I was able to determine what was causing my problem
> with session variables not being persitant across page requests. I want
> to give you the full scope here, so I'm going to paste the code (and if
> you have any code tips, please let me know).
> I think the problem might be this (and I don't know why it should be,
> but maybe you can help):
> If you look at file2.php, you will see that ValidAdminLogin() contains
> the "global $_SESSION;" declaration., but that's not the problem.
> ValidAdminLogin() calls a function ResetSessionVariables(), which also
> contains "global $_SESSION;". When "global $_SESSION;" is present in
> ResetSessionVariables(), it seems as though the $_SESSION variables are
> not being preserved across page requests (notice that
> ResetSessionVariables() is called BEFORE the variables are set with the
> real data, but it's really $_SESSION['uid'] we are concerned with.)
> When I remove "global $_SESSION;" from ResetSessionVariables(), all
> works fine across page request. Also note that $_SESSION['uid'] is set
> when we return from the file2.php function calls as noted in the "echo"
> command. So, why would a double global definintion negate $_SESSION?

I've not looked at your code but the fact is that "global $_SESSION;" is
completely unnecessary. $_SESSION is a 'superglobal' that is available in all
scopes.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Marxist Law of Distribution of Wealth:
        Shortages will be divided equally among the peasants.
*/

attached mail follows:


On Tuesday 01 July 2003 06:51, Daevid Vincent wrote:
> Additionally, you could put this in a header file or the top of your page:
>
>
> reset ($_GET);
> while (list ($key, $val) = each ($_GET)) {
> //echo "$key => $val<br>\n";
> $$key = $val;
> }
>
> reset ($_POST);
> while (list ($key, $val) = each ($_POST)) {
> //echo "$key => $val<br>\n";
> $$key = $val;
> }
>
> reset ($_SESSION);
> while (list ($key, $val) = each ($_SESSION)) {
> //echo "$key => $val<br>\n";
> $$key = $val;
> }
>
> So you can leave register_globals = off and get mostly the same
> functionality (and security issues if you're worried about them too).

All that the above achieves is re-introduce the potential security problems of
having register_globals = on (!)

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
What passes for optimism is most often the effect of an intellectual error.
                -- Raymond Aron, "The Opium of the Intellectuals"
*/

attached mail follows:


Anyone know of an easy way to add or subtract dates in php the way you can
in mysql? Easier, that is, than coding the logic by hand? This seems like
a total pain.

Mike

attached mail follows:


try http://www.phpclasses.org

-shiva

"Mike Mannakee" <mikebasementideas.com> wrote in message
news:20030701052201.28311.qmailpb1.pair.com...
> Anyone know of an easy way to add or subtract dates in php the way you can
> in mysql? Easier, that is, than coding the logic by hand? This seems
like
> a total pain.
>
> Mike
>
>

attached mail follows:


On Tue, 1 Jul 2003 01:21:54 -0400, you wrote:

>Anyone know of an easy way to add or subtract dates in php the way you can
>in mysql? Easier, that is, than coding the logic by hand? This seems like
>a total pain.

Convert to Unix timestamps, do regular maths, unconvert.

attached mail follows:


Hi ALL!

Can anybody give me direct link for downloading Zend Optimizer.
I tried to do it a lot of times from the official site, but after
accepting agreement nothing happens....

Thanks

attached mail follows:


> Does anyone know of a good installation kit like FoxServ, phpTriad, etc for
> Mac OS X? I want a quick solution for adding MySQL, GD, phpLib support for
> my mac.

Well, if you're at least up to 10.1, it's already in there:

    http://www.macdevcenter.com/pub/a/mac/2002/01/04/apache_macosx_pt3.html

It's an old version though (4.1.2 in 10.2), and there's an advisory out,
so you probably want to download the latest and recompile.

Did a quick search on google and discovered there's

    http://www.phpmac.com .

Claims to be a member of the php developers' network, whatever that is.
First time I've looked at it, so I can't comment on quality. But it does
have a page on how to recompile.

Also found these old docs at Apple. The one about customizing the dev
tools for php looks interesting:

    http://developer.apple.com/internet/macosx/php.html
    http://developer.apple.com/internet/macosx/phpappledevtools.html

--
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp

attached mail follows:


Went there and couldnt find the download, did he move it.

>From: Larry E. Ullman <LarryUllmanDMCInsights.Com>
>To: Rodney Davis <rodneywincubic.com>
>CC: PHP-General <php-generallists.php.net>
>Subject: Re: [PHP] Installation for OS X
>Date: Mon, 30 Jun 2003 20:26:38 -0400
>
>>Does anyone know of a good installation kit like FoxServ, phpTriad, etc
>>for
>>Mac OS X? I want a quick solution for adding MySQL, GD, phpLib support
>>for
>>my mac.
>
>Follow Marc's instructions at http://www.entropy.ch/software/macosx/php/
>He provides a compiled version of PHP that includes MySQL support, GD, and
>much, much more.
>
>Larry
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus

attached mail follows:


check out

http://www.serverlogistics.com/software.php

great binaries for lots of open source OSX with real install packages
and such from Aaron Faby.

HTH

Jim McNeely
Envision Data
Custom, intuitive, practical software for your business.
jimenvisiondata.com
http://www.envisiondata.com

On Tuesday, July 1, 2003, at 07:01 AM, Didier McGillis wrote:

>
> Went there and couldnt find the download, did he move it.
>
>> From: Larry E. Ullman <LarryUllmanDMCInsights.Com>
>> To: Rodney Davis <rodneywincubic.com>
>> CC: PHP-General <php-generallists.php.net>
>> Subject: Re: [PHP] Installation for OS X
>> Date: Mon, 30 Jun 2003 20:26:38 -0400
>>
>>> Does anyone know of a good installation kit like FoxServ, phpTriad,
>>> etc for
>>> Mac OS X? I want a quick solution for adding MySQL, GD, phpLib
>>> support for
>>> my mac.
>>
>> Follow Marc's instructions at
>> http://www.entropy.ch/software/macosx/php/
>> He provides a compiled version of PHP that includes MySQL support,
>> GD, and much, much more.
>>
>> Larry
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


I have tried using HTTP Authentication as described in the documentation.
But it does not matter how many times i type in login/password, the popup
keeps coming back.
The server, mandrake 9.1, uses safe mode, so PHP_AUTH_USER and PHP_AUTH_PW
does not work. $_SERVER['REMOTE_USER'] does not work either.

Does anyone have any ideas?

Peter Holmberg

attached mail follows:


hi,

i have a string that contains the following:
$mystring=<<<EOS
(((TITLE)))
*color*
==
this is where the content goes
it can spreed many lines
...
==
EOS;

i'm using this line of code to try and get the content between == and ==

preg_match_all("|==(.+)==|",$mystring,$contents,PREG_PATTERN_ORDER);

now, if i do a print_r($contents); the thing is empty. but if i put the content of my original variable all on one line (== line 1 _
line 2 _ line 3 _==), it works fine. is there something to get around this one line limit?

Thanks for your time and have a nice day
Tim

attached mail follows:


Tim wrote:
 
> i have a string that contains the following:
> $mystring=<<<EOS
> (((TITLE)))
> *color*
> ==
> this is where the content goes
> it can spreed many lines
> ...
> ==
> EOS;
>
> i'm using this line of code to try and get the content between == and ==
>
> preg_match_all("|==(.+)==|",$mystring,$contents,PREG_PATTERN_ORDER);
>
> now, if i do a print_r($contents); the thing is empty. but if i put the content of my original variable all on one line (== line 1 _
> line 2 _ line 3 _==), it works fine. is there something to get around this one line limit?

 <url:http://pl.php.net/manual/en/pcre.pattern.modifiers.php>

--
Seks, seksiæ, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info / ALinkA / bOrk! * WiNoNa ) (
http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
Poznaj jej zwiewne kszta³ty... http://www.opera.com 007

attached mail follows:


I may be interested if you haven't filled the spot yet.

John

On Fri, 2003-06-27 at 02:55, Erica Ziegler-Roberts wrote:
> I am swamped with work and need a php expert who is familiar with IC-Radius
> to do the following project for me. If it can be done by Monday, I will be
> willing to pay more. You must be able to accept payment through Paypal,
> Yahoo Paydirect, or Check/Money Order. Project details are below.
>
> This is a php or cgi script that listens on the proper ports for dialup
> authentication requests and replys based on a DB either mysql or flat file
> or whatever... just like Microsofts IAS radius server..
>
> we have used this IAS but it is far to manual to be effective...hense this
> script..
>
> the radius script needs to be able to update its DB via a post to a URL or
> networked to get from the main DB to the machine to be used to run this
> script...
>
> I.e..
> ADDING...
> http://radiusserver/radius.php or
> cgi?action=add_user&method=post&radiusweb_username=ADMINUSERNAME&radiusweb_p
> assword=ADMINPASSWORD&diapupusername=DIALUPPUSERNAME&diapupuserpassword=DIAL
> UPPUSERPASSWORD
>
> DELETING..
> http://radiusserver/radius.php or
> cgi?Action=delete_user&method=post&radiusweb_username=ADMINUSERNAME&radiuswe
> b_password=ADMINPASSWORD&dialupusername=DIALUPPUSERNAME&confirm=yes
>
> The Idea is that as we add and remove customers from the main DB it will
> auto add and remove the dialup from the radius DB so customers can login or
> not respectivly..
>
> The main DB is Filemaker Pro and we have it running scripts to add and
> remove 'post a url' in this fashion to an outsourced Linux box running
> ICRADIUS..
>
> We simply want to move this setup or improve it but to run inhouse on
> Windows NT 5 machines.. running perl 5.x and Php 4.x
>
> let me know if you are unclear or need more explination on the setup...
>
> --
> Erica Ziegler-Roberts
> ezrobertsfrizzys.com
> Manager of Internet Technology
> 513-232-1689 (office)
> 513-232-1651 (fax)
> FCS (Frizzy's Computer Services)
> Customizing technology for you!
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-
John Coggeshall
john at coggeshall dot org http://www.coggeshall.org/
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

attached mail follows:


> -----Original Message-----
> From: Pushpinder Singh Garcha [mailto:pgarchaadelphia.net]
> Sent: 30 June 2003 19:10
>
> Can someone tell me what is wrong with the following querys ? I am
> pretty sure its got something to do with the quotes around $_POST[]
> variables.
>
> $sql1 = "SELECT * from `admin` where `admin`.user =
> '"$_POST['validuser']"' AND `admin`.pwd = '"$_POST['password']"'";
>
> $sql1 = "SELECT * from `admin` where user = "$_POST['validuser']" AND
> pwd = "$_POST['pass']"";

Too many quotes, not enough curly braces:

  $sql1 = "SELECT * from `admin` where user = '{$_POST['validuser']}' AND
pwd = '{$_POST['pass']}'";

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


> -----Original Message-----
> From: John Wulff [mailto:johnworcasnet.com]
> Sent: 30 June 2003 21:40
>
> I want to write a function that manipulates each piece of
> data in an array
> (except for the first). Right now I'm using list as follows from this
> array:
>
> $cdata = array(
> array("Apr-03",12747.17,23486.55,319062.24,257828.73,0.00),
> array("Sep-02",12379.46,10246.92,482295.71,618131.35,14.99)
> );
>
> foreach($cdata as $key=>$value)
> {
> list($month, $a, $b, $c, $d, $e) = $value;
> }
>
> I'd like to not have to change any of my code for an
> undertermined number of
> $a, $b, etc., etc. How do I do this?

Well, two possibilities off the top of my head:

  foreach($cdata as $key=>$value)
  {
    $n = 0;
    foreach ($value as $inner_key=>$inner_value)
    {
      if ($n++)
      {
        // do stuff with $inner_key and $inner_value
      }
    }
  }

Or:

  foreach($cdata as $key=>$value)
  {
    $date_element = array_shift($value);
    // $date_element now contains original first element of $value
    // $value now contains remaining elements

    // do whatever you want with them here

  }

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


I'm trying to replace singel line comment with empty string.

tried ereg_replace("//.+\n",'',$string); but this replaces all text after
//.

anyone now what to do?

attached mail follows:


> I'm trying to replace singel line comment with empty string.
>
> tried ereg_replace("//.+\n",'',$string); but this replaces all text after
> //.
>
> anyone now what to do?

 \n is the newline character, making the string apear to be multiple lines
see the thread "[PHP] multi line regular expression?" and see if that
helps you any.

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

--
Thanks,
  Dean E. Weimer
  http://www.dwiemer.org/
  dweimerdweimer.org

attached mail follows:


Dear all,

I have research about library automation engine in my library.
developing on PHP + MySQL
We need to develop printer utility at some module to get print out
transaction.

Can I do this utility using SUBMIT BUTTON under HTML & PHP?
how to make the php printer script?
help... please & thanks

Regard,
Nasar

attached mail follows:


This is not exactly what you've asked for, but perhaps you're able to use
it anyway. It is the PHP script I use to create a print-friendly page:
Everything between <!-- Start Print Version --> and <!-- End Print Version
--> will be part of the new page..

<?php

$stripImages = "no";

$startingpoint = "<!-- Start Print Version -->";
$endingpoint = "<!-- End Print Version -->";

error_reporting(0);

$read = fopen($HTTP_REFERER, "r") or die;

error_reporting(1);

$value = "";
while(!feof($read))
        {
        $value .= fread($read, 10000);
        }
        
fclose($read);
$start= strpos($value, "$startingpoint");
$finish= strpos($value, "$endingpoint");
$length= $finish-$start;
$value=substr($value, $start, $length);

$PHPrint = ("$value");

$PHPrint = stripslashes("$PHPrint");

echo "<style type=text/css><!-- td {font-face:arial; font size:12px; color:#000000}
a{color:#000000}--></style>";
echo "<table border=0 width=60%><tr><td>";
echo "<font face=arial size=2>";
echo $PHPrint;
echo "</td><tr></table>";
flush ();
?>

>-- Oorspronkelijk bericht --
>Date: Tue, 1 Jul 2003 18:30:54 +0700 (WIT)
>From: nasardigilib.umm.ac.id
>To: php-generallists.php.net
>Subject: [PHP] php - printer button
>
>
>
Dear all,

I have research about library automation engine in my library.
developing on PHP + MySQL
We need to develop printer utility at some module to get print out
transaction.

Can I do this utility using SUBMIT BUTTON under HTML & PHP?

>ow to make the php printer script?
help... please & thanks

Regard,
Nasar

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

+++++++++++++++++++++++++++++++++++
N Dore van Hoorn
S s1000454 AlfaInformatica-RuG
E M.D.van.Hoornstudent.rug.nl
W http://www.let.rug.nl/~s1000454
+++++++++++++++++++++++++++++++++++

attached mail follows:


On Tue, 1 Jul 2003, Dore van Hoorn wrote:

> This is not exactly what you've asked for, but perhaps you're able to use
> it anyway. It is the PHP script I use to create a print-friendly page:
> Everything between <!-- Start Print Version --> and <!-- End Print Version

thanks friend..
exactly I wish print my data transaction to paper via printer driver
and this cliet running ms windows (printer this here)
and server running redhat linux (PHP on apache web server this here)

thanks again...

nasar

attached mail follows:


In article <BAY7-F62Sr7fUULExlM0001d142hotmail.com>,
codesmokerhotmail.com says...
> Question.
>
> I am looking to try and pull the last modified date out and display it. So
> lets say I have 1000 records. I want to only display the date of the last
> modified time, I dont care about the id or the name or anything. How do I
> query for that?

Given that you don't say what your table structure is and what database
you are using, I'll be generic in my response.

Try either using max() to select the greatest 'last modified date' value,
or select 'date' and order by date DESC and use LIMIT 1 to just get the
most recent date (if your db supports LIMIT)

--
Quod subigo farinam

$email =~ s/oz$/au/o;

attached mail follows:


Hi List

OK, firstly, sorry if this has been on the list before...

What I'd like to do is something like this:

I currently have an app that takes user input via a normal html form,
and then pops the content into mysql.

The problem is that lots of user complain that the submit times out due
to slow/bad connections, and hence the data gets lost.

What I was hoping to do now, was to somehow create a PDF form from the
current html form ( should generate itself on the fly ) , the PDF form
will obviously need to be downloaded to the user's PC, and will be
unique for each time they use the system, ie, I don't want to just give
them a blank template PDF, some of the values need to be
"auto-completed" and inserted into the form as "read-only", as well as a
couple of "hidden" fields with identifying values so I can know where to
pop it into the db.

The idea is that the user will now come to the point where he would
usually have filled in the html form, but instead, the app must
autogenerate a PDF with some values auto-completed and/or hidden, and
the user then downloads the pdf to his/her PC, where they continue to
fill out the pdf form.

Then, on completetion, I'd like to investigate several delivery
mechanisms, arguably, the easiest way for the users ( who are mostly
techno-peasants), is to simply e-mail the pdf as an attachment to me),
but then I will either have to create an auto-parser for the email
(prolly difficult and prone to problems with making sure the attachment
is correct etc), or I will have to then manually process the
attachments.

Either way, I would need to "feed" the pdf to my app, where the
form/hidden variables would need to be harvested from the form, and noly
then (after validation), be entered into the db.

So, simple concept, but I'm sure many pitfalls, the least being probably
that I have never done this, and don't know where to start, or even if
it's possible/advisable to follow this route.

Hence my post here...

attached mail follows:


hi,

seems u have complicated task on hand mate. cant u simply consider span the
user input over multiple pages? i mean using 2 or more form on different
pages instead of a single form on one single page. if this cant be done,
we'll think of other measures. but this is by far the most simple method

-shiva

"Petre Agenbag" <internetvsa.co.za> wrote in message
news:1057058859.4632.16.camelpetre...
> Hi List
>
> OK, firstly, sorry if this has been on the list before...
>
> What I'd like to do is something like this:
>
> I currently have an app that takes user input via a normal html form,
> and then pops the content into mysql.
>
> The problem is that lots of user complain that the submit times out due
> to slow/bad connections, and hence the data gets lost.
>
> What I was hoping to do now, was to somehow create a PDF form from the
> current html form ( should generate itself on the fly ) , the PDF form
> will obviously need to be downloaded to the user's PC, and will be
> unique for each time they use the system, ie, I don't want to just give
> them a blank template PDF, some of the values need to be
> "auto-completed" and inserted into the form as "read-only", as well as a
> couple of "hidden" fields with identifying values so I can know where to
> pop it into the db.
>
> The idea is that the user will now come to the point where he would
> usually have filled in the html form, but instead, the app must
> autogenerate a PDF with some values auto-completed and/or hidden, and
> the user then downloads the pdf to his/her PC, where they continue to
> fill out the pdf form.
>
> Then, on completetion, I'd like to investigate several delivery
> mechanisms, arguably, the easiest way for the users ( who are mostly
> techno-peasants), is to simply e-mail the pdf as an attachment to me),
> but then I will either have to create an auto-parser for the email
> (prolly difficult and prone to problems with making sure the attachment
> is correct etc), or I will have to then manually process the
> attachments.
>
> Either way, I would need to "feed" the pdf to my app, where the
> form/hidden variables would need to be harvested from the form, and noly
> then (after validation), be entered into the db.
>
> So, simple concept, but I'm sure many pitfalls, the least being probably
> that I have never done this, and don't know where to start, or even if
> it's possible/advisable to follow this route.
>
> Hence my post here...
>
>

attached mail follows:


Hi Shiva
Appreciate your input. Wrt the spanning of the form, I think, in my
situation, it would actually make things worse... You see, my suspicion
is that most of the users who are experiencing problems, have very bad
connections, many complain that they lose connectivity while they are
busy with the form ( it takes them maybe 30 min or so to fill out the
entire form ( they basically transfer the data off paper forms they have
filled out earlier while "on-site", so it's not really alot of data, but
there are a lot of fields...)
So, my fear with this approach is that they will maybe get past the
first part of the form, submit that OK, then start getting trouble with
subsequent parts, leaving me with a whole lot of partial entries in the
DB., and how do I get them to "resume" at a a later stage?
You don't understand the mindset of these people, when something goes
wrong, they'll switch off their PC's and try to start from scratch, so
it's going to be difficult to try and get them to understand the concept
of multi-part forms... I shudder to even think what will happen, or
worse, how I will be able to allow them to make corrections on a certain
part of the form once they have submit it. And sometimes, to their
defense, it's not them that want to change the details on the form, but
the subject of the form who has decided to change their name etc...

I'm not ditching this idea, I will definitely give it some more thought,
it's just at this moment, my mind is running through my original idea of
PDF forms trying to evaluate it.

Each method will have it's pro's and cons, and I'll have to go and weigh
them. I must add, I don't see "effort" as a con for a particular
solution, as long as I know it will solve the problem without adding
other cons...

Thanks again, will take it up with you again ( need some more input on
this PDF thing to get some balanced views)

PS, if you have experience with using this method, I would appreciate it
if you could let me have your "field notes" and how successfull it's
working for you.
You see, the main thing here is that I need to KNOW when someone who
says they have submitted something actually have, and that they are not
trying their luck...

  
On Tue, 2003-07-01 at 13:43, Shivanischal A wrote:
> hi,
>
> seems u have complicated task on hand mate. cant u simply consider span the
> user input over multiple pages? i mean using 2 or more form on different
> pages instead of a single form on one single page. if this cant be done,
> we'll think of other measures. but this is by far the most simple method
>
> -shiva
>
>
> "Petre Agenbag" <internetvsa.co.za> wrote in message
> news:1057058859.4632.16.camelpetre...
> > Hi List
> >
> > OK, firstly, sorry if this has been on the list before...
> >
> > What I'd like to do is something like this:
> >
> > I currently have an app that takes user input via a normal html form,
> > and then pops the content into mysql.
> >
> > The problem is that lots of user complain that the submit times out due
> > to slow/bad connections, and hence the data gets lost.
> >
> > What I was hoping to do now, was to somehow create a PDF form from the
> > current html form ( should generate itself on the fly ) , the PDF form
> > will obviously need to be downloaded to the user's PC, and will be
> > unique for each time they use the system, ie, I don't want to just give
> > them a blank template PDF, some of the values need to be
> > "auto-completed" and inserted into the form as "read-only", as well as a
> > couple of "hidden" fields with identifying values so I can know where to
> > pop it into the db.
> >
> > The idea is that the user will now come to the point where he would
> > usually have filled in the html form, but instead, the app must
> > autogenerate a PDF with some values auto-completed and/or hidden, and
> > the user then downloads the pdf to his/her PC, where they continue to
> > fill out the pdf form.
> >
> > Then, on completetion, I'd like to investigate several delivery
> > mechanisms, arguably, the easiest way for the users ( who are mostly
> > techno-peasants), is to simply e-mail the pdf as an attachment to me),
> > but then I will either have to create an auto-parser for the email
> > (prolly difficult and prone to problems with making sure the attachment
> > is correct etc), or I will have to then manually process the
> > attachments.
> >
> > Either way, I would need to "feed" the pdf to my app, where the
> > form/hidden variables would need to be harvested from the form, and noly
> > then (after validation), be entered into the db.
> >
> > So, simple concept, but I'm sure many pitfalls, the least being probably
> > that I have never done this, and don't know where to start, or even if
> > it's possible/advisable to follow this route.
> >
> > Hence my post here...
> >
> >
>
>

attached mail follows:


You could use a temp table in the database which gets cleaned up both
when the last page is completed or if there is data in it when the user
starts from scratch. Of course you would have to use sessions to
identify each user to each line of temp data. I'm not sure if this will
work, there are some problems to overcome here.

-----Original Message-----
From: Petre Agenbag [mailto:internetvsa.co.za]
Sent: 1. júlí 2003 12:01
To: Shivanischal A
Cc: php-generallists.php.net
Subject: Re: [PHP] Re: Form 2 PDF 2 Form

Hi Shiva
Appreciate your input. Wrt the spanning of the form, I think, in my
situation, it would actually make things worse... You see, my suspicion
is that most of the users who are experiencing problems, have very bad
connections, many complain that they lose connectivity while they are
busy with the form ( it takes them maybe 30 min or so to fill out the
entire form ( they basically transfer the data off paper forms they have
filled out earlier while "on-site", so it's not really alot of data, but
there are a lot of fields...)
So, my fear with this approach is that they will maybe get past the
first part of the form, submit that OK, then start getting trouble with
subsequent parts, leaving me with a whole lot of partial entries in the
DB., and how do I get them to "resume" at a a later stage?
You don't understand the mindset of these people, when something goes
wrong, they'll switch off their PC's and try to start from scratch, so
it's going to be difficult to try and get them to understand the concept
of multi-part forms... I shudder to even think what will happen, or
worse, how I will be able to allow them to make corrections on a certain
part of the form once they have submit it. And sometimes, to their
defense, it's not them that want to change the details on the form, but
the subject of the form who has decided to change their name etc...

I'm not ditching this idea, I will definitely give it some more thought,
it's just at this moment, my mind is running through my original idea of
PDF forms trying to evaluate it.

Each method will have it's pro's and cons, and I'll have to go and weigh
them. I must add, I don't see "effort" as a con for a particular
solution, as long as I know it will solve the problem without adding
other cons...

Thanks again, will take it up with you again ( need some more input on
this PDF thing to get some balanced views)

PS, if you have experience with using this method, I would appreciate it
if you could let me have your "field notes" and how successfull it's
working for you.
You see, the main thing here is that I need to KNOW when someone who
says they have submitted something actually have, and that they are not
trying their luck...

  
On Tue, 2003-07-01 at 13:43, Shivanischal A wrote:
> hi,
>
> seems u have complicated task on hand mate. cant u simply consider
span the
> user input over multiple pages? i mean using 2 or more form on
different
> pages instead of a single form on one single page. if this cant be
done,
> we'll think of other measures. but this is by far the most simple
method
>
> -shiva
>
>
> "Petre Agenbag" <internetvsa.co.za> wrote in message
> news:1057058859.4632.16.camelpetre...
> > Hi List
> >
> > OK, firstly, sorry if this has been on the list before...
> >
> > What I'd like to do is something like this:
> >
> > I currently have an app that takes user input via a normal html
form,
> > and then pops the content into mysql.
> >
> > The problem is that lots of user complain that the submit times out
due
> > to slow/bad connections, and hence the data gets lost.
> >
> > What I was hoping to do now, was to somehow create a PDF form from
the
> > current html form ( should generate itself on the fly ) , the PDF
form
> > will obviously need to be downloaded to the user's PC, and will be
> > unique for each time they use the system, ie, I don't want to just
give
> > them a blank template PDF, some of the values need to be
> > "auto-completed" and inserted into the form as "read-only", as well
as a
> > couple of "hidden" fields with identifying values so I can know
where to
> > pop it into the db.
> >
> > The idea is that the user will now come to the point where he would
> > usually have filled in the html form, but instead, the app must
> > autogenerate a PDF with some values auto-completed and/or hidden,
and
> > the user then downloads the pdf to his/her PC, where they continue
to
> > fill out the pdf form.
> >
> > Then, on completetion, I'd like to investigate several delivery
> > mechanisms, arguably, the easiest way for the users ( who are mostly
> > techno-peasants), is to simply e-mail the pdf as an attachment to
me),
> > but then I will either have to create an auto-parser for the email
> > (prolly difficult and prone to problems with making sure the
attachment
> > is correct etc), or I will have to then manually process the
> > attachments.
> >
> > Either way, I would need to "feed" the pdf to my app, where the
> > form/hidden variables would need to be harvested from the form, and
noly
> > then (after validation), be entered into the db.
> >
> > So, simple concept, but I'm sure many pitfalls, the least being
probably
> > that I have never done this, and don't know where to start, or even
if
> > it's possible/advisable to follow this route.
> >
> > Hence my post here...
> >
> >
>
>

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

attached mail follows:


Hi Petre,

I'm beginning to have second thoughts about my earlier idea too; coz that is
not solving the actual problem (u're have a slow n/w). Afterall how many KB
of form data is she/he actually sending? I'll think of other possible
solutions.

Regards,
-shiva

"Petre Agenbag" <internetvsa.co.za> wrote in message
news:1057060831.4632.35.camelpetre...
> Hi Shiva
> Appreciate your input. Wrt the spanning of the form, I think, in my
> situation, it would actually make things worse... You see, my suspicion
> is that most of the users who are experiencing problems, have very bad
> connections, many complain that they lose connectivity while they are
> busy with the form ( it takes them maybe 30 min or so to fill out the
> entire form ( they basically transfer the data off paper forms they have
> filled out earlier while "on-site", so it's not really alot of data, but
> there are a lot of fields...)
> So, my fear with this approach is that they will maybe get past the
> first part of the form, submit that OK, then start getting trouble with
> subsequent parts, leaving me with a whole lot of partial entries in the
> DB., and how do I get them to "resume" at a a later stage?
> You don't understand the mindset of these people, when something goes
> wrong, they'll switch off their PC's and try to start from scratch, so
> it's going to be difficult to try and get them to understand the concept
> of multi-part forms... I shudder to even think what will happen, or
> worse, how I will be able to allow them to make corrections on a certain
> part of the form once they have submit it. And sometimes, to their
> defense, it's not them that want to change the details on the form, but
> the subject of the form who has decided to change their name etc...
>
> I'm not ditching this idea, I will definitely give it some more thought,
> it's just at this moment, my mind is running through my original idea of
> PDF forms trying to evaluate it.
>
> Each method will have it's pro's and cons, and I'll have to go and weigh
> them. I must add, I don't see "effort" as a con for a particular
> solution, as long as I know it will solve the problem without adding
> other cons...
>
> Thanks again, will take it up with you again ( need some more input on
> this PDF thing to get some balanced views)
>
> PS, if you have experience with using this method, I would appreciate it
> if you could let me have your "field notes" and how successfull it's
> working for you.
> You see, the main thing here is that I need to KNOW when someone who
> says they have submitted something actually have, and that they are not
> trying their luck...
>
>
> On Tue, 2003-07-01 at 13:43, Shivanischal A wrote:
> > hi,
> >
> > seems u have complicated task on hand mate. cant u simply consider span
the
> > user input over multiple pages? i mean using 2 or more form on different
> > pages instead of a single form on one single page. if this cant be done,
> > we'll think of other measures. but this is by far the most simple method
> >
> > -shiva
> >
> >
> > "Petre Agenbag" <internetvsa.co.za> wrote in message
> > news:1057058859.4632.16.camelpetre...
> > > Hi List
> > >
> > > OK, firstly, sorry if this has been on the list before...
> > >
> > > What I'd like to do is something like this:
> > >
> > > I currently have an app that takes user input via a normal html form,
> > > and then pops the content into mysql.
> > >
> > > The problem is that lots of user complain that the submit times out
due
> > > to slow/bad connections, and hence the data gets lost.
> > >
> > > What I was hoping to do now, was to somehow create a PDF form from the
> > > current html form ( should generate itself on the fly ) , the PDF form
> > > will obviously need to be downloaded to the user's PC, and will be
> > > unique for each time they use the system, ie, I don't want to just
give
> > > them a blank template PDF, some of the values need to be
> > > "auto-completed" and inserted into the form as "read-only", as well as
a
> > > couple of "hidden" fields with identifying values so I can know where
to
> > > pop it into the db.
> > >
> > > The idea is that the user will now come to the point where he would
> > > usually have filled in the html form, but instead, the app must
> > > autogenerate a PDF with some values auto-completed and/or hidden, and
> > > the user then downloads the pdf to his/her PC, where they continue to
> > > fill out the pdf form.
> > >
> > > Then, on completetion, I'd like to investigate several delivery
> > > mechanisms, arguably, the easiest way for the users ( who are mostly
> > > techno-peasants), is to simply e-mail the pdf as an attachment to me),
> > > but then I will either have to create an auto-parser for the email
> > > (prolly difficult and prone to problems with making sure the
attachment
> > > is correct etc), or I will have to then manually process the
> > > attachments.
> > >
> > > Either way, I would need to "feed" the pdf to my app, where the
> > > form/hidden variables would need to be harvested from the form, and
noly
> > > then (after validation), be entered into the db.
> > >
> > > So, simple concept, but I'm sure many pitfalls, the least being
probably
> > > that I have never done this, and don't know where to start, or even if
> > > it's possible/advisable to follow this route.
> > >
> > > Hence my post here...
> > >
> > >
> >
> >
>

attached mail follows:


I had the exact same problem with a form some time ago. Definetely the
best way to do it is "spanning" the form. I don't think the temp table
will do. I did it with a session variable wich saves the info from the
form and what part of the form you are. So the user can flip between
pages in the form. Here is some code that will help you do it. (From
the top of my mind, code not tested, use it with care!)

<?php

session_register("userform");

if (!isset($userform["step"])) $userform["step"]=1;
$step = $userform["step"];
if (isset($_POST["confirm"])) {
    switch ($step):
        case "1":
                $userform["whateverfieldname"] =
$_POST["whateverfieldname"];
                // etc
                break;
        case "2":
                // more...
                break;
        case "3":
                // more...
                break;
        case "4":
                // more...
                if (This is the last step) {
                    .. save $userform to the database
                }
                break;
       }
}

print("<form>");
printf("<input type="hidden' name='step' value='%s'>", $userform["step"]);
print("<input type="hidden' name='confirm' value='1>");
print("<table>");

switch($step) {
    case "1":
       // place here the fields for step 1
        break;
    case "2":
       // place here the fields for step 2
        break;
    case "3":
       // place here the fields for step 3
        break;
    case "4":
       // place here the fields for step 4
        break;
}

print("</table>");
print("</form>");

?>

HTH

Sævar Öfjörð wrote:

>You could use a temp table in the database which gets cleaned up both
>when the last page is completed or if there is data in it when the user
>starts from scratch. Of course you would have to use sessions to
>identify each user to each line of temp data. I'm not sure if this will
>work, there are some problems to overcome here.
>
>-----Original Message-----
>From: Petre Agenbag [mailto:internetvsa.co.za]
>Sent: 1. júlí 2003 12:01
>To: Shivanischal A
>Cc: php-generallists.php.net
>Subject: Re: [PHP] Re: Form 2 PDF 2 Form
>
>Hi Shiva
>Appreciate your input. Wrt the spanning of the form, I think, in my
>situation, it would actually make things worse... You see, my suspicion
>is that most of the users who are experiencing problems, have very bad
>connections, many complain that they lose connectivity while they are
>busy with the form ( it takes them maybe 30 min or so to fill out the
>entire form ( they basically transfer the data off paper forms they have
>filled out earlier while "on-site", so it's not really alot of data, but
>there are a lot of fields...)
>So, my fear with this approach is that they will maybe get past the
>first part of the form, submit that OK, then start getting trouble with
>subsequent parts, leaving me with a whole lot of partial entries in the
>DB., and how do I get them to "resume" at a a later stage?
>You don't understand the mindset of these people, when something goes
>wrong, they'll switch off their PC's and try to start from scratch, so
>it's going to be difficult to try and get them to understand the concept
>of multi-part forms... I shudder to even think what will happen, or
>worse, how I will be able to allow them to make corrections on a certain
>part of the form once they have submit it. And sometimes, to their
>defense, it's not them that want to change the details on the form, but
>the subject of the form who has decided to change their name etc...
>
>I'm not ditching this idea, I will definitely give it some more thought,
>it's just at this moment, my mind is running through my original idea of
>PDF forms trying to evaluate it.
>
>Each method will have it's pro's and cons, and I'll have to go and weigh
>them. I must add, I don't see "effort" as a con for a particular
>solution, as long as I know it will solve the problem without adding
>other cons...
>
>Thanks again, will take it up with you again ( need some more input on
>this PDF thing to get some balanced views)
>
>PS, if you have experience with using this method, I would appreciate it
>if you could let me have your "field notes" and how successfull it's
>working for you.
>You see, the main thing here is that I need to KNOW when someone who
>says they have submitted something actually have, and that they are not
>trying their luck...
>
>
>On Tue, 2003-07-01 at 13:43, Shivanischal A wrote:
>
>
>>hi,
>>
>>seems u have complicated task on hand mate. cant u simply consider
>>
>>
>span the
>
>
>>user input over multiple pages? i mean using 2 or more form on
>>
>>
>different
>
>
>>pages instead of a single form on one single page. if this cant be
>>
>>
>done,
>
>
>>we'll think of other measures. but this is by far the most simple
>>
>>
>method
>
>
>>-shiva