php-general Digest 30 May 2002 09:54:49 -0000 Issue 1375
Topics (messages 99807 through 99866):
Re: Warning: Cannot add header information - headers already sent by
99807 by: Ed Gorski
99809 by: 1LT John W. Holmes
99842 by: Miguel Cruz
99856 by: Tom Rogers
Simple Mailing List
99808 by: Randum Ian
99817 by: Bogdan Stancescu
Re: ******************* Secure product download *******************
99810 by: 1LT John W. Holmes
99811 by: Ron Stagg
99812 by: Shaun Thomas
99822 by: 1LT John W. Holmes
FTP APPLE SERVER PROBLEM
99813 by: Alexandra Aguiar
PHP & Dreamweaver ...
99814 by: Peter
Variable Variables
99815 by: David Freeman
99816 by: David Freeman
99818 by: Philip Olson
99843 by: David Freeman
generating next number... from db extraction
99819 by: Peter
99823 by: 1LT John W. Holmes
99824 by: Peter
99828 by: 1LT John W. Holmes
99834 by: Peter
99854 by: Tom Rogers
Re: mail() function is successful but page hangs
99820 by: Justin French
using stdin in php
99821 by: rdkurth.starband.net
99840 by: Miguel Cruz
File Path - Which way is better ?
99825 by: Manisha
99826 by: Martin Towell
99827 by: Manisha
99829 by: 1LT John W. Holmes
99830 by: Martin Towell
99833 by: Manisha
File Upload
99831 by: Edward Marczak
99835 by: Gerard Samuel
Mail Archives
99832 by: Natarajan
99838 by: Evan Nemerson
99841 by: Demitrious S. Kelly
Only the last cookie is set!
99836 by: Jagannath Nori
POST Format
99837 by: Jonathan Rosenberg
99839 by: Demitrious S. Kelly
99851 by: Philip Olson
Re: Entering password on a command line
99844 by: Analysis & Solutions
PostgreSQL - WHILE loop working too well / WARNING: Unable to jump to row 2 on
PostgreSQL...
99845 by: Steve G
99852 by: Jason Wong
Month Values in UNIX timestamps and workaround(Newbie)
99846 by: webmaster.tececo.com
for loops
99847 by: Peter
99853 by: Jason Wong
Write permission problem
99848 by: Manisha
99850 by: Martin Towell
English translations ???
99849 by: jon shoberg
Re: Searching Many Text Documents
99855 by: Sebastian A.
Help with example session class
99857 by: Daevid Vincent
httpd runs forever
99858 by: Jacob Friis Larsen
99861 by: Tom Mikulecky
mail() returned a strange error, what is this?
99859 by: Magnus Hammar
Ad:
99860 by: Tale.Berntsen.sib.uib.no
your philosophy on php-design
99862 by: Wilbert Enserink
Global variables
99863 by: serge gedeon
99864 by: serge gedeon
99865 by: James Holden
JAVA extension install
99866 by: fincom
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
You need to put line 6 ahead of all the HTML, ie make it line 0.
ed
At 04:10 AM 5/30/2002 -0700, Anton Heryato wrote:
>this script below is delete.inc
>and the lagi.php is ..
>1:<html><head><title>:PHp</title></head>
>2:<body>
>3:<h1>hahahahha</h1>
>4:<?
>5:require 'delete.inc';
>6:deleteCookies();
>7:printf("can do it`");
>8:
>9:?>
>10:</body>
>11:</html>
>
>so, which one in line 4 have send anything first
>please help me to fixed
>
>regards
>anton
>
>-----Original Message-----
>From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, May 29, 2002 1:37 PM
>To: Anton Heryato; [EMAIL PROTECTED]
>Subject: Re: [PHP] Warning: Cannot add header information - headers
>already sent by
>
>
>You can't send anything to the browser before you send a header or cookie.
>Apparently, lagi.php has sent something, though, on line 4. Fix that and you
>will be fine.
>
>---John Holmes...
>
>----- Original Message -----
>From: "Anton Heryato" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, May 30, 2002 6:37 AM
>Subject: [PHP] Warning: Cannot add header information - headers already sent
>by
>
>
> > i have one function name deleteCookees that have this error message
> >
> > Warning: Cannot add header information - headers already sent by (output
> > started at /home/reymond/html/phpreport/lagi.php:4) in
> > /home/reymond/html/phpreport/delete.inc on line 10
> > the script
> >
> > <?
> > function deleteCookies()
> > {
> > for ($i=0; $i<$total_items; $i++)
> > {
> > setcookie("items_tray[$i]","");
> > setcookie("quantity[$i]","");
> > }
> >
> > setcookie("items_tray","");
> > setcookie("total_items","");
> > setcookie("quantity","");
> >
> > }
> > ?>
> >
> > could anybody tell me why this happen and howto fixed
> >
> >
> > --
> > 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
--- End Message ---
--- Begin Message ---
> 1:<html><head><title>:PHp</title></head>
> 2:<body>
> 3:<h1>hahahahha</h1>
Maybe it's just me, but those 3 lines look like they are sending something
to the browser....
> so, which one in line 4 have send anything first
> please help me to fixed
>
> regards
> anton
---John Holmes...
--- End Message ---
--- Begin Message ---
Lines 1, 2, and 3 are sending text to the browser.
You need to do your header operations first, THEN output the HTML.
Or put <? ob_start() ?> at the VERY beginning of the file (before any
HTML, before any blank space, before anything else).
miguel
On Thu, 30 May 2002, Anton Heryato wrote:
> this script below is delete.inc
> and the lagi.php is ..
> 1:<html><head><title>:PHp</title></head>
> 2:<body>
> 3:<h1>hahahahha</h1>
> 4:<?
> 5:require 'delete.inc';
> 6:deleteCookies();
> 7:printf("can do it`");
> 8:
> 9:?>
> 10:</body>
> 11:</html>
>
> so, which one in line 4 have send anything first
> please help me to fixed
>
> regards
> anton
>
> -----Original Message-----
> From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 1:37 PM
> To: Anton Heryato; [EMAIL PROTECTED]
> Subject: Re: [PHP] Warning: Cannot add header information - headers
> already sent by
>
>
> You can't send anything to the browser before you send a header or cookie.
> Apparently, lagi.php has sent something, though, on line 4. Fix that and you
> will be fine.
>
> ---John Holmes...
>
> ----- Original Message -----
> From: "Anton Heryato" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 30, 2002 6:37 AM
> Subject: [PHP] Warning: Cannot add header information - headers already sent
> by
>
>
> > i have one function name deleteCookees that have this error message
> >
> > Warning: Cannot add header information - headers already sent by (output
> > started at /home/reymond/html/phpreport/lagi.php:4) in
> > /home/reymond/html/phpreport/delete.inc on line 10
> > the script
> >
> > <?
> > function deleteCookies()
> > {
> > for ($i=0; $i<$total_items; $i++)
> > {
> > setcookie("items_tray[$i]","");
> > setcookie("quantity[$i]","");
> > }
> >
> > setcookie("items_tray","");
> > setcookie("total_items","");
> > setcookie("quantity","");
> >
> > }
> > ?>
> >
> > could anybody tell me why this happen and howto fixed
> >
> >
> > --
> > 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
>
>
>
>
--- End Message ---
--- Begin Message ---
Hi
lines 123 are all outputting info, do the php stuff first
<?
require 'delete.inc';
deleteCookies();
printf("done");
?>
<html ...........
Tom
At 04:10 AM 30/05/2002 -0700, Anton Heryato wrote:
>this script below is delete.inc
>and the lagi.php is ..
>1:<html><head><title>:PHp</title></head>
>2:<body>
>3:<h1>hahahahha</h1>
>4:<?
>5:require 'delete.inc';
>6:deleteCookies();
>7:printf("can do it`");
>8:
>9:?>
>10:</body>
>11:</html>
>
>so, which one in line 4 have send anything first
>please help me to fixed
>
>regards
>anton
>
>-----Original Message-----
>From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, May 29, 2002 1:37 PM
>To: Anton Heryato; [EMAIL PROTECTED]
>Subject: Re: [PHP] Warning: Cannot add header information - headers
>already sent by
>
>
>You can't send anything to the browser before you send a header or cookie.
>Apparently, lagi.php has sent something, though, on line 4. Fix that and you
>will be fine.
>
>---John Holmes...
>
>----- Original Message -----
>From: "Anton Heryato" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, May 30, 2002 6:37 AM
>Subject: [PHP] Warning: Cannot add header information - headers already sent
>by
>
>
> > i have one function name deleteCookees that have this error message
> >
> > Warning: Cannot add header information - headers already sent by (output
> > started at /home/reymond/html/phpreport/lagi.php:4) in
> > /home/reymond/html/phpreport/delete.inc on line 10
> > the script
> >
> > <?
> > function deleteCookies()
> > {
> > for ($i=0; $i<$total_items; $i++)
> > {
> > setcookie("items_tray[$i]","");
> > setcookie("quantity[$i]","");
> > }
> >
> > setcookie("items_tray","");
> > setcookie("total_items","");
> > setcookie("quantity","");
> >
> > }
> > ?>
> >
> > could anybody tell me why this happen and howto fixed
> >
> >
> > --
> > 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
--- End Message ---
--- Begin Message ---
Hi there, I need to sort out a "simple" mail script which does the
following. I have started the brainstorm if someone else could help with the
missing bits, where to look, etc:
CHECK POP3 MAIL FOR MSG:
--> crontab, but how???
IF MSG CHECK FROM EMAIL:
--> put mail into array then check from mail against db???
IF IT IS SEND TO EMAILS IN DB
--> mail(blah)
Therefore if an email is sent to '[EMAIL PROTECTED]' then it would be forwarded
to everybody in the email db. This is as much as I need so was thinking of
writing my own instead of using something else. Any views?
Cheers, Ian.
---
Randum Ian
DJ / Reviewer / Webmaster, DancePortal (UK) Limited
[EMAIL PROTECTED]
http://www.danceportal.co.uk
DancePortal.co.uk - Global dance music media
--- End Message ---
--- Begin Message ---
Randum Ian wrote:
>Hi there, I need to sort out a "simple" mail script which does the
>following. I have started the brainstorm if someone else could help with the
>missing bits, where to look, etc:
>
>CHECK POP3 MAIL FOR MSG:
>
>--> crontab, but how???
>
Check out either running php from terminal or use wget/lynx to access a
certain page.
>IF MSG CHECK FROM EMAIL:
>
>--> put mail into array then check from mail against db???
>
That is, if you want to store the e-mail server-side. Alternatively, you
can check destinations and send on-the-fly. Don't forget deleting the
e-mail from the server - I don't remember if it's a setting for
retrieving (flush) or if it's a distinct action for POP3. Alternatively
use an IMAP account and set the mail as read and move old mail to
folders based on date (monthly archives). Obviously, this is a personal
suggestion for a simple server - you could then check from outside using
IMAPS.
>IF IT IS SEND TO EMAILS IN DB
>
>--> mail(blah)
>
>Therefore if an email is sent to '[EMAIL PROTECTED]' then it would be forwarded
>to everybody in the email db. This is as much as I need so was thinking of
>writing my own instead of using something else. Any views?
>
>Cheers, Ian.
>---
>Randum Ian
>DJ / Reviewer / Webmaster, DancePortal (UK) Limited
>[EMAIL PROTECTED]
>http://www.danceportal.co.uk
>DancePortal.co.uk - Global dance music media
>
>
>
>
--- End Message ---
--- Begin Message ---
Umm....no they can't. pay_first.php is what you send them to if they don't
have a correct session. If the session is correct, show the download page.
Notice the ! in front of isset().
---John Holmes...
----- Original Message -----
From: "Ron Stagg" <[EMAIL PROTECTED]>
To: "1LT John W. Holmes" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 5:02 PM
Subject: RE: [PHP] ******************* Secure product download
*******************
Yes, but unauthorized users can still just key in the URL
(http://www.example.com/pay_first.php) into their browser and get around
the session verification.
I have toyed around with dynamically building the file when it is
needed, but I need to delete it once it has been downloaded by the user.
How can I delete a file as soon as it has been downloaded?
Ron Stagg
-----Original Message-----
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 2:57 PM
To: Ron Stagg; [EMAIL PROTECTED]
Subject: Re: [PHP] ******************* Secure product download
*******************
session_start();
if(!isset($_SESSION["did_pay"]))
{ header("Location: http://www.example.com/pay_first.php"); }
//show download code....
Obviously you set $_SESSION['did_pay'] to a value once they, umm, pay.
---John Holmes...
----- Original Message -----
From: "Ron Stagg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 4:47 PM
Subject: [PHP] ******************* Secure product download
*******************
I am building a site where visitors can purchase and download software.
To purchase a software product, the visitor must submit credit card
info. Once the purchase has been approved, the user is given a link
from which he/she may download the requested software. This link MUST
only be accessible to those who have paid. I have tried a number of
different and creative methods, but none give me the security I need. I
don't want the user to be able bookmark the URL or email the URL to
friends so that they can download the software as well. I am using PHP
sessions combined with MySQL user accounts to authenticate users
throughout the rest of the site. How can I get this to work for
downloads?
Is this even possible within the open realm of the browser? Have any of
you solved a similar problem? I welcome any ideas.
Ron Stagg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
John,
I appreciate your advice here. Please tolerate another question:
Your code example had the comment "//show download code....". That is
what I need. What is the "download code"?
Thanks,
Ron
-----Original Message-----
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 3:29 PM
To: Ron Stagg; [EMAIL PROTECTED]
Subject: Re: [PHP] ******************* Secure product download
*******************
Umm....no they can't. pay_first.php is what you send them to if they
don't
have a correct session. If the session is correct, show the download
page.
Notice the ! in front of isset().
---John Holmes...
----- Original Message -----
From: "Ron Stagg" <[EMAIL PROTECTED]>
To: "1LT John W. Holmes" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 5:02 PM
Subject: RE: [PHP] ******************* Secure product download
*******************
Yes, but unauthorized users can still just key in the URL
(http://www.example.com/pay_first.php) into their browser and get around
the session verification.
I have toyed around with dynamically building the file when it is
needed, but I need to delete it once it has been downloaded by the user.
How can I delete a file as soon as it has been downloaded?
Ron Stagg
-----Original Message-----
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 2:57 PM
To: Ron Stagg; [EMAIL PROTECTED]
Subject: Re: [PHP] ******************* Secure product download
*******************
session_start();
if(!isset($_SESSION["did_pay"]))
{ header("Location: http://www.example.com/pay_first.php"); }
//show download code....
Obviously you set $_SESSION['did_pay'] to a value once they, umm, pay.
---John Holmes...
----- Original Message -----
From: "Ron Stagg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 4:47 PM
Subject: [PHP] ******************* Secure product download
*******************
I am building a site where visitors can purchase and download software.
To purchase a software product, the visitor must submit credit card
info. Once the purchase has been approved, the user is given a link
from which he/she may download the requested software. This link MUST
only be accessible to those who have paid. I have tried a number of
different and creative methods, but none give me the security I need. I
don't want the user to be able bookmark the URL or email the URL to
friends so that they can download the software as well. I am using PHP
sessions combined with MySQL user accounts to authenticate users
throughout the rest of the site. How can I get this to work for
downloads?
Is this even possible within the open realm of the browser? Have any of
you solved a similar problem? I welcome any ideas.
Ron Stagg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Wed, 29 May 2002, Ron Stagg wrote:
> Is this even possible within the open realm of the browser? Have any of
> you solved a similar problem? I welcome any ideas.
Your solution is pretty easy. Assign a php script that will actually
send the download. At this point, your PHP script can do whatever
integrity checking you need for you to be satisfied payment occurred.
Then all you need to do is send a couple of headers and stream the file
directly to the end user.
I'd suggest headers like this:
<?PHP
/*
I'll assume you do authentication and whatnot up here. Errors,
warnings, redirects, whatever... all go up here. When you're
satisfied, move on to the stuff below. Make sure no other headers
have been sent by this point.
*/
header("Content-type: application/zip");
header("Content-Disposition: filename=\"the_file_name_you_want.zip\"");
// At this point, you may either construct, or stream whatever data
// you want. Just make sure it matches your declared Content-type.
readfile("any_file_you_want.zip");
?>
And done.
If you put the file you send somewhere out of the document root, the
download location can't even be reverse-engineered. This script is the
only way to get that file.
--
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Shaun M. Thomas INN Database Administrator |
| Phone: (309) 743-0812 Fax : (309) 743-0830 |
| Email: [EMAIL PROTECTED] AIM : trifthen |
| Web : www.townnews.com |
| |
| "Most of our lives are about proving something, either to |
| ourselves or to someone else." |
| -- Anonymous |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
--- End Message ---
--- Begin Message ---
[snip]
> If you put the file you send somewhere out of the document root, the
> download location can't even be reverse-engineered. This script is
the
> only way to get that file.
That's the key, right there. Combining that with sessions will make it
so that only people with the appropriate session will be able to access
the download script. Keeping it outside of the web root will make it so
no one can just type in the URL to the file.
---John Holmes...
--- End Message ---
--- Begin Message ---
Hi guys..
i've got a problem...
i'm remaking a webftp system...
i took some base of it on the web... great..
So.. one of the features is : it appears the name of a directory and how
many files are in it.
like that :
DIR (5) == 5 files on the DIR
i use
$arq=ftp_nlist($connection, "$xanda");
and count($arq) then i got how many files are on this DIR.
that works fine in threee different servers. But on an APPLE server, it
doesn't...
Anybody knows if the APPLE server has a different filesystem that could make
that trouble or any other stuff ?!?
PLZ HELP MEEEE !!!!!
Thnx in advance ...
Alexandra Aguiar
--- End Message ---
--- Begin Message ---
Howdy Peoples,
Just thought I'd let those interested know that Macromedia's new version of
Dreamweaver (Dreamweaver MX) now supports PHP & MYSQL, along with the other
usual suspects.
Cheers
Peter
"the only dumb question is the one that wasn't asked"
--- End Message ---
--- Begin Message ---
Hi All,
I've been trying to figure this out based on stuff on php.net but can't
seem to get a result I need.
I have an array:
$formarray = array ("form1" => "var1", "form2" => "var2");
And now I'm using that array to create a form (fairly abbreviated):
while (list($key, $val) = each($formarray))
{
echo "$val:";
echo "<input name=\"$key\">
}
What I'm looking to do is set a value in my input tag if a value has
been set. That is, if this form has been submitted then the variable
$form1 will contain a value (well, $POST[$form1] will but you get the
idea).
I want to test if $form1 has a value and if it does then I can add a
value= arg in my input tag.
I've got as far as working out that $$key will give me the equivalent of
$form1 but how do I then work out if $form1 has a value?
CYA, Dave
--- End Message ---
--- Begin Message ---
> I've got as far as working out that $$key will give me the
> equivalent of $form1 but how do I then work out if $form1
> has a value?
Never mind, ${$key} was what I was looking for - my test case set the
wrong variable and that's why it didn't seem to be working.
CYA, Dave
--- End Message ---
--- Begin Message ---
> Never mind, ${$key} was what I was looking for - my test case set the
> wrong variable and that's why it didn't seem to be working.
You may want to code with E_NOTICE errors showing. To
show all levels, use error_reporting:
error_reporting(E_ALL);
This will show you undefined variables, and then some.
Note that error_reporting is both a function (runtime)
and a php directive.
Most PHP users feel that developing with E_ALL is good.
Regards,
Philip Olson
>
> CYA, Dave
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
> You may want to code with E_NOTICE errors showing. To
> show all levels, use error_reporting:
>
> error_reporting(E_ALL);
Yeah, I already do that...
CYA, Dave
--- End Message ---
--- Begin Message ---
hi,
I'm making a quoting system and need to have letters & Numbers inside the
quote number. Now if I was to grab the last quote number inserted into the
db and then do something like
//example of $quoteID value w/out letters
$quoteID = 20120250;
//example of $quoteID with letters
//$quoteID = abc20250;
$quoteNUM = $quoteID + 1;
echo $quoteNUM;
it will work fine .. but the minute i add a letter to this is doesn't... now
I know I can generate random numbers and letters but I need to have some
order about it so the quote numbers are not all over the place... Also as an
addition providing I can get this working .. I would also like to have it so
that if a quote was updated the quoteID would be changed ... eg: if the
quote number was abc20250 after it was updated it would be abc20250-A or
something along those lines ...
Cheers
Peter
"the only dumb question is the one that wasn't asked"
--- End Message ---
--- Begin Message ---
Why does it have to be letters and numbers? You're just making more
work. You can use an auto_increment field and not worry about it
(assuming MySQL).
You can also use uniqid() and md5() to make a unique string, but it'll
be 32 characters long. Maybe crypt() is 16 characters...dunno, but you
could try that.
www.php.net/uniqid
---John Holmes...
> -----Original Message-----
> From: Peter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 8:28 PM
> To: Php
> Subject: [PHP] generating next number... from db extraction
>
> hi,
>
> I'm making a quoting system and need to have letters & Numbers inside
the
> quote number. Now if I was to grab the last quote number inserted into
the
> db and then do something like
>
> //example of $quoteID value w/out letters
> $quoteID = 20120250;
> //example of $quoteID with letters
> //$quoteID = abc20250;
>
> $quoteNUM = $quoteID + 1;
> echo $quoteNUM;
>
> it will work fine .. but the minute i add a letter to this is
doesn't...
> now
> I know I can generate random numbers and letters but I need to have
some
> order about it so the quote numbers are not all over the place... Also
as
> an
> addition providing I can get this working .. I would also like to have
it
> so
> that if a quote was updated the quoteID would be changed ... eg: if
the
> quote number was abc20250 after it was updated it would be abc20250-A
or
> something along those lines ...
>
>
>
> Cheers
>
> Peter
> "the only dumb question is the one that wasn't asked"
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
unfortunately they want letters in it ... I know it would be easier to hav
auto_incroment.. and wish I could just leave it at that ..
for the bulk of it i could get away with having no letters but they have
requested to have the letter in the update part .... eg 12345 becomes
12345-A after the update ...
-----Original Message-----
From: John Holmes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 30 May 2002 11:22 AM
To: 'Peter'; 'Php'
Subject: RE: [PHP] generating next number... from db extraction
Why does it have to be letters and numbers? You're just making more
work. You can use an auto_increment field and not worry about it
(assuming MySQL).
You can also use uniqid() and md5() to make a unique string, but it'll
be 32 characters long. Maybe crypt() is 16 characters...dunno, but you
could try that.
www.php.net/uniqid
---John Holmes...
> -----Original Message-----
> From: Peter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 8:28 PM
> To: Php
> Subject: [PHP] generating next number... from db extraction
>
> hi,
>
> I'm making a quoting system and need to have letters & Numbers inside
the
> quote number. Now if I was to grab the last quote number inserted into
the
> db and then do something like
>
> //example of $quoteID value w/out letters
> $quoteID = 20120250;
> //example of $quoteID with letters
> //$quoteID = abc20250;
>
> $quoteNUM = $quoteID + 1;
> echo $quoteNUM;
>
> it will work fine .. but the minute i add a letter to this is
doesn't...
> now
> I know I can generate random numbers and letters but I need to have
some
> order about it so the quote numbers are not all over the place... Also
as
> an
> addition providing I can get this working .. I would also like to have
it
> so
> that if a quote was updated the quoteID would be changed ... eg: if
the
> quote number was abc20250 after it was updated it would be abc20250-A
or
> something along those lines ...
>
>
>
> Cheers
>
> Peter
> "the only dumb question is the one that wasn't asked"
>
>
>
> --
> 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
--- End Message ---
--- Begin Message ---
Okay...here's the "what they don't know won't hurt them solution":
CREATE TABLE (ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, Cnt CHAR(2),
Quote TEXT) AUTO_INCREMENT = 20120250;
Adjust your table accordingly, but the idea is that this auto_increment
column will now start counting at 20120250 and go up from there. So you
can get away with starting at a 7 or 8 digit number and make the quote
IDs look like they want. Use the 'Cnt' column as the "update" column.
Start it out with empty string as default. On first revision set it to
'A', etc. If you select out this column, you can use PHP to "add" a
letter. i.e.
for($x='a';$x<='z';$x++)
{ echo $x; }
That'll print the letters of the alphabet. Use the same concept to add
one to 'A' and get 'B'.
So the client will be happy b/c it looks like they want and you'll be
happy b/c you're using an auto_increment column.
---John Holmes...
> -----Original Message-----
> From: Peter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 9:38 PM
> To: Php
> Subject: RE: [PHP] generating next number... from db extraction
>
> unfortunately they want letters in it ... I know it would be easier
to
> hav
> auto_incroment.. and wish I could just leave it at that ..
>
> for the bulk of it i could get away with having no letters but they
have
> requested to have the letter in the update part .... eg 12345 becomes
> 12345-A after the update ...
>
> -----Original Message-----
> From: John Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 30 May 2002 11:22 AM
> To: 'Peter'; 'Php'
> Subject: RE: [PHP] generating next number... from db extraction
>
>
> Why does it have to be letters and numbers? You're just making more
> work. You can use an auto_increment field and not worry about it
> (assuming MySQL).
>
> You can also use uniqid() and md5() to make a unique string, but it'll
> be 32 characters long. Maybe crypt() is 16 characters...dunno, but you
> could try that.
>
> www.php.net/uniqid
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Peter [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 29, 2002 8:28 PM
> > To: Php
> > Subject: [PHP] generating next number... from db extraction
> >
> > hi,
> >
> > I'm making a quoting system and need to have letters & Numbers
inside
> the
> > quote number. Now if I was to grab the last quote number inserted
into
> the
> > db and then do something like
> >
> > //example of $quoteID value w/out letters
> > $quoteID = 20120250;
> > //example of $quoteID with letters
> > //$quoteID = abc20250;
> >
> > $quoteNUM = $quoteID + 1;
> > echo $quoteNUM;
> >
> > it will work fine .. but the minute i add a letter to this is
> doesn't...
> > now
> > I know I can generate random numbers and letters but I need to have
> some
> > order about it so the quote numbers are not all over the place...
Also
> as
> > an
> > addition providing I can get this working .. I would also like to
have
> it
> > so
> > that if a quote was updated the quoteID would be changed ... eg: if
> the
> > quote number was abc20250 after it was updated it would be
abc20250-A
> or
> > something along those lines ...
> >
> >
> >
> > Cheers
> >
> > Peter
> > "the only dumb question is the one that wasn't asked"
> >
> >
> >
> > --
> > 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
--- End Message ---
--- Begin Message ---
Thanks for your help John that works really well :)
Cheers
Peter
-----Original Message-----
From: John Holmes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 30 May 2002 12:08 PM
To: 'Peter'; 'Php'
Subject: RE: [PHP] generating next number... from db extraction
Okay...here's the "what they don't know won't hurt them solution":
CREATE TABLE (ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, Cnt CHAR(2),
Quote TEXT) AUTO_INCREMENT = 20120250;
Adjust your table accordingly, but the idea is that this auto_increment
column will now start counting at 20120250 and go up from there. So you
can get away with starting at a 7 or 8 digit number and make the quote
IDs look like they want. Use the 'Cnt' column as the "update" column.
Start it out with empty string as default. On first revision set it to
'A', etc. If you select out this column, you can use PHP to "add" a
letter. i.e.
for($x='a';$x<='z';$x++)
{ echo $x; }
That'll print the letters of the alphabet. Use the same concept to add
one to 'A' and get 'B'.
So the client will be happy b/c it looks like they want and you'll be
happy b/c you're using an auto_increment column.
---John Holmes...
> -----Original Message-----
> From: Peter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 9:38 PM
> To: Php
> Subject: RE: [PHP] generating next number... from db extraction
>
> unfortunately they want letters in it ... I know it would be easier
to
> hav
> auto_incroment.. and wish I could just leave it at that ..
>
> for the bulk of it i could get away with having no letters but they
have
> requested to have the letter in the update part .... eg 12345 becomes
> 12345-A after the update ...
>
> -----Original Message-----
> From: John Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 30 May 2002 11:22 AM
> To: 'Peter'; 'Php'
> Subject: RE: [PHP] generating next number... from db extraction
>
>
> Why does it have to be letters and numbers? You're just making more
> work. You can use an auto_increment field and not worry about it
> (assuming MySQL).
>
> You can also use uniqid() and md5() to make a unique string, but it'll
> be 32 characters long. Maybe crypt() is 16 characters...dunno, but you
> could try that.
>
> www.php.net/uniqid
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Peter [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 29, 2002 8:28 PM
> > To: Php
> > Subject: [PHP] generating next number... from db extraction
> >
> > hi,
> >
> > I'm making a quoting system and need to have letters & Numbers
inside
> the
> > quote number. Now if I was to grab the last quote number inserted
into
> the
> > db and then do something like
> >
> > //example of $quoteID value w/out letters
> > $quoteID = 20120250;
> > //example of $quoteID with letters
> > //$quoteID = abc20250;
> >
> > $quoteNUM = $quoteID + 1;
> > echo $quoteNUM;
> >
> > it will work fine .. but the minute i add a letter to this is
> doesn't...
> > now
> > I know I can generate random numbers and letters but I need to have
> some
> > order about it so the quote numbers are not all over the place...
Also
> as
> > an
> > addition providing I can get this working .. I would also like to
have
> it
> > so
> > that if a quote was updated the quoteID would be changed ... eg: if
> the
> > quote number was abc20250 after it was updated it would be
abc20250-A
> or
> > something along those lines ...
> >
> >
> >
> > Cheers
> >
> > Peter
> > "the only dumb question is the one that wasn't asked"
> >
> >
> >
> > --
> > 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
--- End Message ---
--- Begin Message ---
Hi
You could use the auto increment feature of mysql and store the prefix and
suffix as seperate fields in the database like
idnum|prefix|suffix|data........
1234:abc|A
Then just add them together to form the complete order number.
Tom
At 10:27 AM 30/05/2002 +1000, Peter wrote:
>hi,
>
>I'm making a quoting system and need to have letters & Numbers inside the
>quote number. Now if I was to grab the last quote number inserted into the
>db and then do something like
>
>//example of $quoteID value w/out letters
>$quoteID = 20120250;
>//example of $quoteID with letters
>//$quoteID = abc20250;
>
>$quoteNUM = $quoteID + 1;
>echo $quoteNUM;
>
>it will work fine .. but the minute i add a letter to this is doesn't... now
>I know I can generate random numbers and letters but I need to have some
>order about it so the quote numbers are not all over the place... Also as an
>addition providing I can get this working .. I would also like to have it so
>that if a quote was updated the quoteID would be changed ... eg: if the
>quote number was abc20250 after it was updated it would be abc20250-A or
>something along those lines ...
>
>
>
>Cheers
>
>Peter
>"the only dumb question is the one that wasn't asked"
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
How many emails are you sending? A batch of 100? or just one?
Have you ever successfully sent an email?
Have you tested using just one email address (rather than bulk)?
If you sending a bulk, my guess is the process is taking longer than the
maximum time allowed for a script on your server.
If not, my guess is that mail > PHP has not been connected properly during
install.
Regards,
Justin French
on 30/05/02 2:52 AM, Phil Schwarzmann ([EMAIL PROTECTED]) wrote:
> So it looks as if the mail() function seems to work for me but whenever
> the script is executed, it web page just hangs!
>
> Why do you think the web page keeps hanging up (after a couple minutes
> the user eventually gets a 'page not found' error - at least i think
> that's the error), but the script still works and the e-mail message is
> sent?
>
> Strange.
>
--- End Message ---
--- Begin Message ---
Could somebody look at this a tell me way it does not set the
password correctly. I know it has to run at root this has been
handled.
I think my problem is with --stdin. It sets a password but it does not
set it correctly
$cmd = "echo $newpassword | passwd --stdin $user";
return(exec($cmd));
--
Best regards,
rdkurth mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
On Wed, 29 May 2002 [EMAIL PROTECTED] wrote:
> Could somebody look at this a tell me way it does not set the
> password correctly. I know it has to run at root this has been
> handled.
> I think my problem is with --stdin. It sets a password but it does not
> set it correctly
>
> $cmd = "echo $newpassword | passwd --stdin $user";
> return(exec($cmd));
In order to feed to stdin on another process, I think you need to use
this:
http://php.net/popen
miguel
--- End Message ---
--- Begin Message ---
I am using file to read / write data. When I give file path I can give it
in 2 ways.
- As a Virtual path
- Real physical complete path.
Which way is better and in which situation ? I just want to open up
discussion so that I will come to know the pros and cons for both the methods.
Thanks in advance and regards
Manisha
--- End Message ---
--- Begin Message ---
IMO: use relative paths if the two files will be in the same place relative
to each other, otherwise use absolute
-----Original Message-----
From: Manisha [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 11:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP] File Path - Which way is better ?
I am using file to read / write data. When I give file path I can give it
in 2 ways.
- As a Virtual path
- Real physical complete path.
Which way is better and in which situation ? I just want to open up
discussion so that I will come to know the pros and cons for both the
methods.
Thanks in advance and regards
Manisha
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
e.g my directory structure is like below
/usr/manisha/www/invitation - where all php files are situated
/usr/manisha/incFiles - where all files are situated - from where I want to
read
There are also some files
/usr/manisha/www/invitation/msgFiles - From this directory also I am
reading some files
So you mean to say for the first one read thr direct path for second one
virtual path ?
What is reason behind it ? Is it that for first one it is not possible to
provide the virtual path (../../incFiles )?
At 11:54 AM 5/30/02 +1000, you wrote:
>IMO: use relative paths if the two files will be in the same place relative
>to each other, otherwise use absolute
>
>-----Original Message-----
>From: Manisha [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, May 30, 2002 11:51 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] File Path - Which way is better ?
>
>
>I am using file to read / write data. When I give file path I can give it
>in 2 ways.
>
>- As a Virtual path
>- Real physical complete path.
>
>Which way is better and in which situation ? I just want to open up
>discussion so that I will come to know the pros and cons for both the
>methods.
>
>
>Thanks in advance and regards
>Manisha
>
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You can use an absolute path for both, or use a relative path for both.
You can use ../../etc as your path. Just use whatever is easier for you
to understand and code. It doesn't make a difference.
---John Holmes...
> -----Original Message-----
> From: Manisha [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 10:02 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] File Path - Which way is better ?
>
> e.g my directory structure is like below
>
>
> /usr/manisha/www/invitation - where all php files are situated
>
> /usr/manisha/incFiles - where all files are situated - from where I
want
> to
> read
>
> There are also some files
>
> /usr/manisha/www/invitation/msgFiles - From this directory also I am
> reading some files
>
> So you mean to say for the first one read thr direct path for second
one
> virtual path ?
> What is reason behind it ? Is it that for first one it is not possible
to
> provide the virtual path (../../incFiles )?
>
>
>
>
>
>
> At 11:54 AM 5/30/02 +1000, you wrote:
> >IMO: use relative paths if the two files will be in the same place
> relative
> >to each other, otherwise use absolute
> >
> >-----Original Message-----
> >From: Manisha [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, May 30, 2002 11:51 AM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] File Path - Which way is better ?
> >
> >
> >I am using file to read / write data. When I give file path I can
give it
> >in 2 ways.
> >
> >- As a Virtual path
> >- Real physical complete path.
> >
> >Which way is better and in which situation ? I just want to open up
> >discussion so that I will come to know the pros and cons for both the
> >methods.
> >
> >
> >Thanks in advance and regards
> >Manisha
> >
> >
> >
> >
> >
> >
> >--
> >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
--- End Message ---
--- Begin Message ---
What I'm saying is that if these files are in the same place, relative to
each other (this includes using "../") then I think it's easier to use
relative paths. The exception to this would be if the relative path length
is longer than the absolute path length
-----Original Message-----
From: Manisha [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 12:02 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] File Path - Which way is better ?
e.g my directory structure is like below
/usr/manisha/www/invitation - where all php files are situated
/usr/manisha/incFiles - where all files are situated - from where I want to
read
There are also some files
/usr/manisha/www/invitation/msgFiles - From this directory also I am
reading some files
So you mean to say for the first one read thr direct path for second one
virtual path ?
What is reason behind it ? Is it that for first one it is not possible to
provide the virtual path (../../incFiles )?
At 11:54 AM 5/30/02 +1000, you wrote:
>IMO: use relative paths if the two files will be in the same place relative
>to each other, otherwise use absolute
>
>-----Original Message-----
>From: Manisha [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, May 30, 2002 11:51 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] File Path - Which way is better ?
>
>
>I am using file to read / write data. When I give file path I can give it
>in 2 ways.
>
>- As a Virtual path
>- Real physical complete path.
>
>Which way is better and in which situation ? I just want to open up
>discussion so that I will come to know the pros and cons for both the
>methods.
>
>
>Thanks in advance and regards
>Manisha
>
>
>
>
>
>
>--
>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
--- End Message ---
--- Begin Message ---
Thanks to all who responded.
I have concluded that - if directory structure is fixed then we shall use
relative path, so that we can copy the code as it is to different server
without changing anything.
But if we are not sure about the path on server - from where the files are
going to be fetched for reading - then better use actual path. We can even
keep the path in some include file and just change that path so only one
file gets changed.
Manisha
--- End Message ---
--- Begin Message ---
OK - I've read the manual, looked at sample code....and I sadly am
missing something.
I'm doing (basically) this in my form:
<form action="someform.php" ENCTYPE="multipart/form-data" method="post"
name="replysub" id="replysub">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
<input type="file" name="subfile" id="subfile" size="50">
On the page it's submitted to, just to check the data, I did this:
$lineNo = 1;
echo "Dumping file info...<br>--------------------------<br>";
reset($_FILES);
while (list ($key, $val) = each($_FILES['subfile'])) {
echo "$lineNo $key => $val<br>";
$lineNo++;
}
....and I get this:
Dumping file info...
--------------------------
1 name => somefile.exe
2 type => application/x-msdownload
3 tmp_name => none
4 size => 0
Where do I start looking to figure out why tmp_name and size don't get
set? Why doesn't this file get uploaded?
Thanks!
--
Ed Marczak
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
A guess, but is the tmp dir set in php.ini??
Edward Marczak wrote:
> OK - I've read the manual, looked at sample code....and I sadly am
> missing something.
>
> I'm doing (basically) this in my form:
>
> <form action="someform.php" ENCTYPE="multipart/form-data"
> method="post" name="replysub" id="replysub">
> <input type="hidden" name="MAX_FILE_SIZE" value="100000">
> <input type="file" name="subfile" id="subfile" size="50">
>
> On the page it's submitted to, just to check the data, I did this:
>
> $lineNo = 1;
> echo "Dumping file info...<br>--------------------------<br>";
> reset($_FILES);
> while (list ($key, $val) = each($_FILES['subfile'])) {
> echo "$lineNo $key => $val<br>";
> $lineNo++;
> }
>
> ....and I get this:
>
> Dumping file info...
> --------------------------
> 1 name => somefile.exe
> 2 type => application/x-msdownload
> 3 tmp_name => none
> 4 size => 0
>
> Where do I start looking to figure out why tmp_name and size don't get
> set? Why doesn't this file get uploaded?
>
> Thanks!
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--- End Message ---
--- Begin Message ---
HI,
1. Where are the mail archives of this mailing list?
2. Any free online downloadable books ( html / pdf formats) on PHP?
Thanks
--
Natarajan
--- End Message ---
--- Begin Message ---
On Wednesday 29 May 2002 18:39 pm, Natarajan wrote:
> HI,
> 1. Where are the mail archives of this mailing list?
http://marc.theaimsgroup.com/
> 2. Any free online downloadable books ( html / pdf formats) on PHP?
Not that I know of, but webmonkey has a decent tutorial, and the manual is
very well done.
> Thanks
--
Whenever you find that you are on the side of the majority, it is time to
reform.
Samuel Clemens
--- End Message ---
--- Begin Message ---
Archives of the mailing list are available here: http://news.php.net/
Tutorials (good as books) check www.zend.com, www.hotscripts.com and
www.phpbuilder.net (com?org?)
-----Original Message-----
From: Natarajan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 6:40 PM
To: PHP
Subject: [PHP] Mail Archives
HI,
1. Where are the mail archives of this mailing list?
2. Any free online downloadable books ( html / pdf formats) on
PHP?
Thanks
--
Natarajan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi all,
I have the following code :
**************************************************************
setcookie("currentUserClass", $class, time()+3600, '', '', 0);
setcookie("currentUserEmail", $emailId, time()+3600, '', '', 0);
setcookie("currentUserName", $name, time()+3600, '', '', 0);
if ($role & 8)
{
setcookie("isModerator", 'yes', time()+3600, '', '', 0);
}
***************************************************************
This code works fine in my local machine (all cookie variables are set with
given values). When I took it to another server, only the last cookie gets
set. ie, either $currentUserName is set or $isModerator is set based on the
condition.
To reassure, I interchanged the second cookie (currentUserEmail) & the third
(currentUserName) set commands. Now also only the last cookie set is
available for use.
This is really puzzling me. Any lead will be appriciated.
(I am using a free hosting server running php 4.1 on Linux.)
Regards,
Jagan
--- End Message ---
--- Begin Message ---
This is not entirely a PHP question & I should know the answer,
but ...
I'm trying to figure out how to correct the proper format for
simulating the data sent in a POST. I believe the basic syntax
is
name1=value1&name2=value2 ...
Is this correct?
If so, how are the value's encoded? Is each value surrounded by
""? Do I need to urlencode() each value (without the surrounding
"")?
Any help appreciated.
--
JR
--- End Message ---
--- Begin Message ---
No you can do
Index.php?name=apokalyptik&[EMAIL PROTECTED]&subscribe=n
o
&&
<?php
echo '<pre>';
echo 'NAME: '.$name.chr(10);
echo 'EMAIL: '.$email.chr(10);
echo 'SUBSCRIBE: '.$subscribe;
echo '</pre>';
?>
-----Original Message-----
From: Jonathan Rosenberg [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 7:58 PM
To: PHP General
Subject: [PHP] POST Format
This is not entirely a PHP question & I should know the answer,
but ...
I'm trying to figure out how to correct the proper format for
simulating the data sent in a POST. I believe the basic syntax
is
name1=value1&name2=value2 ...
Is this correct?
If so, how are the value's encoded? Is each value surrounded by
""? Do I need to urlencode() each value (without the surrounding
"")?
Any help appreciated.
--
JR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> I'm trying to figure out how to correct the proper format for
> simulating the data sent in a POST. I believe the basic syntax
> is
>
> ?name1=value1&name2=value2 ...
>
> Is this correct?
That is correct for GET information, but not for POST.
POST is not passed through the QUERY_STRING like GET is.
If you _really_ want to mimick POST (it doesn't sound
like you do) then consider:
Using PHP, how do I send a http POST without using a form?
----------------------------------------------------------
http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51
> If so, how are the value's encoded? Is each value surrounded by
> ""? Do I need to urlencode() each value (without the surrounding
> "")?
I you plan to pass non-url friendly values through
the URL, then using urlencode() is a good idea. For
example:
$words = "Cheese is good";
echo '<a href="yep.php?motto='. urlencode($words) .'">hi</a>';
Which essentially makes:
yep.php?motto=Cheese+is+good
More information on what urlencode exactly does and
related information (like for htmlentities), see the
manual entry:
http://www.php.net/urlencode
Regards,
Philip Olson
--- End Message ---
--- Begin Message ---
> To increase security, I would like to not put the bind password into the
> program, and instead have the user type it in. But, I'd like to have this
> done so that the password is not echo'd to the screen.
The one thing I can suggest is the readline functions:
http://www.php.net/manual/en/ref.readline.php
That may not be exactly what you want, but it's probably the closest
you're going to get to what you want.
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
--- End Message ---
--- Begin Message ---
I do not understand why PHP is trying to pull row 2!! I want to create an
array of data and construct a table from a query. The echo of $rows shows 2
rows, so if I'm setting my variable to 0 and incrementing with each loop, it
doesn't make sense to me why it tries to pull row 2. It should stop at row
1 because the next loop would make the variable 2 and the if says if $ii is
less than 2.
WHAT AM I MISSING!?
I have a while loop written to pull data from a postgreSQL database. I have
2 and only 2 rows of data in this table. Probably labeled within PostgreSQL
as '0' and '1'. The browser displays the error message along with the
proper table listed below it!!
Warning: Unable to jump to row 2 on PostgreSQL result index 2 in
/var/www/html/steve/frontdoor.php on line 92
sgaas Steve Gaas
mjohnson Matt Johnson
The code is:
<?
$results = pg_exec($link, "select * from users");
if (!$link) {
print "Could not connect";
}
$ii = 0;
$rows = pg_numrows($results);
if ($rows) {
echo "There are $rows rows of data in $localdb";
}
echo "<BR>\n<HR>";
?>
<table>
<?
if ( $ii < $rows) {
while ($tabledata = pg_fetch_array($results, $ii)) { <--(LINE 92)
$username = $tabledata["username"];
$firstname = $tabledata["firstname"];
$lastname = $tabledata["lastname"];
echo "<TR>\n";
echo "<td>$username</td>\n";
echo "<td>$firstname</td>\n";
echo "<td>$lastname</td>\n";
echo "</tr>\n";
$ii++;
}
}
?>
</table>
--- End Message ---
--- Begin Message ---
On Thursday 30 May 2002 11:30, Steve G wrote:
Please do not reply to an existing post. Start a new one!
> I do not understand why PHP is trying to pull row 2!! I want to create an
> array of data and construct a table from a query. The echo of $rows shows
> 2 rows, so if I'm setting my variable to 0 and incrementing with each loop,
> it doesn't make sense to me why it tries to pull row 2. It should stop at
> row 1 because the next loop would make the variable 2 and the if says if
> $ii is less than 2.
The if statement only runs once. At the time it is run the statement is true
(ie $ii < 2) ...
> WHAT AM I MISSING!?
>
> I have a while loop written to pull data from a postgreSQL database. I
> have 2 and only 2 rows of data in this table. Probably labeled within
> PostgreSQL as '0' and '1'. The browser displays the error message along
> with the proper table listed below it!!
... but inside your while loop you have $ii++, which results in ...
> Warning: Unable to jump to row 2 on PostgreSQL result index 2 in
> /var/www/html/steve/frontdoor.php on line 92
> sgaas Steve Gaas
> mjohnson Matt Johnson
Basically you're going about this the wrong way. Replace this:
> <?
> if ( $ii < $rows) {
> while ($tabledata = pg_fetch_array($results, $ii)) { <--(LINE 92)
>
> $username = $tabledata["username"];
> $firstname = $tabledata["firstname"];
> $lastname = $tabledata["lastname"];
> echo "<TR>\n";
> echo "<td>$username</td>\n";
> echo "<td>$firstname</td>\n";
> echo "<td>$lastname</td>\n";
> echo "</tr>\n";
> $ii++;
> }
>
> }
> ?>
with:
/** Untested use with extreme caution **/
while ($tabledata = pg_fetch_array($results)) {
$username = $tabledata["username"];
$firstname = $tabledata["firstname"];
$lastname = $tabledata["lastname"];
echo "<TR>\n";
echo "<td>$username</td>\n";
echo "<td>$firstname</td>\n";
echo "<td>$lastname</td>\n";
echo "</tr>\n";
}
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Occam's eraser:
The philosophical principle that even the simplest
solution is bound to have something wrong with it.
*/
--- End Message ---
--- Begin Message ---
I began to write a function that correctly diveded
up the months into their correct UNIX timestamps and wrote content from a
database accordingly.
I have had an idea that maybe eaiser to implement
but slower. Could one or two people tell me what the think and if it is a good
idea. I am also interested in speed and efficiany of both methods.
The original method is:
I do a few maths functions to get the value in
seconds of each month etc
New Method:
I do string compares with with dates then convert
them to UNIX timestamps.
|
--- End Message ---
--- Begin Message ---
Just a query ... has any one else noticed this
for($i = a; $i < z; $i++)
{
print $i;
echo "<BR>";}
will print out a right down to yz
but replace the letters with numbers eg
for($i = 1; $i < 10; $i++)
{
print $i;
echo "<BR>";}
and it prints 1 thru to 10
and any one know a reason for this?
Cheers
Peter
"the only dumb question is the one that wasn't asked"
--- End Message ---
--- Begin Message ---
On Thursday 30 May 2002 11:46, Peter wrote:
> Just a query ... has any one else noticed this
>
> for($i = a; $i < z; $i++)
> {
> print $i;
> echo "<BR>";}
>
> will print out a right down to yz
It should only print to 'y' ...
> but replace the letters with numbers eg
>
> for($i = 1; $i < 10; $i++)
> {
> print $i;
> echo "<BR>";}
>
> and it prints 1 thru to 10
... and should only print to '9' ...
> and any one know a reason for this?
... so if it does otherwise for you then you've got a bug in your version of
php!
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Many people are desperately looking for some wise advice which will
recommend that they do what they want to do.
*/
--- End Message ---
--- Begin Message ---
<?
$fp = fopen ("EmailListNew.txt", "w");
$fpSend = fwrite($fp,"The file is created on Linux");
fclose ($fp);
echo ("File write test over");
?>
This is piece of my code, It is executing without any error but file is not
getting created. I tried the read mode, it is ok. That means the directory
does not have write permission. But then how to set it ?
My server is Red Hat Linux and I am using PHP4. Can I set it thr PHP or do
I need to do settings at Linux server ?
--- End Message ---
--- Begin Message ---
on linux : chmod
in php : chmod()
http://www.php.net/manual/en/function.chmod.php
the script will need write access to the directory otherwise it can't.....
write to it... :)
-----Original Message-----
From: Manisha [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 30, 2002 1:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Write permission problem
<?
$fp = fopen ("EmailListNew.txt", "w");
$fpSend = fwrite($fp,"The file is created on Linux");
fclose ($fp);
echo ("File write test over");
?>
This is piece of my code, It is executing without any error but file is not
getting created. I tried the read mode, it is ok. That means the directory
does not have write permission. But then how to set it ?
My server is Red Hat Linux and I am using PHP4. Can I set it thr PHP or do
I need to do settings at Linux server ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Can anyone suggest linux based software for translating english to
multiple languages ?
I have a dynamic content database which I need to translate into other
languages. It need to run on my linux server where I can pass a string as a
system call and get back the translated output. Price range can be free to
$600ish. Any suggestions? I can't use any web/hosted cgi, bablyfish, type
applications. It has to run on my server.
Thanks
Jon
--- End Message ---
--- Begin Message ---
Thanks a lot for this. I will try to implement this in my site. Does anyone
have any other suggestions?
-----Original Message-----
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 10:06 PM
To: Sebastian A.
Cc: PHP General List (PHP.NET)
Subject: Re: [PHP] Searching Many Text Documents
On Wed, 29 May 2002, Sebastian A. wrote:
> I recently have run into a situation where I must search through many text
> (XML) documents. I would like to implement a search feature on my site
that
> can search through the XML documents I use for my pages. I will probably
> need to search all the files in a specific directory for a certain term or
> keyword. Does anyone know how I can do this? And please remember, I need
to
> search through more than just 1 file.
To do it efficiently, you need to pre-index the documents. Rather than
starting from scratch, better to see if there's something already written
that can do it for you. For starters, have a look at:
http://www.mnogosearch.ru/
miguel
--- End Message ---
--- Begin Message ---
I'm just learning sessions, and thought the class looked interesting on
this page: http://www.php.net/manual/en/ref.session.php
So I have this on an index.phtml page and I can see the variables are
being set and all looks good there, however upon successful "login" I
wish to redirect to content.phtml At the very top of content.phtml I
have:
<?php
if( $login->getSessionVar("login") )
{
$booth_id = $login->getSessionVar("booth_id");
$booth_name = $login->getSessionVar("booth_name");
echo "\n<BR>booth_id = $booth_id and booth_name =
$booth_name<BR>\n";
}
else
{
Header("Location: ../index.phtml\n\n");
exit;
}
?>
But it doesn't seem that $login exists or is defined now on this page?
So my question is basically, how can I use the class and the session
variables across multiple pages? Do I need to move the class to an
include file? Do I need to re-create it on each page somehow? Can
someone show me a real working example of this scenario?
Daevid Vincent
http://daevid.com
--- End Message ---
--- Begin Message ---
I sometimes have a httpd process that when I look at top has run for
more than 100 min.
Can I in some way find out why it will not stop or its url?
Regards Jacob
--- End Message ---
--- Begin Message ---
There's always at least one httpd process running which listens to
incoming http connections.
Tom
Jacob Friis Larsen wrote:
> I sometimes have a httpd process that when I look at top has run for
> more than 100 min.
>
> Can I in some way find out why it will not stop or its url?
>
> Regards Jacob
--- End Message ---
--- Begin Message ---
I used the mail() function in php and it returned errors like these:
--------------------------
Warning: Mail delivery program returned with exit code: 17152 in
/www/htdocs/mail_webmaser.php on line 216
Warning: Mail delivery program returned: Undefined error: 0 in
/www/htdocs/mail_webmaser.php on line 216
--------------------------
Can anyone explaun why I get these errors, mail() with sendmail is
working fine with other php-sites on the server...
Thanks.
/Magnus Hammar
------------------------
--- End Message ---
--- Begin Message ---
1000,- billigere enn SAS? 500,- i prisforskjell pr snute. I og for seg et
OK tilbud, men datoene var litt klinkokos: 3 uker? Jeg tar rett og slett
telefonen fatt og ringer Braathens...
teil
........................................................
Informasjonssjef
Studentsamskipnaden i Bergen
55 54 51 67/ 90 92 94 46
www.sib.uib.no
........................................................
Olav Bringedal <[EMAIL PROTECTED]>
30.05.02 08:31
Vennligst send svar til php-general
Til: [EMAIL PROTECTED]
cc:
Emne:
se på dette... lang adresse...
1000 kr billigere med SAS
http://book.mrjet.no/step3.asp?FromCityIata=BGO&DestCityIata=BCN&CrsFare=1&NumAdt=2&NumFnn=0&NumCnn=0&NumInf=0&partnersite=&BookMod=&matchid=&TravelDateStartDay=20&TravelDateStartMonth=2002-06-&TravelDateEndDay=11&TravelDateEndMonth=2002-07-&ThreeStep=pw&BookClass=ec&Airlines=&NonStop=&ThreeStepSearchLog=TreSteg_PowerShopper&search=searchseatbestprice&Choice1=2733525%7CSK%7C7094%7C584%7C3255%7C0%7C0%7C0%7C}1%7CSK%7C336%7CW%7C20JUN%7CBGO%7COSL%7C0640%7C0730%A72%7CBU%7C693%7CQ%7C20JUN%7COSL%7CBCN%7C0820%7C1135%A73%7CBU%7C694%7CQ%7C11JUL%7CBCN%7COSL%7C1240%7C1550%A74%7CSK%7C327%7CW%7C11JUL%7COSL%7CBGO%7C1705%7C1755%A7&Choice2=2734019%7CSK%7C7094%7C584%7C3255%7C0%7C0%7C0%7C}1%7CSK%7C330%7CW%7C20JUN%7CBGO%7COSL%7C0630%7C0720%A72%7CBU%7C693%7CQ%7C20JUN%7COSL%7CBCN%7C0820%7C1135%A73%7CBU%7C694%7CQ%7C11JUL%7CBCN%7COSL%7C1240%7C1550%A74%7CSK%7C327%7CW%7C11JUL%7COSL%7CBGO%7C1705%7C1755%A7
=====
Olav Bringedal
jaggu.org
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
Hi all,
I'm busy building a website. I cannot use frames.
Every page can be divided in a table with 3x3 cells.
The row will be my main menu.
The first column wil be submenu.
The middel cell will display the actual content.
| |
<--main menu-->
----------------|-------------- |---------------
sub | main | sub content
menu | content |
| |
----------------|-------------- |--------------
<--footer-->
| |
the main menu will always be the same, same as the footer --> includes
the main content cell depends on which submenu function is choosen.
Some submenu items are:
login
search in database
add to your favourite items
add to basket
Now I was wondering how to build my site. How should I deal with a function like 'add
to basket'. I mean, when a certain item is displayed and the customer wants to add it
to their basket I have call the script add_to_basket.php or something like that.
However I don't want to leave the page where the item is displayed, cause that's
confusing to the visitor. Even more..In the 'sub-content' cell I want to display data
about ordering info, like there are so many items in the basket.
So I have to call upon a script which stores the info about add_to_basket, load a
total new page where 1 table cell changes, namely the sub-content cell, but still
displayes the original product.
So, If I were to use frames It could be done, but now I'm not thinking of frames but
of displaying content dynamically in a tabe cell.
I would very much appreciate your expert opinion on this matter, I'm sure every idea
helps me form my own ideas which I can use.
maybe there are people out there who have done this kind of thing, or know about large
sites which use this same concept....
Any philosophies are much appreciated!
Wilbert Enserink
-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------
--- End Message ---
--- Begin Message ---
Dear sir,
I would like to know if I could create using PHP, global variables that I
could use in diferrent files. I don't want to use http_get_vars or post or
cookies is there an other way?
Thank you.
Serge GEDEON
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
--- End Message ---
--- Begin Message ---
Dear sir,
I would like to know if I could create using PHP, global variables that I
could use in diferrent files. I don't want to use http_get_vars or post or
cookies is there an other way?
Thank you.
Serge GEDEON
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
--- End Message ---
--- Begin Message ---
Look at the auto-prepend or auto-append feature.
-----Original Message-----
From: serge gedeon [mailto:[EMAIL PROTECTED]]
Sent: 29 May 2002 14:35
To: [EMAIL PROTECTED]
Subject: [PHP] Global variables
Dear sir,
I would like to know if I could create using PHP, global variables that I
could use in diferrent files. I don't want to use http_get_vars or post or
cookies is there an other way?
Thank you.
Serge GEDEON
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I have some problems with installing the java extension for php.
My Config :
Os : Linux (Mandrake 8.1)
PHP 4.1.2
Apache 1.3.23
J2SDK.1.4.0
I had downloaded the source for php 4.1.2 from rpmfind.
I compiled the extensions, i had the two necessary files : libphp_java.do
and php_java.jar.
When i try to access excute a simple script done with the java extension, i
have no response, it's take a long time before it's tell me that the page
is not found. When i read the apache log , i see that Apache had crached the
child.
My config in php.ini :
java.class.path=/usr/lib/php/extensions/php_java.jar
java.home=/usr/java/java
java.library=/usr/java/java/jre/lib/i386/libjava.so
java.library.path=/usr/lib/php/extensions:/usr/java/java/jre/lib/i386/native
_threads:/usr/java/java/jre/lib/i386/client:/usr/java/java/jre/lib/i386/serv
er:/usr/java/java/jre/lib/i386
Can anybody help me ??
Thanks
--- End Message ---