|
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-help_at_lists.php.net
Date: Sun Sep 29 2002 - 22:43:15 CDT
php-general Digest 30 Sep 2002 03:43:15 -0000 Issue 1615
Topics (messages 118079 through 118138):
Re: Problems with dbase_create function
118079 by: Matt Neimeyer
118092 by: John W. Holmes
Re: Static constants? Server persistent?
118080 by: Mike Mannakee
118082 by: Jean-Christian Imbeault
118084 by: John Hinton
Session Not Saving?
118081 by: Stephen Craton
118083 by: debbie_dyer
118086 by: Chris Shiflett
calling session_start()
118085 by: Børge Strand
118088 by: debbie_dyer
118091 by: John W. Holmes
%e blank with date_format() on windows
118087 by: Gerard
Forms: How-to not display it if user hits back?
118089 by: Jean-Christian Imbeault
118090 by: John W. Holmes
Not Displaying From Vars??
118093 by: Stephen Craton
118096 by: John W. Holmes
118097 by: Stephen Craton
118100 by: debbie_dyer
118107 by: John W. Holmes
118108 by: debbie_dyer
118116 by: Stephen Craton
118117 by: debbie_dyer
118118 by: Chris Shiflett
118121 by: debbie_dyer
118125 by: John W. Holmes
pdf question
118094 by: Jonas Geiregat
error suppresion
118095 by: Gary
118098 by: John W. Holmes
118104 by: Gary
118106 by: John W. Holmes
118109 by: Jean-Christian Imbeault
118129 by: Gary
Copying a remote graphic to my server.
118099 by: scott
mail + memory question
118101 by: Jonas Geiregat
118105 by: Manuel Lemos
Multivalue RDBMS's
118102 by: Bill Farrell
mail + pdf + memory question
118103 by: Jonas Geiregat
118124 by: Rasmus Lerdorf
OT-best PDF creation tool
118110 by: Ryan A
118111 by: debbie_dyer
hash function secret
118112 by: Pablo Oliva
118113 by: debbie_dyer
Debbie->Re: [PHP] OT-best PDF creation tool
118114 by: Ryan A
118115 by: debbie_dyer
navigatie doesn't work in this script
118119 by: danny
118120 by: John W. Holmes
118122 by: danny
118123 by: John W. Holmes
118126 by: danny
118138 by: Tom Rogers
Size of SHA1 or MD5 hash hex-encoded?
118127 by: Eivind Olsen
Re: Update identical table
118128 by: David Freeman
118132 by: Justin French
Undefined constant error
118130 by: Voisine
118131 by: Sascha Cunz
118133 by: Matt
118134 by: Sascha Cunz
Re: Thanks
118135 by: Voisine
118136 by: Sascha Cunz
Re: Member's Area Script
118137 by: Stephen Craton
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I considered that...
Problem is I'm not 100% certain how to set that the correct way... (so as
not to screw anything else up)
Recommendations?
Thanks
PS It's good to know I wasn't completely off base... thanks millions!
>Does the web server have permission to write to the directory where you
>are trying to create the database? PHP runs as the web server when
>installed as a module and it needs permission to write in that
>directory.
>
>---John Holmes...
>
> > -----Original Message-----
> > From: Matt Neimeyer [mailto:matt
neimeyer.org]
> > Sent: Sunday, September 29, 2002 2:19 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Problems with dbase_create function
> >
> > Hey All,
> >
> > I'm trying to build a DBF for exporting selected data as a download to
>the
> > end users... But I can't get further than this...
> >
> > error_reporting(E_ALL);
> > $DBFName = "Test.dbf";
> > $Fields = array( array ("Test","C",32) );
> > if(dbase_create($DBFName, $Fields))
> > { echo "Good!"; } else { echo "Bad!"; }
> >
> > It doesn't show an error... and it doesn't create the dbf... it just
>shows
> > "Bad!" and nothing else.
> >
> > Any ideas where I should begin looking? I admit I'm not the most savvy
> > Linux user but I at least got it to admit that the function existed
>(under
> > a freshly compiled php with --enable-dbase on Redhat Linux 7.2)
> >
> > I've also tried $DBFName="./Test.dbf" and
> > "/full_path_from_root_to_html_folder/Test.dbf" and neither work. I've
>also
> > looked through the archives for this list and for the php-db list and
> > haven't seen anything that helps (other than my earlier problem of not
> > having enabled dbase, which appears to be fixed, before it wouldn't
>even
> > show "Bad!". )
> >
> > Thanks in advance for any ideas...
> >
> > Matt
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
You pretty much have to give the directory 777 permissions. On a shared
server, this is not the ideal solution, but it's the only one. No
worries if you're on a dedicated server.
---John Holmes...
> -----Original Message-----
> From: Matt Neimeyer [mailto:matt
neimeyer.org]
> Sent: Sunday, September 29, 2002 11:55 AM
> To: php-general
lists.php.net
> Subject: RE: [PHP] Problems with dbase_create function
>
> I considered that...
>
> Problem is I'm not 100% certain how to set that the correct way... (so
as
> not to screw anything else up)
>
> Recommendations?
>
> Thanks
>
> PS It's good to know I wasn't completely off base... thanks millions!
>
> >Does the web server have permission to write to the directory where
you
> >are trying to create the database? PHP runs as the web server when
> >installed as a module and it needs permission to write in that
> >directory.
> >
> >---John Holmes...
> >
> > > -----Original Message-----
> > > From: Matt Neimeyer [mailto:matt
neimeyer.org]
> > > Sent: Sunday, September 29, 2002 2:19 AM
> > > To: php-general
lists.php.net
> > > Subject: [PHP] Problems with dbase_create function
> > >
> > > Hey All,
> > >
> > > I'm trying to build a DBF for exporting selected data as a
download to
> >the
> > > end users... But I can't get further than this...
> > >
> > > error_reporting(E_ALL);
> > > $DBFName = "Test.dbf";
> > > $Fields = array( array ("Test","C",32) );
> > > if(dbase_create($DBFName, $Fields))
> > > { echo "Good!"; } else { echo "Bad!"; }
> > >
> > > It doesn't show an error... and it doesn't create the dbf... it
just
> >shows
> > > "Bad!" and nothing else.
> > >
> > > Any ideas where I should begin looking? I admit I'm not the most
savvy
> > > Linux user but I at least got it to admit that the function
existed
> >(under
> > > a freshly compiled php with --enable-dbase on Redhat Linux 7.2)
> > >
> > > I've also tried $DBFName="./Test.dbf" and
> > > "/full_path_from_root_to_html_folder/Test.dbf" and neither work.
I've
> >also
> > > looked through the archives for this list and for the php-db list
and
> > > haven't seen anything that helps (other than my earlier problem of
not
> > > having enabled dbase, which appears to be fixed, before it
wouldn't
> >even
> > > show "Bad!". )
> > >
> > > Thanks in advance for any ideas...
> > >
> > > Matt
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Just out of curiosity, what problem are you trying to solve? Including a
file is so easy and takes so little time I wonder how this could be a
problem. I've worked for a web site that was getting millions of page views
per day (Billions per month) running php/mysql and the issue never came up.
As long as you have enough bandwidth and servers, speed is no problem.
Mike
"Jean-Christian Imbeault" <jean_christian
myrealbox.com> wrote in message
news:3D96F16F.3040905
myrealbox.com...
> Justin French wrote:
> >
> > I'm merely guessing.
>
> Ok. Thanks for the guess. I'll post on the dev list and see if I can get
> a definitive answer.
>
> Jc
>
attached mail follows:
Mike Mannakee wrote:
>
> Just out of curiosity, what problem are you trying to solve? Including a
> file is so easy and takes so little time I wonder how this could be a
> problem.
Good question, glad you asked.
I have a header on all my pages. The header is HTML and contains images.
So of course I do an include("header.html") on all my pages ...
The header is about 20K, having PHP read 20k off the disk everytime a
user visits my page seemed inneficient. So I was trying to find a way to
get PHP to cache the file in memory so it wouldn't have to read it off
disk all the time ...
I have lots of bandwidth but not enough money to pay for a proper
SCSI/RAID disk set. All I have is a poor 7,2000 IDE HD. So the less disk
seeks thebetter :)
Jc
attached mail follows:
Jean-Christian Imbeault wrote:
> Mike Mannakee wrote:
>
>>
>> Just out of curiosity, what problem are you trying to solve?
>> Including a
>> file is so easy and takes so little time I wonder how this could be a
>> problem.
>
>
> Good question, glad you asked.
>
> I have a header on all my pages. The header is HTML and contains
> images. So of course I do an include("header.html") on all my pages
> ...
>
> The header is about 20K, having PHP read 20k off the disk everytime a
> user visits my page seemed inneficient. So I was trying to find a way
> to get PHP to cache the file in memory so it wouldn't have to read it
> off disk all the time ...
>
> I have lots of bandwidth but not enough money to pay for a proper
> SCSI/RAID disk set. All I have is a poor 7,2000 IDE HD. So the less
> disk seeks thebetter :)
>
> Jc
>
>
If you are running under Linux.. load it up with RAM... the OS will hold
any recent disk reads in cache... particularly a simple html document
with a few locally held images. I've watched disk access on some of my
boxes, some sites serving 1gig per day, and the disk just barely blips
along... most being served from cache. Linux rules!
John Hinton
attached mail follows:
I'm having another problem with my member's area script. When someone
logs in, it's supposed to register their username into a session and it
displays fine on the first page. But once you navigate to another part
of the area, it does not tell you you are logged in, instead it gives me
the error I set it to give "You are not logged in." Here's the code
that checks to see if the user is valid:
function check_valid()
{
global $valid_user;
if (session_is_registered("valid_user"))
{
echo "<font size='2'>Welcome $valid_user!</font>";
}
else
{
echo "You are not logged in.";
exit;
}
}
Here's the code that's supposed to save the session:
include_once("funcs.php");
session_start();
if($user && $pass)
{
if(login($user, $pass))
{
$valid_user = $user;
session_register("valid_user");
}
else
{
echo "<font face='Arial, Helvetica, sans-serif'
size='3'><center><b>You supplied an invalid username and password combo.
Try again please.</b></center>";
exit;
}
}
Please help again!!!
Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us
attached mail follows:
Are you calling session_start() on the other pages inside the secure area?
----- Original Message -----
From: "Stephen Craton" <webmaster
melchior.us>
To: <php-general
lists.php.net>
Sent: Sunday, September 29, 2002 5:23 PM
Subject: [PHP] Session Not Saving?
> I'm having another problem with my member's area script. When someone
> logs in, it's supposed to register their username into a session and it
> displays fine on the first page. But once you navigate to another part
> of the area, it does not tell you you are logged in, instead it gives me
> the error I set it to give "You are not logged in." Here's the code
> that checks to see if the user is valid:
>
> function check_valid()
> {
> global $valid_user;
> if (session_is_registered("valid_user"))
> {
> echo "<font size='2'>Welcome $valid_user!</font>";
> }
> else
> {
> echo "You are not logged in.";
> exit;
> }
> }
>
> Here's the code that's supposed to save the session:
>
> include_once("funcs.php");
> session_start();
> if($user && $pass)
> {
> if(login($user, $pass))
> {
> $valid_user = $user;
> session_register("valid_user");
> }
> else
> {
> echo "<font face='Arial, Helvetica, sans-serif'
> size='3'><center><b>You supplied an invalid username and password combo.
> Try again please.</b></center>";
> exit;
> }
> }
>
> Please help again!!!
>
> Thanks,
> Stephen
> http://www.melchior.us
> http://php.melchior.us
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I'm not sure why you are trying to use session_is_registered() to
validate a user, but you should get rid of that.
With sessions, you want to start the session on every page you need
session management. If you have a session module that you include
everywhere, you can do this by registering each session variable, as
that will implicitly start the session as well.
If you want to greet a user by name, simply have a session variable
called "first_name" or something. Then, if it's not blank, greet them.
I'm not sure if that helps, but you at least need to rethink what you
are trying to do.
Chris
Stephen Craton wrote:
>Here's the code
>that checks to see if the user is valid:
>
>function check_valid()
>{
> global $valid_user;
> if (session_is_registered("valid_user"))
> {
> echo "<font size='2'>Welcome $valid_user!</font>";
> }
> else
> {
> echo "You are not logged in.";
> exit;
> }
>}
>
attached mail follows:
Hi All,
When does session_start() have to be called? I have the following
setting:
A bunch of php pages are placed in a frameset. If someone tries to
access one of these pages without the session-id cookie being set, the
page calls a reloading of the frameset. The frameset page itself is
the first to call session_start()
Am I right to believe that session_start() has to be called before one
can do if (!isset($_SESSION['foo']))? It is this test that determines
whether or not to reload the frameset.
On my development system this works just fine, but going into
production on a web hotel, I get a lot more warnings. Every page in
the frameset says "Warning: Cannot send session cache limiter -
heaaders already sent..." in response to session_start() in the test I
described above.
Which setting in php.ini enables this warning?
Do you know how I can test for the presense of a session without
getting this error?
Regards,
Børge
attached mail follows:
session_start() has to be called on every page where you want to use the
session, before you try referencing it - you also have to call it before
outputting anything else (you must be doing it after and this is what is
causing your error)
----- Original Message -----
From: "Børge Strand" <borges
ifi.uio.no>
To: <php-general
lists.php.net>
Sent: Sunday, September 29, 2002 6:12 PM
Subject: [PHP] calling session_start()
>
> Hi All,
>
> When does session_start() have to be called? I have the following
> setting:
>
> A bunch of php pages are placed in a frameset. If someone tries to
> access one of these pages without the session-id cookie being set, the
> page calls a reloading of the frameset. The frameset page itself is
> the first to call session_start()
>
> Am I right to believe that session_start() has to be called before one
> can do if (!isset($_SESSION['foo']))? It is this test that determines
> whether or not to reload the frameset.
>
> On my development system this works just fine, but going into
> production on a web hotel, I get a lot more warnings. Every page in
> the frameset says "Warning: Cannot send session cache limiter -
> heaaders already sent..." in response to session_start() in the test I
> described above.
>
> Which setting in php.ini enables this warning?
> Do you know how I can test for the presense of a session without
> getting this error?
>
> Regards,
>
> Børge
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
> -----Original Message-----
> From: Børge Strand [mailto:borges
ifi.uio.no]
> Sent: Sunday, September 29, 2002 1:12 PM
> To: php-general
lists.php.net
> Subject: [PHP] calling session_start()
>
>
> Hi All,
>
> When does session_start() have to be called? I have the following
> setting:
>
> A bunch of php pages are placed in a frameset. If someone tries to
> access one of these pages without the session-id cookie being set, the
> page calls a reloading of the frameset. The frameset page itself is
> the first to call session_start()
>
> Am I right to believe that session_start() has to be called before one
> can do if (!isset($_SESSION['foo']))? It is this test that determines
> whether or not to reload the frameset.
Yep.
> On my development system this works just fine, but going into
> production on a web hotel, I get a lot more warnings. Every page in
> the frameset says "Warning: Cannot send session cache limiter -
> heaaders already sent..." in response to session_start() in the test I
> described above.
What's the exact error. Session_start() has to be called before any
output. The error message tells you exactly where the output started.
It'll give you the path to some page followed by :X, where the X is the
line number of that file where the output started.
> Which setting in php.ini enables this warning?
> Do you know how I can test for the presense of a session without
> getting this error?
You can work around it by using output_buffering, but I'd just recommend
you fix your code so things are in the right order...
---John Holmes...
attached mail follows:
"%e" with date_format doesn't print out anything on my windows 2k/xp
machines, but does on linux. All other chars print fine. Is this a locale
setting issue or something?
Gerard
attached mail follows:
I have the following scenario
1- user comes to page A, clicks a button to get to page B
2- Page B is a form the user fills and hits the submit button
3- form data is received and I use header() to send him back to page A
So A -> B -> A
The problem I have is with Netscape 7, possibly other browsers too. If
the user clicks the back button at stage 3, an annoying warning pops up:
"The page you are trying to view contains POST data that has expired
from the cache ....".
Is the anyway for me to code around this in PHP. Preferably the user
would get sent back to A and not B. But if this is not possible can I do
something so the warring does not pop up?
Thanks!
Jc
attached mail follows:
Use GET instead of POST. Other than that, I don't think so. It's a
client side issue and all browsers handle it differently, I think.
---John Holmes...
> -----Original Message-----
> From: Jean-Christian Imbeault [mailto:jean_christian
myrealbox.com]
> Sent: Sunday, September 29, 2002 1:24 PM
> To: php-general
lists.php.net
> Subject: [PHP] Forms: How-to not display it if user hits back?
>
> I have the following scenario
>
> 1- user comes to page A, clicks a button to get to page B
> 2- Page B is a form the user fills and hits the submit button
> 3- form data is received and I use header() to send him back to page A
>
> So A -> B -> A
>
> The problem I have is with Netscape 7, possibly other browsers too. If
> the user clicks the back button at stage 3, an annoying warning pops
up:
>
> "The page you are trying to view contains POST data that has expired
> from the cache ....".
>
> Is the anyway for me to code around this in PHP. Preferably the user
> would get sent back to A and not B. But if this is not possible can I
do
> something so the warring does not pop up?
>
> Thanks!
>
> Jc
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I bet you're getting sick of hearing from me but yet again, I'm having
trouble. I have a form that you type in a number for how many hours an
employee has worked. When they submit the form, it's supposed to
display, again, what they typed in and record them to a database to be
used for a later use. The form, evidently, submits fine but what my
problem is, is that it won't display what they typed in.
All I'm doing is putting in this:
<?php echo $sun_reg; ?>
The input field looks like this:
<input name="sun_reg" type="text" class="hours" id="sun_reg"
size="4" maxlength="3">
Does anyone see the problem? I can assign the form method to be GET and
it displays all the field values in the URL just fine, it's just not
displaying in the page itself.
Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us
attached mail follows:
Try $_POST['sun_reg'] or $_GET['sun_reg'], depending on the method of
your form.
You probably have register globals off, that's why $sun_reg isn't
created. That's a good thing.
---John Holmes...
> -----Original Message-----
> From: Stephen Craton [mailto:webmaster
melchior.us]
> Sent: Sunday, September 29, 2002 2:01 PM
> To: php-general
lists.php.net
> Subject: [PHP] Not Displaying From Vars??
>
> I bet you're getting sick of hearing from me but yet again, I'm having
> trouble. I have a form that you type in a number for how many hours an
> employee has worked. When they submit the form, it's supposed to
> display, again, what they typed in and record them to a database to be
> used for a later use. The form, evidently, submits fine but what my
> problem is, is that it won't display what they typed in.
>
> All I'm doing is putting in this:
>
> <?php echo $sun_reg; ?>
>
> The input field looks like this:
>
> <input name="sun_reg" type="text" class="hours" id="sun_reg"
> size="4" maxlength="3">
>
> Does anyone see the problem? I can assign the form method to be GET
and
> it displays all the field values in the URL just fine, it's just not
> displaying in the page itself.
>
> Thanks,
> Stephen
> http://www.melchior.us
> http://php.melchior.us
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I just tried it and it doesn't work either.
Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us
:: -----Original Message-----
:: From: John W. Holmes [mailto:holmes072000
charter.net]
:: Sent: Sunday, September 29, 2002 1:07 PM
:: To: 'Stephen Craton'; php-general
lists.php.net
:: Subject: RE: [PHP] Not Displaying From Vars??
::
::
:: Try $_POST['sun_reg'] or $_GET['sun_reg'], depending on the
:: method of your form.
::
:: You probably have register globals off, that's why $sun_reg
:: isn't created. That's a good thing.
::
:: ---John Holmes...
::
:: > -----Original Message-----
:: > From: Stephen Craton [mailto:webmaster
melchior.us]
:: > Sent: Sunday, September 29, 2002 2:01 PM
:: > To: php-general
lists.php.net
:: > Subject: [PHP] Not Displaying From Vars??
:: >
:: > I bet you're getting sick of hearing from me but yet
:: again, I'm having
:: > trouble. I have a form that you type in a number for how
:: many hours an
:: > employee has worked. When they submit the form, it's supposed to
:: > display, again, what they typed in and record them to a
:: database to be
:: > used for a later use. The form, evidently, submits fine
:: but what my
:: > problem is, is that it won't display what they typed in.
:: >
:: > All I'm doing is putting in this:
:: >
:: > <?php echo $sun_reg; ?>
:: >
:: > The input field looks like this:
:: >
:: > <input name="sun_reg" type="text" class="hours"
:: id="sun_reg" size="4"
:: > maxlength="3">
:: >
:: > Does anyone see the problem? I can assign the form method to be GET
:: and
:: > it displays all the field values in the URL just fine,
:: it's just not
:: > displaying in the page itself.
:: >
:: > Thanks,
:: > Stephen
:: > http://www.melchior.us
:: > http://php.melchior.us
:: >
:: >
:: >
:: > --
:: > PHP General Mailing List (http://www.php.net/)
:: > To unsubscribe, visit: http://www.php.net/unsub.php
::
::
::
::
attached mail follows:
Yeah got to be register_globals and also a tip to save future problems if
you are working with forms and u want to redisplay submitted data you will
need to learn about stripslashes (if you have magic_quotes_gpc on) and
htmlspecialchars.
And for the db additions addslashes (for if magic_quotes_gpc is off)
----- Original Message -----
From: "Stephen Craton" <webmaster
melchior.us>
To: <php-general
lists.php.net>
Sent: Sunday, September 29, 2002 7:00 PM
Subject: [PHP] Not Displaying From Vars??
> I bet you're getting sick of hearing from me but yet again, I'm having
> trouble. I have a form that you type in a number for how many hours an
> employee has worked. When they submit the form, it's supposed to
> display, again, what they typed in and record them to a database to be
> used for a later use. The form, evidently, submits fine but what my
> problem is, is that it won't display what they typed in.
>
> All I'm doing is putting in this:
>
> <?php echo $sun_reg; ?>
>
> The input field looks like this:
>
> <input name="sun_reg" type="text" class="hours" id="sun_reg"
> size="4" maxlength="3">
>
> Does anyone see the problem? I can assign the form method to be GET and
> it displays all the field values in the URL just fine, it's just not
> displaying in the page itself.
>
> Thanks,
> Stephen
> http://www.melchior.us
> http://php.melchior.us
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Post your code...
> -----Original Message-----
> From: Stephen Craton [mailto:webmaster
melchior.us]
> Sent: Sunday, September 29, 2002 2:11 PM
> To: php-general
lists.php.net
> Subject: RE: [PHP] Not Displaying From Vars??
>
> I just tried it and it doesn't work either.
>
> Thanks,
> Stephen
> http://www.melchior.us
> http://php.melchior.us
>
> :: -----Original Message-----
> :: From: John W. Holmes [mailto:holmes072000
charter.net]
> :: Sent: Sunday, September 29, 2002 1:07 PM
> :: To: 'Stephen Craton'; php-general
lists.php.net
> :: Subject: RE: [PHP] Not Displaying From Vars??
> ::
> ::
> :: Try $_POST['sun_reg'] or $_GET['sun_reg'], depending on the
> :: method of your form.
> ::
> :: You probably have register globals off, that's why $sun_reg
> :: isn't created. That's a good thing.
> ::
> :: ---John Holmes...
> ::
> :: > -----Original Message-----
> :: > From: Stephen Craton [mailto:webmaster
melchior.us]
> :: > Sent: Sunday, September 29, 2002 2:01 PM
> :: > To: php-general
lists.php.net
> :: > Subject: [PHP] Not Displaying From Vars??
> :: >
> :: > I bet you're getting sick of hearing from me but yet
> :: again, I'm having
> :: > trouble. I have a form that you type in a number for how
> :: many hours an
> :: > employee has worked. When they submit the form, it's supposed to
> :: > display, again, what they typed in and record them to a
> :: database to be
> :: > used for a later use. The form, evidently, submits fine
> :: but what my
> :: > problem is, is that it won't display what they typed in.
> :: >
> :: > All I'm doing is putting in this:
> :: >
> :: > <?php echo $sun_reg; ?>
> :: >
> :: > The input field looks like this:
> :: >
> :: > <input name="sun_reg" type="text" class="hours"
> :: id="sun_reg" size="4"
> :: > maxlength="3">
> :: >
> :: > Does anyone see the problem? I can assign the form method to be
GET
> :: and
> :: > it displays all the field values in the URL just fine,
> :: it's just not
> :: > displaying in the page itself.
> :: >
> :: > Thanks,
> :: > Stephen
> :: > http://www.melchior.us
> :: > http://php.melchior.us
> :: >
> :: >
> :: >
> :: > --
> :: > PHP General Mailing List (http://www.php.net/)
> :: > To unsubscribe, visit: http://www.php.net/unsub.php
> ::
> ::
> ::
> ::
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Its a setting in php.ini where PHP creates vars from form data/cookies if
its on. If it is on - its a security risk because anyone can change the
value of the data in your script by passing values in thru the URL.
So you need to keep it switched off (whereby vars will not be created from
form data) and use the superglobals $_POST, $_GET, etc to access your data
instead.
----- Original Message -----
From: "Stephen Craton" <webmaster
melchior.us>
To: "'debbie_dyer'" <debbie_dyer
surfanytime.co.uk>
Sent: Sunday, September 29, 2002 7:29 PM
Subject: RE: [PHP] Not Displaying From Vars??
> Sorry if I'm acting all noobish but, how do I register_globals?
>
> I already know about stripslashes and addslashes, I usually use those to
> store secured information.
>
> Thanks,
> Stephen
> http://www.melchior.us
> http://php.melchior.us
>
> :: -----Original Message-----
> :: From: debbie_dyer [mailto:debbie_dyer
surfanytime.co.uk]
> :: Sent: Sunday, September 29, 2002 1:14 PM
> :: To: php-general
lists.php.net
> :: Subject: Re: [PHP] Not Displaying From Vars??
> ::
> ::
> :: Yeah got to be register_globals and also a tip to save
> :: future problems if you are working with forms and u want to
> :: redisplay submitted data you will need to learn about
> :: stripslashes (if you have magic_quotes_gpc on) and htmlspecialchars.
> ::
> :: And for the db additions addslashes (for if magic_quotes_gpc is off)
> ::
> ::
> :: ----- Original Message -----
> :: From: "Stephen Craton" <webmaster
melchior.us>
> :: To: <php-general
lists.php.net>
> :: Sent: Sunday, September 29, 2002 7:00 PM
> :: Subject: [PHP] Not Displaying From Vars??
> ::
> ::
> :: > I bet you're getting sick of hearing from me but yet
> :: again, I'm having
> :: > trouble. I have a form that you type in a number for how
> :: many hours an
> :: > employee has worked. When they submit the form, it's supposed to
> :: > display, again, what they typed in and record them to a
> :: database to be
> :: > used for a later use. The form, evidently, submits fine
> :: but what my
> :: > problem is, is that it won't display what they typed in.
> :: >
> :: > All I'm doing is putting in this:
> :: >
> :: > <?php echo $sun_reg; ?>
> :: >
> :: > The input field looks like this:
> :: >
> :: > <input name="sun_reg" type="text" class="hours"
> :: id="sun_reg" size="4"
> :: > maxlength="3">
> :: >
> :: > Does anyone see the problem? I can assign the form method
> :: to be GET
> :: > and it displays all the field values in the URL just fine,
> :: it's just
> :: > not displaying in the page itself.
> :: >
> :: > Thanks,
> :: > Stephen
> :: > http://www.melchior.us
> :: > http://php.melchior.us
> :: >
> :: >
> :: >
> :: > --
> :: > PHP General Mailing List (http://www.php.net/)
> :: > To unsubscribe, visit: http://www.php.net/unsub.php
> :: >
> ::
> ::
> :: --
> :: PHP General Mailing List (http://www.php.net/)
> :: To unsubscribe, visit: http://www.php.net/unsub.php
> ::
> ::
> ::
>
>
attached mail follows:
Here's the part that's supposed to display the information. I've only
filled in one area so far:
<tr>
<td><font size="2" face="Arial, Helvetica,
sans-serif">Sunday</font></td>
<td align="center" valign="middle"><?php echo
$_GET[sung_reg]; ?></td>
<td align="center" valign="middle"
class="line"> </td>
<td align="center" valign="middle"
class="line2"> </td>
<td align="center" valign="middle"> </td>
<td align="center" valign="middle"> </td>
<td align="center" valign="middle"> </td>
<td align="center" valign="middle"> </td>
<td align="center" valign="middle"> </td>
<td align="center" valign="middle"> </td>
</tr>
Here's the form for the same area:
<tr>
<td><font size="2" face="Arial, Helvetica,
sans-serif">Sunday</font></td>
<td align="center" valign="middle"> <input
name="sun_reg" type="text" class="hours" id="sun_reg" size="4"
maxlength="3">
</td>
<td align="center" valign="middle"
class="line"><font size="2" face="Arial, Helvetica, sans-serif">
<input name="sun_over" type="text"
class="hours" id="sun_over" size="4" maxlength="3">
</font></td>
<td align="center" valign="middle"
class="line2"><font size="2" face="Arial, Helvetica, sans-serif">
<input name="sun_vac" type="text"
class="hours" id="sun_vac" size="4" maxlength="3">
</font></td>
<td align="center" valign="middle"><font
size="2" face="Arial, Helvetica, sans-serif">
<input name="sun_hol" type="text"
class="hours" id="sun_hol" size="4" maxlength="3">
</font></td>
<td align="center" valign="middle"><font
size="2" face="Arial, Helvetica, sans-serif">
<input name="sun_sick" type="text"
class="hours" id="sun_sick" size="4" maxlength="3">
</font></td>
<td align="center" valign="middle"><font
size="2" face="Arial, Helvetica, sans-serif">
<input name="sun_funer" type="text"
class="hours" id="sun_funer" size="4" maxlength="3">
</font></td>
<td align="center" valign="middle"><font
size="2" face="Arial, Helvetica, sans-serif">
<input name="sun_edu" type="text"
class="hours" id="sun_edu" size="4" maxlength="3">
</font></td>
<td align="center" valign="middle"><font
size="2" face="Arial, Helvetica, sans-serif">
<input name="sun_per" type="text"
class="hours" id="sun_per2" size="4" maxlength="3">
</font></td>
<td align="center" valign="middle"><font
size="2" face="Arial, Helvetica, sans-serif">
<input name="sun_other" type="text"
class="hours" id="sun_other" size="4" maxlength="3">
</font></td>
</tr>
Hope that helps!
Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us
:: -----Original Message-----
:: From: John W. Holmes [mailto:holmes072000
charter.net]
:: Sent: Sunday, September 29, 2002 1:33 PM
:: To: 'Stephen Craton'; php-general
lists.php.net
:: Subject: RE: [PHP] Not Displaying From Vars??
::
::
:: Post your code...
::
:: > -----Original Message-----
:: > From: Stephen Craton [mailto:webmaster
melchior.us]
:: > Sent: Sunday, September 29, 2002 2:11 PM
:: > To: php-general
lists.php.net
:: > Subject: RE: [PHP] Not Displaying From Vars??
:: >
:: > I just tried it and it doesn't work either.
:: >
:: > Thanks,
:: > Stephen
:: > http://www.melchior.us
:: > http://php.melchior.us
:: >
:: > :: -----Original Message-----
:: > :: From: John W. Holmes [mailto:holmes072000
charter.net]
:: > :: Sent: Sunday, September 29, 2002 1:07 PM
:: > :: To: 'Stephen Craton'; php-general
lists.php.net
:: > :: Subject: RE: [PHP] Not Displaying From Vars??
:: > ::
:: > ::
:: > :: Try $_POST['sun_reg'] or $_GET['sun_reg'], depending on the
:: > :: method of your form.
:: > ::
:: > :: You probably have register globals off, that's why $sun_reg
:: > :: isn't created. That's a good thing.
:: > ::
:: > :: ---John Holmes...
:: > ::
:: > :: > -----Original Message-----
:: > :: > From: Stephen Craton [mailto:webmaster
melchior.us]
:: > :: > Sent: Sunday, September 29, 2002 2:01 PM
:: > :: > To: php-general
lists.php.net
:: > :: > Subject: [PHP] Not Displaying From Vars??
:: > :: >
:: > :: > I bet you're getting sick of hearing from me but yet
:: > :: again, I'm having
:: > :: > trouble. I have a form that you type in a number for how
:: > :: many hours an
:: > :: > employee has worked. When they submit the form, it's
:: supposed to
:: > :: > display, again, what they typed in and record them to a
:: > :: database to be
:: > :: > used for a later use. The form, evidently, submits fine
:: > :: but what my
:: > :: > problem is, is that it won't display what they typed in.
:: > :: >
:: > :: > All I'm doing is putting in this:
:: > :: >
:: > :: > <?php echo $sun_reg; ?>
:: > :: >
:: > :: > The input field looks like this:
:: > :: >
:: > :: > <input name="sun_reg" type="text" class="hours"
:: > :: id="sun_reg" size="4"
:: > :: > maxlength="3">
:: > :: >
:: > :: > Does anyone see the problem? I can assign the form
:: method to be
:: GET
:: > :: and
:: > :: > it displays all the field values in the URL just fine,
:: > :: it's just not
:: > :: > displaying in the page itself.
:: > :: >
:: > :: > Thanks,
:: > :: > Stephen
:: > :: > http://www.melchior.us
:: > :: > http://php.melchior.us
:: > :: >
:: > :: >
:: > :: >
:: > :: > --
:: > :: > PHP General Mailing List (http://www.php.net/)
:: > :: > To unsubscribe, visit: http://www.php.net/unsub.php
:: > ::
:: > ::
:: > ::
:: > ::
:: >
:: >
:: >
:: > --
:: > PHP General Mailing List (http://www.php.net/)
:: > To unsubscribe, visit: http://www.php.net/unsub.php
::
::
::
::
:: --
:: PHP General Mailing List (http://www.php.net/)
:: To unsubscribe, visit: http://www.php.net/unsub.php
::
::
::
attached mail follows:
Wheres the form tag?
----- Original Message -----
From: "Stephen Craton" <webmaster
melchior.us>
To: <holmes072000
charter.net>; <php-general
lists.php.net>
Sent: Sunday, September 29, 2002 8:19 PM
Subject: RE: [PHP] Not Displaying From Vars??
> Here's the part that's supposed to display the information. I've only
> filled in one area so far:
>
> <tr>
> <td><font size="2" face="Arial, Helvetica,
> sans-serif">Sunday</font></td>
> <td align="center" valign="middle"><?php echo
> $_GET[sung_reg]; ?></td>
> <td align="center" valign="middle"
> class="line"> </td>
> <td align="center" valign="middle"
> class="line2"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> </tr>
>
> Here's the form for the same area:
>
> <tr>
> <td><font size="2" face="Arial, Helvetica,
> sans-serif">Sunday</font></td>
> <td align="center" valign="middle"> <input
> name="sun_reg" type="text" class="hours" id="sun_reg" size="4"
> maxlength="3">
> </td>
> <td align="center" valign="middle"
> class="line"><font size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_over" type="text"
> class="hours" id="sun_over" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"
> class="line2"><font size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_vac" type="text"
> class="hours" id="sun_vac" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_hol" type="text"
> class="hours" id="sun_hol" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_sick" type="text"
> class="hours" id="sun_sick" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_funer" type="text"
> class="hours" id="sun_funer" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_edu" type="text"
> class="hours" id="sun_edu" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_per" type="text"
> class="hours" id="sun_per2" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_other" type="text"
> class="hours" id="sun_other" size="4" maxlength="3">
> </font></td>
> </tr>
>
> Hope that helps!
>
> Thanks,
> Stephen
> http://www.melchior.us
> http://php.melchior.us
>
> :: -----Original Message-----
> :: From: John W. Holmes [mailto:holmes072000
charter.net]
> :: Sent: Sunday, September 29, 2002 1:33 PM
> :: To: 'Stephen Craton'; php-general
lists.php.net
> :: Subject: RE: [PHP] Not Displaying From Vars??
> ::
> ::
> :: Post your code...
> ::
> :: > -----Original Message-----
> :: > From: Stephen Craton [mailto:webmaster
melchior.us]
> :: > Sent: Sunday, September 29, 2002 2:11 PM
> :: > To: php-general
lists.php.net
> :: > Subject: RE: [PHP] Not Displaying From Vars??
> :: >
> :: > I just tried it and it doesn't work either.
> :: >
> :: > Thanks,
> :: > Stephen
> :: > http://www.melchior.us
> :: > http://php.melchior.us
> :: >
> :: > :: -----Original Message-----
> :: > :: From: John W. Holmes [mailto:holmes072000
charter.net]
> :: > :: Sent: Sunday, September 29, 2002 1:07 PM
> :: > :: To: 'Stephen Craton'; php-general
lists.php.net
> :: > :: Subject: RE: [PHP] Not Displaying From Vars??
> :: > ::
> :: > ::
> :: > :: Try $_POST['sun_reg'] or $_GET['sun_reg'], depending on the
> :: > :: method of your form.
> :: > ::
> :: > :: You probably have register globals off, that's why $sun_reg
> :: > :: isn't created. That's a good thing.
> :: > ::
> :: > :: ---John Holmes...
> :: > ::
> :: > :: > -----Original Message-----
> :: > :: > From: Stephen Craton [mailto:webmaster
melchior.us]
> :: > :: > Sent: Sunday, September 29, 2002 2:01 PM
> :: > :: > To: php-general
lists.php.net
> :: > :: > Subject: [PHP] Not Displaying From Vars??
> :: > :: >
> :: > :: > I bet you're getting sick of hearing from me but yet
> :: > :: again, I'm having
> :: > :: > trouble. I have a form that you type in a number for how
> :: > :: many hours an
> :: > :: > employee has worked. When they submit the form, it's
> :: supposed to
> :: > :: > display, again, what they typed in and record them to a
> :: > :: database to be
> :: > :: > used for a later use. The form, evidently, submits fine
> :: > :: but what my
> :: > :: > problem is, is that it won't display what they typed in.
> :: > :: >
> :: > :: > All I'm doing is putting in this:
> :: > :: >
> :: > :: > <?php echo $sun_reg; ?>
> :: > :: >
> :: > :: > The input field looks like this:
> :: > :: >
> :: > :: > <input name="sun_reg" type="text" class="hours"
> :: > :: id="sun_reg" size="4"
> :: > :: > maxlength="3">
> :: > :: >
> :: > :: > Does anyone see the problem? I can assign the form
> :: method to be
> :: GET
> :: > :: and
> :: > :: > it displays all the field values in the URL just fine,
> :: > :: it's just not
> :: > :: > displaying in the page itself.
> :: > :: >
> :: > :: > Thanks,
> :: > :: > Stephen
> :: > :: > http://www.melchior.us
> :: > :: > http://php.melchior.us
> :: > :: >
> :: > :: >
> :: > :: >
> :: > :: > --
> :: > :: > PHP General Mailing List (http://www.php.net/)
> :: > :: > To unsubscribe, visit: http://www.php.net/unsub.php
> :: > ::
> :: > ::
> :: > ::
> :: > ::
> :: >
> :: >
> :: >
> :: > --
> :: > PHP General Mailing List (http://www.php.net/)
> :: > To unsubscribe, visit: http://www.php.net/unsub.php
> ::
> ::
> ::
> ::
> :: --
> :: PHP General Mailing List (http://www.php.net/)
> :: To unsubscribe, visit: http://www.php.net/unsub.php
> ::
> ::
> ::
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Your description of register_globals is good, except that the "security
risk" is a matter of opinion. I would argue that register_globals only
presents a security risk to inexperienced developers.
The client can submit any data to your application regardless of any
configuration (and even regardless of language used). PHP's
register_globals provides a convenient mechanism for receiving data from
the client. In general, there are two types of data:
1. Data from the client
2. Data residing on the server
Code that allows data from the client to overwrite data residing on the
server is poorly written code, and this is the scenario that creates
this misconception of register_globals being a security risk. Data
residing on the server can be information in a database, session data,
etc. It is quite trivial to ensure that this data is overwritten. When a
script begins execution, the client can no longer submit data. It is
finished and can do no more so to speak. This makes things very easy.
Thus, consider this:
$logged_in=0;
if (is_valid($password))
{
$logged_in=1;
}
Guess what? The client cannot make $logged_in = 1 unless the password
they provide passes the is_valid() function (a function you create to
validate a password - just a hypothetical example). There is no way a
client can submit any data in between these statements. The problem is
when people fail to set $logged_in to 0 initially, so that a failed
password simply avoids the if statement but doesn't explicitly set
$logged_in to 0. This is poor programming.
For session data, try to override data that is initialized with
session_register() and see if it works. What you will find is that
whatever the client sends is overwritten by the data in the session, so
this scenario is also easy to avoid.
My point is that most risks can be avoided by understanding how the Web
operates and programming to the transactional nature of it. It is so
easy to make sure that the client cannot overwrite server data. I think
register_globals is far too often blamed for misunderstandings.
Chris
debbie_dyer wrote:
>If it is on - its a security risk because anyone can change the
>value of the data in your script by passing values in thru the URL.
>
attached mail follows:
Chris
Yes you are right in what you say but:-
"I would argue that register_globals only presents a security risk to
inexperienced developers."
And how many of these are putting code on the net? - Thousands.
Also, all programmers (even the most experienced) are only human and prone
to error and in my opinion anything that makes it easy to write bad code
cannot be good.
Debbie
----- Original Message -----
From: "Chris Shiflett" <shiflett
php.net>
To: "debbie_dyer" <debbie_dyer
surfanytime.co.uk>
Cc: <php-general
lists.php.net>
Sent: Sunday, September 29, 2002 8:21 PM
Subject: Re: [PHP] Not Displaying From Vars??
> Your description of register_globals is good, except that the "security
> risk" is a matter of opinion. I would argue that register_globals only
> presents a security risk to inexperienced developers.
>
> The client can submit any data to your application regardless of any
> configuration (and even regardless of language used). PHP's
> register_globals provides a convenient mechanism for receiving data from
> the client. In general, there are two types of data:
>
> 1. Data from the client
> 2. Data residing on the server
>
> Code that allows data from the client to overwrite data residing on the
> server is poorly written code, and this is the scenario that creates
> this misconception of register_globals being a security risk. Data
> residing on the server can be information in a database, session data,
> etc. It is quite trivial to ensure that this data is overwritten. When a
> script begins execution, the client can no longer submit data. It is
> finished and can do no more so to speak. This makes things very easy.
> Thus, consider this:
>
> $logged_in=0;
>
> if (is_valid($password))
> {
> $logged_in=1;
> }
>
> Guess what? The client cannot make $logged_in = 1 unless the password
> they provide passes the is_valid() function (a function you create to
> validate a password - just a hypothetical example). There is no way a
> client can submit any data in between these statements. The problem is
> when people fail to set $logged_in to 0 initially, so that a failed
> password simply avoids the if statement but doesn't explicitly set
> $logged_in to 0. This is poor programming.
>
> For session data, try to override data that is initialized with
> session_register() and see if it works. What you will find is that
> whatever the client sends is overwritten by the data in the session, so
> this scenario is also easy to avoid.
>
> My point is that most risks can be avoided by understanding how the Web
> operates and programming to the transactional nature of it. It is so
> easy to make sure that the client cannot overwrite server data. I think
> register_globals is far too often blamed for misunderstandings.
>
> Chris
>
> debbie_dyer wrote:
>
> >If it is on - its a security risk because anyone can change the
> >value of the data in your script by passing values in thru the URL.
> >
>
attached mail follows:
Does just a simple form work?
<form method="GET">
<input type="text" name="test">
<input type="submit" name="submit">
</form>
<?
if(isset($_GET['submit']))
{ echo $_GET['test'] . " was submitted"; }
?>
---John Holmes...
> -----Original Message-----
> From: Stephen Craton [mailto:webmaster
melchior.us]
> Sent: Sunday, September 29, 2002 3:19 PM
> To: holmes072000
charter.net; php-general
lists.php.net
> Subject: RE: [PHP] Not Displaying From Vars??
>
> Here's the part that's supposed to display the information. I've only
> filled in one area so far:
>
> <tr>
> <td><font size="2" face="Arial, Helvetica,
> sans-serif">Sunday</font></td>
> <td align="center" valign="middle"><?php echo
> $_GET[sung_reg]; ?></td>
> <td align="center" valign="middle"
> class="line"> </td>
> <td align="center" valign="middle"
> class="line2"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> <td align="center" valign="middle"> </td>
> </tr>
>
> Here's the form for the same area:
>
> <tr>
> <td><font size="2" face="Arial, Helvetica,
> sans-serif">Sunday</font></td>
> <td align="center" valign="middle"> <input
> name="sun_reg" type="text" class="hours" id="sun_reg" size="4"
> maxlength="3">
> </td>
> <td align="center" valign="middle"
> class="line"><font size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_over" type="text"
> class="hours" id="sun_over" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"
> class="line2"><font size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_vac" type="text"
> class="hours" id="sun_vac" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_hol" type="text"
> class="hours" id="sun_hol" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_sick" type="text"
> class="hours" id="sun_sick" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_funer" type="text"
> class="hours" id="sun_funer" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_edu" type="text"
> class="hours" id="sun_edu" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_per" type="text"
> class="hours" id="sun_per2" size="4" maxlength="3">
> </font></td>
> <td align="center" valign="middle"><font
> size="2" face="Arial, Helvetica, sans-serif">
> <input name="sun_other" type="text"
> class="hours" id="sun_other" size="4" maxlength="3">
> </font></td>
> </tr>
>
> Hope that helps!
>
> Thanks,
> Stephen
> http://www.melchior.us
> http://php.melchior.us
>
> :: -----Original Message-----
> :: From: John W. Holmes [mailto:holmes072000
charter.net]
> :: Sent: Sunday, September 29, 2002 1:33 PM
> :: To: 'Stephen Craton'; php-general
lists.php.net
> :: Subject: RE: [PHP] Not Displaying From Vars??
> ::
> ::
> :: Post your code...
> ::
> :: > -----Original Message-----
> :: > From: Stephen Craton [mailto:webmaster
melchior.us]
> :: > Sent: Sunday, September 29, 2002 2:11 PM
> :: > To: php-general
lists.php.net
> :: > Subject: RE: [PHP] Not Displaying From Vars??
> :: >
> :: > I just tried it and it doesn't work either.
> :: >
> :: > Thanks,
> :: > Stephen
> :: > http://www.melchior.us
> :: > http://php.melchior.us
> :: >
> :: > :: -----Original Message-----
> :: > :: From: John W. Holmes [mailto:holmes072000
charter.net]
> :: > :: Sent: Sunday, September 29, 2002 1:07 PM
> :: > :: To: 'Stephen Craton'; php-general
lists.php.net
> :: > :: Subject: RE: [PHP] Not Displaying From Vars??
> :: > ::
> :: > ::
> :: > :: Try $_POST['sun_reg'] or $_GET['sun_reg'], depending on the
> :: > :: method of your form.
> :: > ::
> :: > :: You probably have register globals off, that's why $sun_reg
> :: > :: isn't created. That's a good thing.
> :: > ::
> :: > :: ---John Holmes...
> :: > ::
> :: > :: > -----Original Message-----
> :: > :: > From: Stephen Craton [mailto:webmaster
melchior.us]
> :: > :: > Sent: Sunday, September 29, 2002 2:01 PM
> :: > :: > To: php-general
lists.php.net
> :: > :: > Subject: [PHP] Not Displaying From Vars??
> :: > :: >
> :: > :: > I bet you're getting sick of hearing from me but yet
> :: > :: again, I'm having
> :: > :: > trouble. I have a form that you type in a number for how
> :: > :: many hours an
> :: > :: > employee has worked. When they submit the form, it's
> :: supposed to
> :: > :: > display, again, what they typed in and record them to a
> :: > :: database to be
> :: > :: > used for a later use. The form, evidently, submits fine
> :: > :: but what my
> :: > :: > problem is, is that it won't display what they typed in.
> :: > :: >
> :: > :: > All I'm doing is putting in this:
> :: > :: >
> :: > :: > <?php echo $sun_reg; ?>
> :: > :: >
> :: > :: > The input field looks like this:
> :: > :: >
> :: > :: > <input name="sun_reg" type="text" class="hours"
> :: > :: id="sun_reg" size="4"
> :: > :: > maxlength="3">
> :: > :: >
> :: > :: > Does anyone see the problem? I can assign the form
> :: method to be
> :: GET
> :: > :: and
> :: > :: > it displays all the field values in the URL just fine,
> :: > :: it's just not
> :: > :: > displaying in the page itself.
> :: > :: >
> :: > :: > Thanks,
> :: > :: > Stephen
> :: > :: > http://www.melchior.us
> :: > :: > http://php.melchior.us
> :: > :: >
> :: > :: >
> :: > :: >
> :: > :: > --
> :: > :: > PHP General Mailing List (http://www.php.net/)
> :: > :: > To unsubscribe, visit: http://www.php.net/unsub.php
> :: > ::
> :: > ::
> :: > ::
> :: > ::
> :: >
> :: >
> :: >
> :: > --
> :: > PHP General Mailing List (http://www.php.net/)
> :: > To unsubscribe, visit: http://www.php.net/unsub.php
> ::
> ::
> ::
> ::
> :: --
> :: PHP General Mailing List (http://www.php.net/)
> :: To unsubscribe, visit: http://www.php.net/unsub.php
> ::
> ::
> ::
>
attached mail follows:
this is my code
<?php
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_begin_page($pdf, 595, 842);
pdf_set_font($pdf, "Times-Roman", 30, "host");
pdf_set_value($pdf, "textrendering", 1);
pdf_show_xy($pdf, "text here", 50, 750);
pdf_end_page($pdf);
pdf_close($pdf);
$data = pdf_get_buffer($pdf);
header("Content-type: application/pdf");
header("Content-disposition: inline; filename=test.pdf");
header("Content-length: " . strlen($data));
echo $data;
?>
I can't save the pdf file on server cause webserver doesn't have write
permission to the dir I normally wanted to be in
but I just want to generate a pdf file and send it as attachement with email
how can I do this by generating the pdf in memory
attached mail follows:
I have a form, the action is PHP_SELF. When the form is submitted it
prints the info lower on the page. The problem, the errors for the empty
fields are printed until the form is submitted. What would be the best
way of suppressing these error?
TIA
Gary
attached mail follows:
> I have a form, the action is PHP_SELF. When the form is submitted it
> prints the info lower on the page. The problem, the errors for the
empty
> fields are printed until the form is submitted. What would be the best
> way of suppressing these error?
The best way to suppress your errors is to fix them. :)
Or you can work around it by using the error_reporting() function.
---John Holmes...
attached mail follows:
John W. Holmes wrote:
>>I have a form, the action is PHP_SELF. When the form is submitted it
>>prints the info lower on the page. The problem, the errors for the
>
> empty
>
>>fields are printed until the form is submitted. What would be the best
>>way of suppressing these error?
>
>
> The best way to suppress your errors is to fix them. :)
>
> Or you can work around it by using the error_reporting() function.
>
> ---John Holmes...
>
>
They are not really errors they are reporting that the form fields are
empty until the form is submitted.
Notice: Undefined index:
Gary
attached mail follows:
Just reduce the error_reporting() level while you display the form,
then. Set it so it does not show NOTICES.
---John Holmes...
> -----Original Message-----
> From: Gary [mailto:garyb10
earthlink.net]
> Sent: Sunday, September 29, 2002 2:29 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] error suppresion
>
> John W. Holmes wrote:
> >>I have a form, the action is PHP_SELF. When the form is submitted it
> >>prints the info lower on the page. The problem, the errors for the
> >
> > empty
> >
> >>fields are printed until the form is submitted. What would be the
best
> >>way of suppressing these error?
> >
> >
> > The best way to suppress your errors is to fix them. :)
> >
> > Or you can work around it by using the error_reporting() function.
> >
> > ---John Holmes...
> >
> >
>
> They are not really errors they are reporting that the form fields are
> empty until the form is submitted.
> Notice: Undefined index:
>
> Gary
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Gary wrote:
>
> They are not really errors they are reporting that the form fields are
> empty until the form is submitted.
> Notice: Undefined index:
That means your code is not doing any checking of the incoming data. You
should always check that the data coming is what you expect it to be.
It's good programming practice and helps security.
Just add the following to your code and every thing will be fine
(assuming POST, but works with GET or any other):
if (isset($_POST["myvar name"])) {
$value = $_POST["myvar name"];
}
else {
$value = "";
}
I always turn error reporting way up when coding and debugging, it helps
me to find places where I have undefined variables when the variables
really *should* be defined ... meaning I have a bug ;)
Jc
attached mail follows:
Jean-Christian Imbeault wrote:
> Gary wrote:
>
>>
>> They are not really errors they are reporting that the form fields are
>> empty until the form is submitted.
>> Notice: Undefined index:
>
>
> That means your code is not doing any checking of the incoming data. You
> should always check that the data coming is what you expect it to be.
> It's good programming practice and helps security.
>
> Just add the following to your code and every thing will be fine
> (assuming POST, but works with GET or any other):
>
> if (isset($_POST["myvar name"])) {
> $value = $_POST["myvar name"];
> }
> else {
> $value = "";
> }
>
The problem is the vars will never be set until the form is submitted.
The e-notice's are for the
empty form elements before the form submission. So the "else value"
would be, turn off error reporting until submission.
Gary
attached mail follows:
Hello there
I am trying to copy a remote graphic from http://blah.com/blah.jpg to my
server. How would I achieve this in php I have looked on the archives
but can't seem to find the best way. I am running 4.1.2 on apache unix.
I understand copy will not work on remote files (tried it) but I am not
sure of the correct fopen fwrite etc code! Any sample code or pointers
are most helpful Best regards Scott
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
this is my code what I want to do is generate a pdf file(not save it on hd of server but in memory) then send it as attachement to someone
$pdf = pdf_new();
pdf_open_file($pdf,""); pdf_begin_page($pdf, 595, 842); pdf_set_font($pdf, "Times-Roman", 30, "host"); pdf_set_value($pdf, "textrendering", 1); pdf_show_xy($pdf, "A PDF document created in memory!", 50, 750); pdf_end_page($pdf); pdf_close($pdf); $data = pdf_get_buffer($pdf);
/** * Filename.......: example.3.php * Project........: HTML Mime Mail class * Last Modified..: 15 July 2002 */ error_reporting(E_ALL); include('htmlMimeMail.php');
/** * Example of usage. This example shows * how to use the class to send a plain * text email with an attachment. No html, * or embedded images. * * Create the mail object. */ $mail = new htmlMimeMail(); /** * Read the file test.zip into $attachment. */ $attachment = $mail->getFile('test.pdf');
/** * Since we're sending a plain text email, * we only need to read in the text file. */ $text = $mail->getFile('example.txt');
/** * To set the text body of the email, we * are using the setText() function. This * is an alternative to the setHtml() function * which would obviously be inappropriate here. */ $mail->setText($text);
/** * This is used to add an attachment to * the email. */ $mail->addAttachment($attachment, 'test.pdf', 'application/zip');
/**
* Sends the message.
*/
$mail->setFrom('Joe <kemu
sdf-eu.org');
$result = $mail->send(array('"Richard" <kemu
sdf-eu.org>'));
echo $result ? 'Mail sent!' : 'Failed to send mail';
the mail get's send but I get this error Warning: fopen("test.pdf", "rb") - No such file or directory in /home/web/intranet/httpdocs/htmlMimeMail.php on line 162 and test.pdf is included in the mail but is 0kb big anyone sees the prob ?
attached mail follows:
Hello,
On 09/29/2002 03:27 PM, Jonas Geiregat wrote: > the mail get's send but I get this error > Warning: fopen("test.pdf", "rb") - No such file or directory in > /home/web/intranet/httpdocs/htmlMimeMail.php on line 162 > and test.pdf is included in the mail but is 0kb big > anyone sees the prob ?
Maybe that class was not meant to send non-file based attachments.
Try this other class that certainly can be used for sending dynamically generated attachments from memory.
http://www.phpclasses.org/mimemessage
--Regards, Manuel Lemos
attached mail follows:
Hi, all,
Just out of curiosity, are there any people out there using PHP with UniVerse/UniData, Pick, mvBase or any other multivalue database? I'm getting brave with PHP and writing some connection and Dynamic String Array (Pick record) handling objects and wonder if anyone has been down this road before.
I'm using VantagePoint Software's MVGateway as the connection middleware. So far it's starting to work pretty good (thanks to all the tips from this list! Y'all are a very informative bunch!).
So far, I've emulated the most important mvBASIC functions in PHP and can now handle MV records and record sets directly. If anyone is using an MV RDBMS it might be useful to compare notes on what's practical and what's not to use in forms generation and data handling.
I'm becoming hooked on PHP...seems there isn't anything you can't do with it. If you can conceive it, you can code it to work :-)
Best regards, B
===== Bill Farrell Multivalue and *nix Support Specialist
Phone: (828) 667-2245 Fax: (928) 563-5189 Web: http://www.jwfarrell.com
__________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com
attached mail follows:
this is my code what I want to do is generate a pdf file(not save it on hd of server but in memory) then send it as attachement to someone
$pdf = pdf_new();
pdf_open_file($pdf,""); pdf_begin_page($pdf, 595, 842); pdf_set_font($pdf, "Times-Roman", 30, "host"); pdf_set_value($pdf, "textrendering", 1); pdf_show_xy($pdf, "A PDF document created in memory!", 50, 750); pdf_end_page($pdf); pdf_close($pdf); $data = pdf_get_buffer($pdf);
/** * Filename.......: example.3.php * Project........: HTML Mime Mail class * Last Modified..: 15 July 2002 */ error_reporting(E_ALL); include('htmlMimeMail.php');
/** * Example of usage. This example shows * how to use the class to send a plain * text email with an attachment. No html, * or embedded images. * * Create the mail object. */ $mail = new htmlMimeMail(); /** * Read the file test.zip into $attachment. */ $attachment = $mail->getFile('test.pdf');
/** * Since we're sending a plain text email, * we only need to read in the text file. */ $text = $mail->getFile('example.txt');
/** * To set the text body of the email, we * are using the setText() function. This * is an alternative to the setHtml() function * which would obviously be inappropriate here. */ $mail->setText($text);
/** * This is used to add an attachment to * the email. */ $mail->addAttachment($attachment, 'test.pdf', 'application/zip');
/**
* Sends the message.
*/
$mail->setFrom('Joe <kemu
sdf-eu.org');
$result = $mail->send(array('"Richard" <kemu
sdf-eu.org>'));
echo $result ? 'Mail sent!' : 'Failed to send mail';
the mail get's send but I get this error Warning: fopen("test.pdf", "rb") - No such file or directory in /home/web/intranet/httpdocs/htmlMimeMail.php on line 162 and test.pdf is included in the mail but is 0kb big anyone sees the prob ?
attached mail follows:
$mail->getFile() obviously reads in a file from the disk. You already have your attachment in memory, so don't call that function. Just do $attachment = $data;
-Rasmus
On Sun, 29 Sep 2002, Jonas Geiregat wrote:
> this is my code what I want to do is
> generate a pdf file(not save it on hd of server but in memory)
> then send it as attachement to someone
>
> $pdf = pdf_new();
>
> pdf_open_file($pdf,"");
> pdf_begin_page($pdf, 595, 842);
> pdf_set_font($pdf, "Times-Roman", 30, "host");
> pdf_set_value($pdf, "textrendering", 1);
> pdf_show_xy($pdf, "A PDF document created in memory!", 50, 750);
> pdf_end_page($pdf);
> pdf_close($pdf);
> $data = pdf_get_buffer($pdf);
>
>
> /**
> * Filename.......: example.3.php
> * Project........: HTML Mime Mail class
> * Last Modified..: 15 July 2002
> */
> error_reporting(E_ALL);
> include('htmlMimeMail.php');
>
> /**
> * Example of usage. This example shows
> * how to use the class to send a plain
> * text email with an attachment. No html,
> * or embedded images.
> *
> * Create the mail object.
> */
> $mail = new htmlMimeMail();
>
> /**
> * Read the file test.zip into $attachment.
> */
> $attachment = $mail->getFile('test.pdf');
>
> /**
> * Since we're sending a plain text email,
> * we only need to read in the text file.
> */
> $text = $mail->getFile('example.txt');
>
> /**
> * To set the text body of the email, we
> * are using the setText() function. This
> * is an alternative to the setHtml() function
> * which would obviously be inappropriate here.
> */
> $mail->setText($text);
>
> /**
> * This is used to add an attachment to
> * the email.
> */
> $mail->addAttachment($attachment, 'test.pdf', 'application/zip');
>
> /**
> * Sends the message.
> */
> $mail->setFrom('Joe <kemu
sdf-eu.org');
> $result = $mail->send(array('"Richard" <kemu
sdf-eu.org>'));
>
> echo $result ? 'Mail sent!' : 'Failed to send mail';
>
>
> the mail get's send but I get this error
> Warning: fopen("test.pdf", "rb") - No such file or directory in
> /home/web/intranet/httpdocs/htmlMimeMail.php on line 162
> and test.pdf is included in the mail but is 0kb big
> anyone sees the prob ?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hey guys, I know this is totally off topic on a php list but I have a client who wants a PDF document and since I have never made one before...which is the easiest and best tool (hopefully free) to make a PDF form? I know a lot of you guys make websites yourselfs and most proberly worked on something like this so any comments,suggestions or links are appreciated. Cheers, -Ryan.
attached mail follows:
hey! you cant say hey guys these days - there are females in the industry too u know :)
----- Original Message -----
From: "Ryan A" <r
jumac.com>
To: <php-general
lists.php.net>
Sent: Sunday, September 29, 2002 7:40 PM
Subject: [PHP] OT-best PDF creation tool
Hey guys, I know this is totally off topic on a php list but I have a client who wants a PDF document and since I have never made one before...which is the easiest and best tool (hopefully free) to make a PDF form? I know a lot of you guys make websites yourselfs and most proberly worked on something like this so any comments,suggestions or links are appreciated. Cheers, -Ryan.
attached mail follows:
I was reading the sept. issue of linux magazine and they discussed security issues with web apps. They mentioned that to generate signatures, you should include a secret with your hash function: s = S(m) = H(secret, H(m, secret)) What is the secret, just a sort of secret code that you include, like some sort of random password: " gr8ckret46eme " as an example ???
attached mail follows:
I don't see how it could be randomly generated else how would you be able to use it for authenticating etc but then I'm not a security expert. I use a long character string known only to me and stored outside my web directory. Maybe other ppl do differently I don't know.
----- Original Message -----
From: "Pablo Oliva" <poliva
cox.net>
To: <php-general
lists.php.net>
Sent: Sunday, September 29, 2002 7:52 PM
Subject: [PHP] hash function secret
> I was reading the sept. issue of linux magazine and they discussed > security issues with web apps. > > They mentioned that to generate signatures, you should include a secret > with your hash function: > s = S(m) = H(secret, H(m, secret)) > > What is the secret, just a sort of secret code that you include, like > some sort of random password: " gr8ckret46eme " as an example ??? >
attached mail follows:
Hey Debbie, thanks for writing,
Sorry, no offense meant but I call all my pals guys.
Yeah, I know there are females in the industary and i'm sure most of them work for Microsoft writing the error messages that keep on nagging and that make absolutely no sense!
hehhehehe couldnt resist, just kidding.
But before you decide to sell my soul to the devil I promise I shall try to amend my ways and will not so selfishly and meanly write to this OR any other mailing list addressing people with term "guys". :-)
And in closing...let me say, nice name. Cheers, -Ryan.
> hey! you cant say hey guys these days - there are females in the industry
> too u know :)
>
> ----- Original Message -----
> From: "Ryan A" <r
jumac.com>
> To: <php-general
lists.php.net>
> Sent: Sunday, September 29, 2002 7:40 PM
> Subject: [PHP] OT-best PDF creation tool
>
>
> Hey guys,
> I know this is totally off topic on a php list but I have a client who
wants
> a PDF document and since I have never made one before...which is the
easiest
> and best tool (hopefully free) to make a PDF form?
> I know a lot of you guys make websites yourselfs and most proberly worked
on
> something like this so any comments,suggestions or links are appreciated.
> Cheers,
> -Ryan.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Ryan
LOL ok - no offence taken.
And be careful what u promise - tens (hundreds even dont know how many are on this list) of females probably just received it and I am sure you will be well spotted if you break it :)
Debbie
----- Original Message -----
From: "Ryan A" <r
jumac.com>
To: "debbie_dyer" <debbie_dyer
surfanytime.co.uk>
Cc: <php-general
lists.php.net>
Sent: Sunday, September 29, 2002 7:59 PM
Subject: Debbie->Re: [PHP] OT-best PDF creation tool
> Hey Debbie,
> thanks for writing,
>
> Sorry, no offense meant but I call all my pals guys.
>
> Yeah, I know there are females in the industary and i'm sure most of them
> work for Microsoft writing the error messages that keep on nagging and
that
> make absolutely no sense!
>
> hehhehehe couldnt resist, just kidding.
>
> But before you decide to sell my soul to the devil I promise I shall try
to
> amend my ways and will not so selfishly and meanly write to this OR any
> other mailing list addressing people with term "guys". :-)
>
> And in closing...let me say, nice name.
> Cheers,
> -Ryan.
>
> > hey! you cant say hey guys these days - there are females in the
industry
> > too u know :)
> >
> > ----- Original Message -----
> > From: "Ryan A" <r
jumac.com>
> > To: <php-general
lists.php.net>
> > Sent: Sunday, September 29, 2002 7:40 PM
> > Subject: [PHP] OT-best PDF creation tool
> >
> >
> > Hey guys,
> > I know this is totally off topic on a php list but I have a client who
> wants
> > a PDF document and since I have never made one before...which is the
> easiest
> > and best tool (hopefully free) to make a PDF form?
> > I know a lot of you guys make websites yourselfs and most proberly
worked
> on
> > something like this so any comments,suggestions or links are
appreciated.
> > Cheers,
> > -Ryan.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
attached mail follows:
I made a MySQL database with a dictionary in it. Above there is a form in wich you can specify some parameters. The problem is that the navigation doesn't work well. I always get the first 5 results. Can somebody help me out? There are about 56 records in the database.
The (not quite) working thing is on: http://www.oostendseverhalen.be/test_met_navigatie3.php
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head>
<body>
<?php
/* hieronder volgt het formulier */ echo ' <table width="100%" border="0" alig