|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Wed Apr 03 2002 - 00:20:57 CST
php-general Digest 3 Apr 2002 06:20:57 -0000 Issue 1264
Topics (messages 91181 through 91269):
sessions
91181 by: R. Lindeman
91185 by: Jason Wong
91195 by: R. Lindeman
91210 by: Jason Wong
91215 by: Jason Wong
Re: Connecting to a DB using PHP and mysql...
91182 by: Anthony Ritter
91187 by: Rick Emery
91198 by: Rick Emery
91199 by: Rick Emery
global vars within 2-level functions
91183 by: Erik Price
91186 by: Jason Wong
91189 by: Erik Price
91205 by: Miguel Cruz
Re: April fools day - did anyone notice Thies's fangs on rc1???
91184 by: Rasmus Lerdorf
91191 by: Septic Flesh
91236 by: Maxim Maletsky
Counting months between two dates
91188 by: John Hughes
91190 by: Rick Emery
91197 by: Rick Emery
header location redirect to frameset target
91192 by: Tom Beidler
91193 by: Adam Voigt
Re: List server
91194 by: Jason Wong
php+java on freebsd
91196 by: Ivan Voras
Re: help please - strange session behaviour on IIS with php4.1.2
91200 by: Hiroshi Ayukawa
Re: odbc_pconnect
91201 by: Miguel Cruz
91202 by: Maris Kalnins
91204 by: Miguel Cruz
91219 by: Maris Kalnins
Re: help please - strange session behaviour on IIS with
91203 by: Adam Voigt
Remembering choices
91206 by: Morten Nielsen
91207 by: Rick Emery
91238 by: Jamie Watt
Cookies
91208 by: Steffan Harris
91209 by: Rick Emery
91211 by: Rick Emery
91213 by: Nathan Cassano
pH and MS Access
91212 by: Rance Hall
91218 by: ahill.mail2.openlinksw.com
Re: Warning: Undefined variable
91214 by: Philip Olson
91220 by: Erik Price
91226 by: Philip Olson
!! New version of the TEMPLATE class of mine.
91216 by: Hiroshi Ayukawa
session
91217 by: R. Lindeman
91221 by: Steve Cayford
91222 by: Erik Price
91246 by: Nate
91252 by: Nate
Really slow include
91223 by: anti-blank
91224 by: Rance Hall
91225 by: Darren Gamble
91239 by: Jamie Watt
PHP and MS Access
91227 by: Rance Hall
91234 by: Maxim Maletsky
91235 by: eric.coleman.zaireweb.com
images not displaying
91228 by: Carl
91229 by: Rick Emery
91230 by: Carl
91231 by: Carl
91232 by: Rick Emery
91233 by: Miguel Cruz
Can not get session value???
91237 by: N.D. Andini
reading excel file
91240 by: Tyler Longren
91241 by: Jason Murray
91242 by: Tyler Longren
91243 by: Martin Towell
91244 by: Jason Murray
91245 by: Jason Murray
91269 by: Vail, Warren
Re: Random number Question
91247 by: Hiroshi Ayukawa
Re: preventing "back" button usage?
91248 by: Justin French
php and cgi
91249 by: Boris Wong
91251 by: Martin Towell
Mail - max_execution_time problem
91250 by: Chris
HTML to PHP Links
91253 by: G-no / |{iller
i need mail lists
91254 by: lixiaolong3456.sohu.com
Mail function acting a bit differently
91255 by: lmlweb
91257 by: Martin Towell
91259 by: lmlweb
91260 by: Martin Towell
91261 by: Miguel Cruz
91262 by: lmlweb
91263 by: lmlweb
91264 by: eric.coleman.zaireweb.com
91266 by: Jason Wong
Re: Problem reading in and displaying an image...
91256 by: David Robley
simple question
91258 by: Denis L. Menezes
KISGB Version 4.0.4 Released - PHP Guestbook
91265 by: Gaylen Fraley
PHP that will help me color code, code; like C++ on a HTML page?
91267 by: Michael Zornek
91268 by: Jason Murray
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 have a problem with PHP sessions and maybe some of you could help what do
i need in my php.ini to get them to work !!!
attached mail follows:
On Wednesday 03 April 2002 21:34, R. Lindeman wrote:
> i have a problem with PHP sessions and maybe some of you could help what do
> i need in my php.ini to get them to work !!!
You just need to edit it until it works.
Seriously, if you're going to keep your problem a secret nobody will be able
to help you.
*What* problems are you having with your sessions?
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* It's a funny thing that when a woman hasn't got anything on earth to worry about, she goes off and gets married. */
attached mail follows:
okay i'll explain a bit
i want my sessions to store some values but instead of storing them their doing nothing at all here's some code
// beginning of registering of values
session_start();
session_register("fu"); session_register("bar");
$fu = "fu"; $bar = "bar";
// end of registering values
//getting values
$fu = $HTTP_SESSION_VARS["fu"];
echo $fu;
//end of getting values
"R. Lindeman" <rlindeman
filenexus.com> wrote in message
news:20020402153536.66126.qmail
pb1.pair.com...
> i have a problem with PHP sessions and maybe some of you could help what
do
> i need in my php.ini to get them to work !!!
>
>
attached mail follows:
On Thursday 04 April 2002 01:04, R. Lindeman wrote: > okay i'll explain a bit > > i want my sessions to store some values but instead of storing them their > doing nothing at all here's some code > > // beginning of registering of values > > session_start(); > > session_register("fu"); > session_register("bar"); > > $fu = "fu"; > $bar = "bar"; > > // end of registering values > > //getting values > > $fu = $HTTP_SESSION_VARS["fu"]; > > echo $fu; > > //end of getting values
If you are using PHP > 4.06 then try:
$fu = $_COOKIE["fu"];
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* What I want to find out is -- do parrots know much about Astro-Turf? */
attached mail follows:
On Wednesday 03 April 2002 04:19, Jason Wong wrote: > On Thursday 04 April 2002 01:04, R. Lindeman wrote: > > okay i'll explain a bit > > > > i want my sessions to store some values but instead of storing them their > > doing nothing at all here's some code > > > > // beginning of registering of values > > > > session_start(); > > > > session_register("fu"); > > session_register("bar"); > > > > $fu = "fu"; > > $bar = "bar"; > > > > // end of registering values > > > > //getting values > > > > $fu = $HTTP_SESSION_VARS["fu"]; > > > > echo $fu; > > > > //end of getting values > > If you are using PHP > 4.06 then try: > > $fu = $_COOKIE["fu"];
Hmm, are you setting and reading the cookie on the same page? If so, it can't be done. You need to either set it on one page then read on another, or set it then refresh the page.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* It doesn't much signify whom one marries, for one is sure to find out next morning it was someone else. -- Will Rogers */
attached mail follows:
Craig, I tried the following.
I was able to connect to mysql but not to the database "contacts".
TR .......................................................
<HTML> <BODY> <? define("DATABASE_HOST", "localhost"); define("DATABASE_USER", "johndoe"); define("DATABASE_PASSWORD", "abc"); define("DATABASE_NAME", "contacts");
$connection=mysql_connect(DATABASE_HOST,DATABASE_USER,DATABASE_PASSWORD); if(!$connection) { echo "Couldn't connect."; exit; } $db=mysql_select_db(DATABASE_NAME,$connection); if(!$db) { echo "Couldn't connect to the database."; exit; } $sql="SELECT * FROM leads"; $mysql_result=mysql_query($sql, $connection); $num_rows=mysql_num_rows($mysql_result);
if($num_rows==0) { echo "There is no information"; } else { echo"<TABLE ALIGN=\"Center\" BORDER=\"1\">"; echo"<TR><TH><FONT FACE =\"Arial\" SIZE=\"2\">First Name</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">Last Name</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">email</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">State</TH>";
while($row=mysql_fetch_array($mysql_result)) { $fname=$row["fname"]; $lname=$row["lname"]; $email=$row["email"]; $state=$row["state"]; $ID=$row["ID"]; echo " <TR><TH><FONT FACE =\"Arial\" SIZE=\"2\">$fname</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">$lname</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">$email</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">$state</TH></TR>"; } } mysql_close($connection); ?> </BODY> </HTML> ...........................................
Craig Donnelly wrote in message: Try this for your connection: ............................................ <? > > // Database constants > define("DATABASE_HOST", "localhost"); > define("DATABASE_USER", "root"); > define("DATABASE_PASSWORD", "*YOUR_PASS*"); > define("DATABASE_NAME", "*YOUR_DB_NAME*"); > > // Establish connection > $dbLink = mysql_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD); > if(!$dbLink) { > print "Unable to connect to the database, please contact Sysadmin > asap."; > } else { > $dbUse = mysql_select_db(DATABASE_NAME, $dbLink); > } > > ?> > > --------------------------------------------------------------------------
-- > Hope it helps ya, > > Craig
attached mail follows:
at the mysql command line, type:
mysql> show grants for johndoe
localhost;
what does it show?
-----Original Message-----
From: Anthony Ritter [mailto:tony
gonefishingguideservice.com]
Sent: Tuesday, April 02, 2002 1:08 PM
To: php-general
lists.php.net
Subject: [PHP] Re: Connecting to a DB using PHP and mysql...
Craig, I tried the following.
I was able to connect to mysql but not to the database "contacts".
TR .......................................................
<HTML> <BODY> <? define("DATABASE_HOST", "localhost"); define("DATABASE_USER", "johndoe"); define("DATABASE_PASSWORD", "abc"); define("DATABASE_NAME", "contacts");
$connection=mysql_connect(DATABASE_HOST,DATABASE_USER,DATABASE_PASSWORD); if(!$connection) { echo "Couldn't connect."; exit; } $db=mysql_select_db(DATABASE_NAME,$connection); if(!$db) { echo "Couldn't connect to the database."; exit; } $sql="SELECT * FROM leads"; $mysql_result=mysql_query($sql, $connection); $num_rows=mysql_num_rows($mysql_result);
if($num_rows==0) { echo "There is no information"; } else { echo"<TABLE ALIGN=\"Center\" BORDER=\"1\">"; echo"<TR><TH><FONT FACE =\"Arial\" SIZE=\"2\">First Name</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">Last Name</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">email</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">State</TH>";
while($row=mysql_fetch_array($mysql_result)) { $fname=$row["fname"]; $lname=$row["lname"]; $email=$row["email"]; $state=$row["state"]; $ID=$row["ID"]; echo " <TR><TH><FONT FACE =\"Arial\" SIZE=\"2\">$fname</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">$lname</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">$email</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">$state</TH></TR>"; } } mysql_close($connection); ?> </BODY> </HTML> ...........................................
Craig Donnelly wrote in message: Try this for your connection: ............................................ <? > > // Database constants > define("DATABASE_HOST", "localhost"); > define("DATABASE_USER", "root"); > define("DATABASE_PASSWORD", "*YOUR_PASS*"); > define("DATABASE_NAME", "*YOUR_DB_NAME*"); > > // Establish connection > $dbLink = mysql_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD); > if(!$dbLink) { > print "Unable to connect to the database, please contact Sysadmin > asap."; > } else { > $dbUse = mysql_select_db(DATABASE_NAME, $dbLink); > } > > ?> > > --------------------------------------------------------------------------
-- > Hope it helps ya, > > Craig-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I assume that instead of johndoe, you used the real user name that you have in your script
-----Original Message-----
From: Anthony Ritter [mailto:tony
gonefishingguideservice.com]
Sent: Tuesday, April 02, 2002 2:06 PM
To: Rick Emery
Subject: Rick...
Rick, After typing in:
mysql> SHOW GRANTS FOR johndoe
localhost;
I get an ERROR 1064
Regards, TR ..........................................
----- Original Message -----
From: Rick Emery <remery
excel.com>
To: 'Anthony Ritter' <tony
gonefishingguideservice.com>;
<php-general
lists.php.net>
Sent: Tuesday, April 02, 2002 12:31 PM
Subject: RE: [PHP] Re: Connecting to a DB using PHP and mysql...
> at the mysql command line, type:
> mysql> show grants for johndoe
localhost;
>
> what does it show?
..................................
>
> -----Original Message-----
> From: Anthony Ritter [mailto:tony
gonefishingguideservice.com]
> Sent: Tuesday, April 02, 2002 1:08 PM
> To: php-general
lists.php.net
> Subject: [PHP] Re: Connecting to a DB using PHP and mysql...
>
>
> Craig,
> I tried the following.
>
> I was able to connect to mysql but not to the database "contacts".
>
> TR
> .......................................................
>
> <HTML>
> <BODY>
> <?
> define("DATABASE_HOST", "localhost");
> define("DATABASE_USER", "johndoe");
> define("DATABASE_PASSWORD", "abc");
> define("DATABASE_NAME", "contacts");
>
> $connection=mysql_connect(DATABASE_HOST,DATABASE_USER,DATABASE_PASSWORD);
> if(!$connection)
> {
> echo "Couldn't connect.";
> exit;
> }
> $db=mysql_select_db(DATABASE_NAME,$connection);
> if(!$db)
> {
> echo "Couldn't connect to the database.";
> exit;
> }
> $sql="SELECT * FROM leads";
> $mysql_result=mysql_query($sql, $connection);
> $num_rows=mysql_num_rows($mysql_result);
>
> if($num_rows==0)
> {
> echo "There is no information";
> }
> else
> {
> echo"<TABLE ALIGN=\"Center\" BORDER=\"1\">";
> echo"<TR><TH><FONT FACE =\"Arial\" SIZE=\"2\">First Name</TH><TH><FONT
FACE
> =\"Arial\" SIZE=\"2\">Last Name</TH><TH><FONT FACE =\"Arial\"
> SIZE=\"2\">email</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">State</TH>";
>
> while($row=mysql_fetch_array($mysql_result))
> {
> $fname=$row["fname"];
> $lname=$row["lname"];
> $email=$row["email"];
> $state=$row["state"];
> $ID=$row["ID"];
> echo " <TR><TH><FONT FACE =\"Arial\" SIZE=\"2\">$fname</TH><TH><FONT FACE
> =\"Arial\" SIZE=\"2\">$lname</TH><TH><FONT FACE =\"Arial\"
> SIZE=\"2\">$email</TH><TH><FONT FACE =\"Arial\"
> SIZE=\"2\">$state</TH></TR>";
> }
> }
> mysql_close($connection);
> ?>
> </BODY>
> </HTML>
> ...........................................
>
> Craig Donnelly wrote in message:
> Try this for your connection:
> ............................................
> <?
> >
> > // Database constants
> > define("DATABASE_HOST", "localhost");
> > define("DATABASE_USER", "root");
> > define("DATABASE_PASSWORD", "*YOUR_PASS*");
> > define("DATABASE_NAME", "*YOUR_DB_NAME*");
> >
> > // Establish connection
> > $dbLink = mysql_connect(DATABASE_HOST, DATABASE_USER,
DATABASE_PASSWORD);
> > if(!$dbLink) {
> > print "Unable to connect to the database, please contact
Sysadmin
> > asap.";
> > } else {
> > $dbUse = mysql_select_db(DATABASE_NAME, $dbLink);
> > }
> >
> > ?>
> >
>
> --------------------------------------------------------------------------
> --
> > Hope it helps ya,
> >
> > Craig
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> ---
> [This E-mail scanned for viruses by IAS, an Archiventure Company]
>
>
--- [This E-mail scanned for viruses by IAS, an Archiventure Company]
attached mail follows:
The error indicates that johndoe doesn't have permissions to any database. If he did, it should look like:
mysql> show grants for root
localhost;
+---------------------------------------------------------------------+
| Grants for root
localhost |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'
'localhost' WITH GRANT OPTION |
+---------------------------------------------------------------------+
> -----Original Message-----
> From: Anthony Ritter [mailto:tony
gonefishingguideservice.com]
> Sent: Tuesday, April 02, 2002 2:06 PM
> To: Rick Emery
> Subject: Rick...
>
>
> Rick,
> After typing in:
>
> mysql> SHOW GRANTS FOR johndoe
localhost;
>
> I get an ERROR 1064
>
> Regards,
> TR
> ..........................................
>
> ----- Original Message -----
> From: Rick Emery <remery
excel.com>
> To: 'Anthony Ritter' <tony
gonefishingguideservice.com>;
> <php-general
lists.php.net>
> Sent: Tuesday, April 02, 2002 12:31 PM
> Subject: RE: [PHP] Re: Connecting to a DB using PHP and mysql...
>
>
> > at the mysql command line, type:
> > mysql> show grants for johndoe
localhost;
> >
> > what does it show?
> ..................................
> >
> > -----Original Message-----
> > From: Anthony Ritter [mailto:tony
gonefishingguideservice.com]
> > Sent: Tuesday, April 02, 2002 1:08 PM
> > To: php-general
lists.php.net
> > Subject: [PHP] Re: Connecting to a DB using PHP and mysql...
> >
> >
> > Craig,
> > I tried the following.
> >
> > I was able to connect to mysql but not to the database "contacts".
> >
> > TR
> > .......................................................
> >
> > <HTML>
> > <BODY>
> > <?
> > define("DATABASE_HOST", "localhost");
> > define("DATABASE_USER", "johndoe");
> > define("DATABASE_PASSWORD", "abc");
> > define("DATABASE_NAME", "contacts");
> >
> >
$connection=mysql_connect(DATABASE_HOST,DATABASE_USER,DATABASE_PASSWORD);
> > if(!$connection)
> > {
> > echo "Couldn't connect.";
> > exit;
> > }
> > $db=mysql_select_db(DATABASE_NAME,$connection);
> > if(!$db)
> > {
> > echo "Couldn't connect to the database.";
> > exit;
> > }
> > $sql="SELECT * FROM leads";
> > $mysql_result=mysql_query($sql, $connection);
> > $num_rows=mysql_num_rows($mysql_result);
> >
> > if($num_rows==0)
> > {
> > echo "There is no information";
> > }
> > else
> > {
> > echo"<TABLE ALIGN=\"Center\" BORDER=\"1\">";
> > echo"<TR><TH><FONT FACE =\"Arial\" SIZE=\"2\">First Name</TH><TH><FONT
> FACE
> > =\"Arial\" SIZE=\"2\">Last Name</TH><TH><FONT FACE =\"Arial\"
> > SIZE=\"2\">email</TH><TH><FONT FACE =\"Arial\" SIZE=\"2\">State</TH>";
> >
> > while($row=mysql_fetch_array($mysql_result))
> > {
> > $fname=$row["fname"];
> > $lname=$row["lname"];
> > $email=$row["email"];
> > $state=$row["state"];
> > $ID=$row["ID"];
> > echo " <TR><TH><FONT FACE =\"Arial\" SIZE=\"2\">$fname</TH><TH><FONT
FACE
> > =\"Arial\" SIZE=\"2\">$lname</TH><TH><FONT FACE =\"Arial\"
> > SIZE=\"2\">$email</TH><TH><FONT FACE =\"Arial\"
> > SIZE=\"2\">$state</TH></TR>";
> > }
> > }
> > mysql_close($connection);
> > ?>
> > </BODY>
> > </HTML>
> > ...........................................
> >
> > Craig Donnelly wrote in message:
> > Try this for your connection:
> > ............................................
> > <?
> > >
> > > // Database constants
> > > define("DATABASE_HOST", "localhost");
> > > define("DATABASE_USER", "root");
> > > define("DATABASE_PASSWORD", "*YOUR_PASS*");
> > > define("DATABASE_NAME", "*YOUR_DB_NAME*");
> > >
> > > // Establish connection
> > > $dbLink = mysql_connect(DATABASE_HOST, DATABASE_USER,
> DATABASE_PASSWORD);
> > > if(!$dbLink) {
> > > print "Unable to connect to the database, please contact
> Sysadmin
> > > asap.";
> > > } else {
> > > $dbUse = mysql_select_db(DATABASE_NAME, $dbLink);
> > > }
> > >
> > > ?>
> > >
> >
>
> --------------------------------------------------------------------------
> > --
> > > Hope it helps ya,
> > >
> > > Craig
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > ---
> > [This E-mail scanned for viruses by IAS, an Archiventure Company]
> >
> >
>
> ---
> [This E-mail scanned for viruses by IAS, an Archiventure Company]
> ---
> [This E-mail scanned for viruses by IAS, an Archiventure Company]
>
>
--- [This E-mail scanned for viruses by IAS, an Archiventure Company]
attached mail follows:
I have some code, in which I am using the function keyword to create subroutines of code (in otherwords, not true functions but rather reuseable chunks of other code).
Yeah, it's ugly, but I need to do it this way for now.
So my question is this: One of my subroutine/functions generates a variable. I would like to make this variable available to another subroutine/function, which is called from the first subroutine/function. If what I say is confusing, think of it like this:
function1 - creates variable_A - calls function2
function2 - needs to access variable_A
The problem is that this variable is not available to function2, even if I use the "global" keyword. The only way I can pass this variable to function2 is if I pass it as an argument. However, in some cases, I need to call function2 without this argument, but this creates some Warnings which I don't want to see. I don't want to just suppress these warnings, how can I either
(a) Pass a variable from a function to a subfunction called from the first function (b) Pass a variable as an argument to a function but make that argument optional so that it does not have to exist to make the function legitimate.
Thank you,
Erik
----Erik Price Web Developer Temp Media Lab, H.H. Brown pricee
hhbrown.com
attached mail follows:
On Wednesday 03 April 2002 02:11, Erik Price wrote:
> (b) Pass a variable as an argument to a function but make that argument > optional so that it does not have to exist to make the function > legitimate.
function function2 ($variable_A="") { }
It's in manual under "Functions" -- original isn't it? :)
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* Kids, the seven basic food groups are GUM, PUFF PASTRY, PIZZA, PESTICIDES, ANTIBIOTICS, NUTRA-SWEET and MILK DUDS!! */
attached mail follows:
On Tuesday, April 2, 2002, at 01:24 PM, Jason Wong wrote:
>> (b) Pass a variable as an argument to a function but make that argument >> optional so that it does not have to exist to make the function >> legitimate. > > function function2 ($variable_A="") { > }
Thanks for the pointer. I didn't realize that passing a blank argument would achieve this effect.
Erik
----Erik Price Web Developer Temp Media Lab, H.H. Brown pricee
hhbrown.com
attached mail follows:
On Tue, 2 Apr 2002, Erik Price wrote: > On Tuesday, April 2, 2002, at 01:24 PM, Jason Wong wrote: >>> (b) Pass a variable as an argument to a function but make that argument >>> optional so that it does not have to exist to make the function >>> legitimate. >> >> function function2 ($variable_A="") { >> } > > Thanks for the pointer. I didn't realize that passing a blank argument > would achieve this effect.
Here's another way to have optional arguments, just so you're at a wealth of solutions:
function function2() { list ($variable_A) = func_get_args();
}
miguel
attached mail follows:
Well, not really. This easter egg has been in the code since April 2000, so it isn't actually a new thing. We had this same discussion in April 2001. You guys just have a short memory. ;)
-Rasmus
On Tue, 2 Apr 2002, Brian Drexler wrote:
> Wow, talk about things from your past coming back to haunt you :-)
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
lerdorf.ca]
> Sent: Tuesday, April 02, 2002 11:52 AM
> To: Erik Price
> Cc: Frank Joerdens; php-general
lists.php.net; hank
fas-art.com
> Subject: Re: [PHP] April fools day - did anyone notice Thies's fangs on
> rc1???
>
>
> They were breadsticks. Picture was taken in early 1999 in a restaurant in
> Tel Aviv, Israel.
>
> -Rasmus
>
> On Tue, 2 Apr 2002, Erik Price wrote:
>
> >
> > On Tuesday, April 2, 2002, at 11:52 AM, Frank Joerdens wrote:
> >
> > > Did anyone else notice Thies's fangs on the phpinfo() page of 4.2.0rc1
> > > yesterday? I wonder what they where . . . french fries? Salty sticks
> > > (German 'Salzstangen')?? At first I though I was hallucinating,
> > > especially when I found that he was gone again today! Try setting your
> > > server's system date back to yesterday, as in
> >
> > Pencils, I thought? I didn't know who that was.
> >
> >
> > Erik
> >
> >
> >
> >
> > ----
> >
> > Erik Price
> > Web Developer Temp
> > Media Lab, H.H. Brown
> > pricee
hhbrown.com
> >
> >
> > --
> > 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:
He was eating fish n chips . .but he didn;t like the chips so . . .he put them in his f..k..nose..
hahahahah
-- ~~~~~~~~~~~~~~~~Sapilas
/dev/pinkeye
attached mail follows:
Exactly what I always though in here, Rasmus:-)
Maxim Maletsky
-----Original Message-----
From: Rasmus Lerdorf [mailto:rasmus
lerdorf.ca]
Sent: Tuesday, April 02, 2002 8:12 PM
To: Brian Drexler
Cc: Erik Price; Frank Joerdens; php-general
lists.php.net;
hank
fas-art.com
Subject: RE: [PHP] April fools day - did anyone notice Thies's fangs on
rc1???
Well, not really. This easter egg has been in the code since April 2000, so it isn't actually a new thing. We had this same discussion in April 2001. You guys just have a short memory. ;)
-Rasmus
On Tue, 2 Apr 2002, Brian Drexler wrote:
> Wow, talk about things from your past coming back to haunt you :-)
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
lerdorf.ca]
> Sent: Tuesday, April 02, 2002 11:52 AM
> To: Erik Price
> Cc: Frank Joerdens; php-general
lists.php.net; hank
fas-art.com
> Subject: Re: [PHP] April fools day - did anyone notice Thies's fangs
on
> rc1???
>
>
> They were breadsticks. Picture was taken in early 1999 in a
restaurant in
> Tel Aviv, Israel.
>
> -Rasmus
>
> On Tue, 2 Apr 2002, Erik Price wrote:
>
> >
> > On Tuesday, April 2, 2002, at 11:52 AM, Frank Joerdens wrote:
> >
> > > Did anyone else notice Thies's fangs on the phpinfo() page of
4.2.0rc1
> > > yesterday? I wonder what they where . . . french fries? Salty
sticks
> > > (German 'Salzstangen')?? At first I though I was hallucinating,
> > > especially when I found that he was gone again today! Try setting
your
> > > server's system date back to yesterday, as in
> >
> > Pencils, I thought? I didn't know who that was.
> >
> >
> > Erik
> >
> >
> >
> >
> > ----
> >
> > Erik Price
> > Web Developer Temp
> > Media Lab, H.H. Brown
> > pricee
hhbrown.com
> >
> >
> > --
> > 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:
I want to determine the number of months between two dates. Is there a function in PHP or a way to make strtotime do the job?
For instance, how many months between 2001-08-27 and 2002-06-05.
attached mail follows:
John,
Are you pulling dates from mysql? If so, let mysql do it for you. If you don't know how, ask again.
-----Original Message-----
From: John Hughes [mailto:john
jomari.com]
Sent: Tuesday, April 02, 2002 12:33 PM
To: php-general
lists.php.net
Subject: [PHP] Counting months between two dates
I want to determine the number of months between two dates. Is there a function in PHP or a way to make strtotime do the job?
For instance, how many months between 2001-08-27 and 2002-06-05.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
if done in mysql:
SELECT PERIOD_DIFF(DATE_FORMAT("2002-06-05","%Y%m"),(DATE_FORMAT("2001-08-27","%Y%m ") );
-----Original Message-----
From: John Hughes [mailto:john
jomari.com]
Sent: Tuesday, April 02, 2002 12:33 PM
To: php-general
lists.php.net
Subject: [PHP] Counting months between two dates
I want to determine the number of months between two dates. Is there a function in PHP or a way to make strtotime do the job?
For instance, how many months between 2001-08-27 and 2002-06-05.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Can you specify a frameset target, i.e. _blank, in a redirect. I have a site built with frames and one of the frames has a redirect in it. Currently the redirect works but pulls the site I want up in the frame and doesn't create an entire new page.
attached mail follows:
I think what your looking for is "_new", but I'm not sure if you can do it in what I guess your saying is a meta refresh, I know you can as "target="_new"" in a href.
Adam Voigt
adam.voigt
cryptocomm.com
On Tue, 02 Apr 2002 10:42:19 -0800, Tom Beidler <tom
orbittechservices.com> wrote:
> Can you specify a frameset target, i.e. _blank, in a redirect. I have a site
> built with frames and one of the frames has a redirect in it. Currently the
> redirect works but pulls the site I want up in the frame and doesn't create
> an entire new page.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
On Wednesday 03 April 2002 01:05, Anzak Wolf wrote: > >On Tuesday 02 April 2002 22:10, Anzak Wolf wrote: > > > Since no one seems to have heard of a php driven list server could > > > >someone > > > > > get me started on writting my own by telling me who I would read from > > > stdin. > > > >fopen("php://stdin", r); > > How does that relate to readline()?
With fopen() you can do something like:
cat textfile | myprog.php
readline() is for interactive input.
What exactly are you trying to do?
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk/* It's not the inital skirt length, it's the upcreep. */
attached mail follows:
Can anyone tell me how to get java support for php working? I compiled apache with -pthread option, I properly configured php.ini (phpinfo() agrees), but I cannot overcome this:
(the message appears as a PHP error when trying to create any java objects)
Fatal error: Unable to load Java Library /usr/local/jdk1.1.8/lib/i386/green_threads/libjava.so, error: /usr/local/jdk1.1.8/lib/i386/green_threads/libjava.so: Undefined symbol "fmod" in /usr/home/ivoras/public_html/jver.php on line 4
apparently, libjava.so links to a symbol 'fmod', which is in libm.so, but libjava.so is not linked to use libm.so. (?) (all jdk1.1.8 binaries are actually using compat3x libraries)
(I have no preference for a JDK, I just need the stuff working.)
-- -- Ashes to ashes, DOS to DOS ivorasfer.hr
attached mail follows:
I have the same problem, while I'm using Apache for web server / Win2k. It seems that it depends on "register_globals=On or Off". When the register_globals=On, it works well. But when the register_globals=Off I've got the same situation; session doesn't work.
I guess this is a bug of PHP4.1.2/Win, isn't it?,
Regards, Hiroshi Ayukawa http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top
attached mail follows:
On Tue, 2 Apr 2002, Maris Kalnins wrote: > I have a situation where I need to keep connection still active after php > script is done and page displayed! > I tried to use > > $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw); > > But unfortunately connection closes automatically when script is done! > What must I do to keep connection alive and be able to use $cx again and > again without connectign?
Are you using the CGI version of PHP? I doubt any of the persistent connection functions have any meaning then.
miguel
attached mail follows:
Yes I am using CGI... So that means under Windows using Apache Server it is impossible to do that?
attached mail follows:
On Tue, 2 Apr 2002, Maris Kalnins wrote: > Yes I am using CGI... > So that means under Windows using Apache Server it is impossible to do that?
Can't PHP be run as a module under Apache for Windows?
miguel
attached mail follows:
thanks, I configured php under apache as a module now connection doesn't disappear after script is done it stays alive..
now another problem: first time I open connection this way..
if (empty($cx)){ $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw); }
if next time i will use the same construction it will not reuse my existing connection but it generates another one which stays alive like the first one..
after a while i get an odbc message "Database server connection limit exceeded"
The question is: how can I determine if connection is already active and how can I reuse it then?
Thanks
attached mail follows:
I run this setup on Win2k Advanced Server talking to a Microsoft SQL 2000 Server, with sessions of both cookie type and URL-SessionID server side based, with absolutely no problems.
Adam Voigt
adam.voigt
cryptocomm.com
On Wed, 03 Apr 2002 04:37:07 +0900, Hiroshi Ayukawa <ayu
e-fukuoka.co.jp> wrote:
> I have the same problem, while I'm using Apache for web server / Win2k.
> It seems that it depends on "register_globals=On or Off".
> When the register_globals=On, it works well.
> But when the register_globals=Off I've got the same situation; session
> doesn't work.
>
> I guess this is a bug of PHP4.1.2/Win, isn't it?,
>
> Regards,
> Hiroshi Ayukawa
> http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hi, I have a menu, where I would like to be able to store which link the user last pressed. What is the best way of doing this? I thought about sessions, but is it possible to define some sort of global variable that I can access from all my pages?
Regards, Morten
attached mail follows:
no such thing as a global variable accessible from all pages.
use cookies or sessions
-----Original Message-----
From: Morten Nielsen [mailto:mosgaard2000
hotmail.com]
Sent: Tuesday, April 02, 2002 2:02 PM
To: php-general
lists.php.net
Subject: [PHP] Remembering choices
Hi, I have a menu, where I would like to be able to store which link the user last pressed. What is the best way of doing this? I thought about sessions, but is it possible to define some sort of global variable that I can access from all my pages?
Regards, Morten
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
That's exactly what sessions are for, check out http://www.php.net/manual/en/ref.session.php for more info about using sesions.
> Hi, > I have a menu, where I would like to be able to store which link the user > last pressed. What is the best way of doing this? I thought about sessions, > but is it possible to define some sort of global variable that I can access > from all my pages? > > Regards, > Morten > >
attached mail follows:
hi, is there a way of setting an infinite cookie using PHP? Is there a special command for it? If not, I suggest adding that function in to PHP. Thanks,
Steffan
attached mail follows:
what is an infinite cookie? do you mean one that lasts after the browser is closed and can be re-examined at a later date?
Already there...
-----Original Message-----
From: Steffan Harris [mailto:steffan
macunlimited.net]
Sent: Tuesday, April 02, 2002 1:57 PM
To: php-general
lists.php.net
Subject: [PHP] Cookies
hi, is there a way of setting an infinite cookie using PHP? Is there a special command for it? If not, I suggest adding that function in to PHP. Thanks,
Steffan
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
First: cookies are a function of the HTTP protocol and each browser's implementation thereof. This is not a PHP issue.
Second: I would recommend simply setting cookie to 10 years in the future. It is inconceivable that the application and/or data would not have changed in that time. To believe otherwise would allow many of us an opportunity for off-list humor at the believer's expense. <GRIN>
-----Original Message-----
From: Steffan Harris [mailto:steffan
macunlimited.net]
Sent: Tuesday, April 02, 2002 2:13 PM
To: Rick Emery
Subject: RE: [PHP] Cookies
sorry, I was in a rush when I wrote that. I mean a cookie that will never expire, and will always remain there, and be called back at any later date, even if it is the year 3456 :)
>what is an infinite cookie? do you mean one that lasts after the browser
is
>closed and can be re-examined at a later date?
>
>Already there...
>
>-----Original Message-----
>From: Steffan Harris [mailto:steffan
macunlimited.net]
>Sent: Tuesday, April 02, 2002 1:57 PM
>To: php-general
lists.php.net
>Subject: [PHP] Cookies
>
>
>hi, is there a way of setting an infinite cookie using PHP? Is there a
>special command for it? If not, I suggest adding that function in to PHP.
>Thanks,
>
>Steffan
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
There is no such thing as an "infinite cookie". About the closest thing to infinity in PHP is year 2038.
setcookie("test", "val", 2147483647);
-----Original Message-----
From: Steffan Harris [mailto:steffan
macunlimited.net]
Sent: Tuesday, April 02, 2002 11:57 AM
To: php-general
lists.php.net
Subject: [PHP] Cookies
hi, is there a way of setting an infinite cookie using PHP? Is there a special command for it? If not, I suggest adding that function in to PHP. Thanks,
Steffan
attached mail follows:
Downloaded and installed the adodb sripts to my web dir, the server is a win2k box so I had to manually edit all the path statements in the adodb sripts to make the path statements work
I keep getting the following error, whether I used the PHP odbc access codes, or adodb for acess codes
Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in c:\apache\htdocs\adodb\adodb-odbc.inc.php on line 64
I really want to be connected to an Access database.
I have added a dsn to my system, and the data base should be ok
now, what do I do next.
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall
buckle.com
attached mail follows:
I would guess you are using a user DSN. Try a System DSN.
And you shouldn't need the adodb stuff, just straight odbc.
Best regards, Andrew Hill OpenLink Softeware
> Downloaded and installed the adodb sripts to my web dir, the server is
> a win2k box so I had to manually edit all the path statements in the
> adodb sripts to make the path statements work
>
> I keep getting the following error, whether I used the PHP odbc access
> codes, or adodb for acess codes
>
> Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name
> not found and no default driver specified, SQL state IM002 in
> SQLConnect in c:\apache\htdocs\adodb\adodb-odbc.inc.php on line 64
>
> I really want to be connected to an Access database.
>
> I have added a dsn to my system, and the data base should be ok
>
> now, what do I do next.
>
>
>
> Rance Hall
> 308.238.2455
> Internal Office Extensions: 2455 or 6655
> PC Programmer, The Buckle, Inc.
> rance.hall
buckle.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
> > Good little programmers define variables before > > using them, or at least before evaluating them. > > Really? I'm not arguing with you, I'm curious: I thought that it was a > valued feature of newer scripting languages that they do not require > declaration of variables. At least that's what people say when they > praise PHP or Python or whichever language allows this. > > Is this "feature" not as desirable as what I had first heard?
If you turn down error reporting then you don't have to worry about it, so it depends on you. So you're correct, it is not "required" but still it's nice. For example, if you're debugging a script you'll instantly know that you're using a undefined variable somewhere, perhaps a typo? E_NOTICE also applies to non-existent array keys, and other things.
If you're distributing code in cyberspace it's a good idea to make it error free too, E_NOTICE or otherwise.
Regards, Philip Olson
attached mail follows:
On Tuesday, April 2, 2002, at 03:27 PM, Philip Olson wrote:
> If you're distributing code in cyberspace it's a good > idea to make it error free too, E_NOTICE or otherwise.
I got back quite a few responses on this list on the subject of having variables that are not defined before they are used. That's interesting -- it's nice to know that I can take shortcuts and conjure them up on the fly, but I didn't realize that it was good practice to declare the variable before you actually use it in a script. (I never studied programming in any formal sense, as anyone who has seen my source code can attest :).
Sometimes I create variables dynamically, such that I could never declare/initialize them in any realistic sense -- for instance, I might have a while loop that executes a number of times equal to the number of rows pulled from a database query. And in this while loop, I might generate a new variable (assigning it a name like $variable$i, using the old $i++ trick to give it a unique numeric suffix).
If I use this trick, does this doom me to never having fully-error-free code? Or is there something that I'm not getting here... The short of it is that, as a novice programmer, I'd like to make sure I'm writing the most legitimate code that I can. Thanks for any input on this thread, past or future.
Erik
----Erik Price Web Developer Temp Media Lab, H.H. Brown pricee
hhbrown.com
attached mail follows:
We are confusing one another :) I'm not talking about declaring variables per se, but rather making sure the variable exists before evaluating it. So:
$var = 'foobar'; if ($var == 'foobar')
That's fine, no need to do declare $var before this in PHP. My words here simply mean to make sure it exists before comparing it. (let's not talk about oop)
Your example of $var$i is fine, and will work without any errors (if I'm following). Btw, you should use arrays versus this method, arrays kick ass. Sure doing ${'foo'.$i} or similiar has its purpose but usually an array will do (please!).
When in doubt, put error_reporting(E_ALL) on top of your script and go to town.
Regards, Philip Olson
On Tue, 2 Apr 2002, Erik Price wrote:
>
> On Tuesday, April 2, 2002, at 03:27 PM, Philip Olson wrote:
>
> > If you're distributing code in cyberspace it's a good
> > idea to make it error free too, E_NOTICE or otherwise.
>
> I got back quite a few responses on this list on the subject of having
> variables that are not defined before they are used. That's
> interesting -- it's nice to know that I can take shortcuts and conjure
> them up on the fly, but I didn't realize that it was good practice to
> declare the variable before you actually use it in a script. (I never
> studied programming in any formal sense, as anyone who has seen my
> source code can attest :).
>
> Sometimes I create variables dynamically, such that I could never
> declare/initialize them in any realistic sense -- for instance, I might
> have a while loop that executes a number of times equal to the number of
> rows pulled from a database query. And in this while loop, I might
> generate a new variable (assigning it a name like $variable$i, using the
> old $i++ trick to give it a unique numeric suffix).
>
> If I use this trick, does this doom me to never having fully-error-free
> code? Or is there something that I'm not getting here... The short of
> it is that, as a novice programmer, I'd like to make sure I'm writing
> the most legitimate code that I can. Thanks for any input on this
> thread, past or future.
>
>
> Erik
>
>
>
> ----
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> pricee
hhbrown.com
>
attached mail follows:
I released new version of HTML template class.
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top
You can separate HTML & PHP completely, and make it easy to build large complicated web site rapidly. Moreover, it makes clear to separate the job between a web designer & a programmer.
I appreciate any feedback.
Thanks, Hiroshi Ayukawa
attached mail follows:
okay i've posted something before here are my scripts either you tell me what i do wrong or i'll go beserk
you can check the outcome of the code on the following adress
http://www.filenexus.com/piet.php
here's the code for piet.php :
<?php
// open session and begin registering values
session_start();
session_register("fubar1"); session_register("fubar2"); session_register("fubar3");
$fubar1 = "Remko";
$fubar2 = "Lindeman";
$fubar3 = "I3M1I";
header("Location: retief.php?".SID);
?>
here's the code for retief.php :
<?php
// begin the retrieval of propagated values
$remko = $HTTP_SESSION_VARS["fubar1"]; $lindeman = $HTTP_SESSION_VARS["fubar2"]; $klas = $HTTP_SESSION_VARS["fubar3"];
echo $remko; echo $lindeman; echo $klas;
?>
the problem is that the values don't get registered
attached mail follows:
Try putting session_start() in your retief.php script as well as piet.php.
-Steve
On Wednesday, April 3, 2002, at 01:06 PM, R. Lindeman wrote:
> okay i've posted something before here are my scripts either you tell me > what i do wrong or i'll go beserk > > you can check the outcome of the code on the following adress > > http://www.filenexus.com/piet.php > > here's the code for piet.php : > > <?php > > // open session and begin registering values > > session_start(); > > session_register("fubar1"); > session_register("fubar2"); > session_register("fubar3"); > > $fubar1 = "Remko"; > > $fubar2 = "Lindeman"; > > $fubar3 = "I3M1I"; > > header("Location: retief.php?".SID); > > ?> > > here's the code for retief.php : > > <?php > > // begin the retrieval of propagated values > > $remko = $HTTP_SESSION_VARS["fubar1"]; > $lindeman = $HTTP_SESSION_VARS["fubar2"]; > $klas = $HTTP_SESSION_VARS["fubar3"]; > > echo $remko; > echo $lindeman; > echo $klas; > > ?> > > > the problem is that the values don't get registered > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
On Wednesday, April 3, 2002, at 02:06 PM, R. Lindeman wrote:
> // open session and begin registering values > > session_start(); > > session_register("fubar1"); > session_register("fubar2"); > session_register("fubar3"); > > $fubar1 = "Remko"; > > $fubar2 = "Lindeman"; > > $fubar3 = "I3M1I";
. . .
> the problem is that the values don't get registered
If you are using PHP 4.1.x or greater, then try using the following code to register your sessions -- it is easier and may work better.
<?php
// start the session and register the variables session_start(); $_SESSION['fubar1'] = 'Remko'; $_SESSION['fubar2'] = 'Lindeman'; $_SESSION['fubar3'] = 'I3M1I';
// (put rest of code here)
?>
If you're using PHP 4.0.x or lower, then nevermind, this won't help you.
Erik
----Erik Price Web Developer Temp Media Lab, H.H. Brown pricee
hhbrown.com
attached mail follows:
Try establishing the variables first then register them as session variables. I guess you can't access the session variable directly so that may also mean you cannot set the session variable if you have nothing to actually put in it... : )
"R. Lindeman" <rlindeman
filenexus.com> wrote in message
news:20020402210656.33887.qmail
pb1.pair.com...
> okay i've posted something before here are my scripts either you tell me
> what i do wrong or i'll go beserk
>
> you can check the outcome of the code on the following adress
>
> http://www.filenexus.com/piet.php
>
> here's the code for piet.php :
>
> <?php
>
> // open session and begin registering values
>
> session_start();
>
> session_register("fubar1");
> session_register("fubar2");
> session_register("fubar3");
>
> $fubar1 = "Remko";
>
> $fubar2 = "Lindeman";
>
> $fubar3 = "I3M1I";
>
> header("Location: retief.php?".SID);
>
> ?>
>
> here's the code for retief.php :
>
> <?php
>
> // begin the retrieval of propagated values
>
> $remko = $HTTP_SESSION_VARS["fubar1"];
> $lindeman = $HTTP_SESSION_VARS["fubar2"];
> $klas = $HTTP_SESSION_VARS["fubar3"];
>
> echo $remko;
> echo $lindeman;
> echo $klas;
>
> ?>
>
>
> the problem is that the values don't get registered
>
>
attached mail follows:
Opps ... sorry I jumped too soon at answering that.. But from what I can tell the header function is screwing you up probly because it is like a redirect. If you register session data I would think it would have to be sent in the header to the client.. Maybe a workaround would be to echo vb or java script to redirect instead of redirecting from the server.. That way the header info would be written... so try this... in place of the header function...
echo "<script language='vbscript'>\n"; echo "location.href=\"retief.php?".SID."\"\n"; echo "</script>\n";
"Nate" <sonicysa
hotmail.com> wrote in message
news:20020403014127.11064.qmail
pb1.pair.com...
> Try establishing the variables first then register them as session
> variables.
> I guess you can't access the session variable directly so that may also
mean
> you cannot set the session variable if you have nothing to actually put in
> it... : )
>
>
> "R. Lindeman" <rlindeman
filenexus.com> wrote in message
> news:20020402210656.33887.qmail
pb1.pair.com...
> > okay i've posted something before here are my scripts either you tell me
> > what i do wrong or i'll go beserk
> >
> > you can check the outcome of the code on the following adress
> >
> > http://www.filenexus.com/piet.php
> >
> > here's the code for piet.php :
> >
> > <?php
> >
> > // open session and begin registering values
> >
> > session_start();
> >
> > session_register("fubar1");
> > session_register("fubar2");
> > session_register("fubar3");
> >
> > $fubar1 = "Remko";
> >
> > $fubar2 = "Lindeman";
> >
> > $fubar3 = "I3M1I";
> >
> > header("Location: retief.php?".SID);
> >
> > ?>
> >
> > here's the code for retief.php :
> >
> > <?php
> >
> > // begin the retrieval of propagated values
> >
> > $remko = $HTTP_SESSION_VARS["fubar1"];
> > $lindeman = $HTTP_SESSION_VARS["fubar2"];
> > $klas = $HTTP_SESSION_VARS["fubar3"];
> >
> > echo $remko;
> > echo $lindeman;
> > echo $klas;
> >
> > ?>
> >
> >
> > the problem is that the values don't get registered
> >
> >
>
>
attached mail follows:
I have a header section for my website and I'd like to include it into each page. Since this is where I'm housing all of my navagation. Here is my problem though. I have the header tables sitting in a page header.htm. I'm calling it as so: <? require ("header.htm") ?>
This works fine as long as I stay in the main folder /htdocs where the header.htm file is. The problem lies when I go any deeper. I tried replacing the link with: <? require ("/header.htm") ?> Hoping that would put it back to the /htdocs folder as it works for my standard links. Instead I get this: Fatal error: Failed opening required '/header.htm' (include_path='.:/usr/local/lib/php') in /www/foo/htdocs/foo/index_test.php on line 82
I've tried correcting it by including the full path: <? require ("http://www.foo.com/header.htm") ?>
This does work but it's so amazingly slow. Even on my cable connection it will take 20-30 seconds to load this. I've switched back and forth between require and include with no change in speed. Anyone have a suggestion or an idea on why my load time is suffering so much?
I hope all of that was clear enough.
Thanks anti-blank
attached mail follows:
try replacing your include with the full data path to the header file rather than a URL, php has to establish a http connect and download your header file before proceeding.
require ("/path/to/file/header.htm")
sometimes depending on what web server software you are using, you may need to do it like this
require ("./path/to/file/header.htm")
note the "." in front of the path
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall
buckle.com
-----Original Message-----
From: anti-blank [mailto:anti
anti-blank.com]
Sent: Tuesday, April 02, 2002 3:38 PM
To: php-general
lists.php.net
Subject: [PHP] Really slow include
I have a header section for my website and I'd like to include it into each page. Since this is where I'm housing all of my navagation. Here is my problem though. I have the header tables sitting in a page header.htm. I'm calling it as so: <? require ("header.htm") ?>
This works fine as long as I stay in the main folder /htdocs where the header.htm file is. The problem lies when I go any deeper. I tried replacing the link with: <? require ("/header.htm") ?> Hoping that would put it back to the /htdocs folder as it works for my standard links. Instead I get this: Fatal error: Failed opening required '/header.htm' (include_path='.:/usr/local/lib/php') in /www/foo/htdocs/foo/index_test.php on line 82
I've tried correcting it by including the full path: <? require ("http://www.foo.com/header.htm") ?>
This does work but it's so amazingly slow. Even on my cable connection it will take 20-30 seconds to load this. I've switched back and forth between require and include with no change in speed. Anyone have a suggestion or an idea on why my load time is suffering so much?
I hope all of that was clear enough.
Thanks anti-blank
attached mail follows:
Good day,
The include/require path is relative to the filesystem as seen by the web system user, not the web root.
It's designed this way so that you can put your include files someplace where users can't fetch them, which is a recommended practice.
So, if your web root is /usr/local/www on your filesystem , then you could say:
require("/usr/local/www/header/html").
If you don't put in a leading slash, it will look in the current directory.
What you were doing in your second example is asking PHP to look in the file under your root directory.
============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948
-----Original Message-----
From: anti-blank [mailto:anti
anti-blank.com]
Sent: Tuesday, April 02, 2002 2:38 PM
To: php-general
lists.php.net
Subject: [PHP] Really slow include
I have a header section for my website and I'd like to include it into each page. Since this is where I'm housing all of my navagation. Here is my problem though. I have the header tables sitting in a page header.htm. I'm calling it as so: <? require ("header.htm") ?>
This works fine as long as I stay in the main folder /htdocs where the header.htm file is. The problem lies when I go any deeper. I tried replacing the link with: <? require ("/header.htm") ?> Hoping that would put it back to the /htdocs folder as it works for my standard links. Instead I get this: Fatal error: Failed opening required '/header.htm' (include_path='.:/usr/local/lib/php') in /www/foo/htdocs/foo/index_test.php on line 82
I've tried correcting it by including the full path: <? require ("http://www.foo.com/header.htm") ?>
This does work but it's so amazingly slow. Even on my cable connection it will take 20-30 seconds to load this. I've switched back and forth between require and include with no change in speed. Anyone have a suggestion or an idea on why my load time is suffering so much?
I hope all of that was clear enough.
Thanks anti-blank
attached mail follows:
What you need to do is include the path to the file in relation to the file that is including it, this can be an absolute path or a relative path.
Eg. Assuming the file is located in /www/foo/htdocs/foo/index_test.php and the include file is in /www/foo/htdocs/
Absolute path: require("/www/foo/htdocs/header.htm"); Relative path: require("../header.htm");
It may be easiest to use a variable for the include path.
Eg.
$includePath = "/www/foo/htdocs/"; require($includePath."header.htm");
I hope this helps.
"Anti-Blank" <anti
anti-blank.com> wrote in message
news:007c01c1da8e$a12062f0$6601a8c0
noblesse...
> I have a header section for my website and I'd like to include it into
each page. Since this is where
> I'm housing all of my navagation. Here is my problem though. I have the
header tables sitting in a page
> header.htm. I'm calling it as so:
> <?
> require ("header.htm")
> ?>
>
> This works fine as long as I stay in the main folder /htdocs where the
header.htm file is.
> The problem lies when I go any deeper. I tried replacing the link with:
> <?
> require ("/header.htm")
> ?>
> Hoping that would put it back to the /htdocs folder as it works for my
standard links. Instead
> I get this:
> Fatal error: Failed opening required '/header.htm'
(include_path='.:/usr/local/lib/php') in /www/foo/htdocs/foo/index_test.php
on line 82
>
> I've tried correcting it by including the full path:
> <?
> require ("http://www.foo.com/header.htm")
> ?>
>
> This does work but it's so amazingly slow. Even on my cable connection it
will take 20-30 seconds
> to load this. I've switched back and forth between require and include
with no change in speed. Anyone
> have a suggestion or an idea on why my load time is suffering so much?
>
> I hope all of that was clear enough.
>
> Thanks
> anti-blank
>
attached mail follows:
I guess I am gonna have to plead stupid here.
I've never used access, I don't like it, and I think there are much better tools out there to do what access does.
Having said that, I work in an environment that is almost completely VBA in either access or excel.
I need to find a way to query an access database, and I wanted to do it with a auto_refresh web page.
But I cant, I cant connect to the database, I cant execute a query, and maybe I return the infamous empty yet infinite array.
maybe I should just do it in excel?
If any of you have been able to get this to work, please tell me what you did to get it to work, and how you did it.
Thanks,
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall
buckle.com
attached mail follows:
> I guess I am gonna have to plead stupid here. > > I've never used access, I don't like it, and I think there are much better tools out > there to do what access does.
We agree...
> Having said that, I work in an environment that is almost completely VBA in either > access or excel.
May god have mercy on your soul...
> I need to find a way to query an access database, and I wanted to do it with a > auto_refresh web page. > > But I cant, I cant connect to the database, I cant execute a query, and maybe I return > the infamous empty yet infinite array. > > maybe I should just do it in excel?
No
I think a way could be by trying the ODBC functions of PHP. See www.php.net/odbc
If you give us more details we might be more of a help.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
maxim
phpbeginner.com
www.phpbeginner.com
> If any of you have been able to get this to work, please tell me what
you did to get it
> to work, and how you did it.
>
> Thanks,
>
>
>
> Rance Hall
> 308.238.2455
> Internal Office Extensions: 2455 or 6655
> PC Programmer, The Buckle, Inc.
> rance.hall
buckle.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
If you want,
I can give you an ODBC Db abstraction layer.. there are only a few things not complete on it, it's at abuot 90%
----- Original Message -----
From: "Maxim Maletsky" <subscriptions
phpbeginner.com>
To: "'Rance Hall'" <Rance.Hall
Buckle.com>; <php-general
lists.php.net>
Sent: Tuesday, April 02, 2002 6:31 PM
Subject: RE: [PHP] PHP and MS Access
> > I guess I am gonna have to plead stupid here.
> >
> > I've never used access, I don't like it, and I think there are much
> better tools out
> > there to do what access does.
>
> We agree...
>
> > Having said that, I work in an environment that is almost completely
> VBA in either
> > access or excel.
>
> May god have mercy on your soul...
>
> > I need to find a way to query an access database, and I wanted to do
> it with a
> > auto_refresh web page.
> >
> > But I cant, I cant connect to the database, I cant execute a query,
> and maybe I return
> > the infamous empty yet infinite array.
> >
> > maybe I should just do it in excel?
>
> No
>
>
> I think a way could be by trying the ODBC functions of PHP.
> See www.php.net/odbc
>
> If you give us more details we might be more of a help.
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
>
> PHPBeginner.com (Where PHP Begins)
> maxim
phpbeginner.com
> www.phpbeginner.com
>
>
>
>
>
> > If any of you have been able to get this to work, please tell me what
> you did to get it
> > to work, and how you did it.
> >
> > Thanks,
> >
> >
> >
> > Rance Hall
> > 308.238.2455
> > Internal Office Extensions: 2455 or 6655
> > PC Programmer, The Buckle, Inc.
> > rance.hall
buckle.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.n=1 H
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
the images folder is in ..../website/testingArea/images the php page is located in ..../website/testingArea/administration/image.php I have confirmed that the file I want to display does exist in the images folder, and that the path is correct.
If I include a tag in images.php like so: <IMG SRC="/home<? echo $DOCUMENT_ROOT . SITE_LOCATION ?>/images/TopNavBar_01.jpg" WIDTH=93 HEIGHT=110>
Where SITE_LOCATION=testingArea/
The image will not display. I have tried with and without the /home at the beginning and neither one works. What's going on ?
Carl
attached mail follows:
examine the generated HTML with View Source in your browser. Does it contain what you expect?
-----Original Message-----
From: Carl [mailto:cschmidt
latitude360.com]
Sent: Tuesday, April 02, 2002 4:45 PM
To: php-general
lists.php.net
Subject: [PHP] images not displaying
the images folder is in ..../website/testingArea/images the php page is located in ..../website/testingArea/administration/image.php I have confirmed that the file I want to display does exist in the images folder, and that the path is correct.
If I include a tag in images.php like so: <IMG SRC="/home<? echo $DOCUMENT_ROOT . SITE_LOCATION ?>/images/TopNavBar_01.jpg" WIDTH=93 HEIGHT=110>
Where SITE_LOCATION=testingArea/
The image will not display. I have tried with and without the /home at the beginning and neither one works. What's going on ?
Carl
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
yes. the SRC=/home..../website/testingArea/images/<imagename.jpg>
Should I just make it http://website.com/testingArea/images/ ______________________________________
Carl Schmidt | Developer |
Latitude360.com a division of RWD Technologies,Inc. |
CSchmidt
latitude360.com
-----Original Message-----
From: Rick Emery [mailto:remery
excel.com]
Sent: Tuesday, April 02, 2002 5:49 PM
To: Schmidt, Carl; php-general
lists.php.net
Subject: RE: [PHP] images not displaying
examine the generated HTML with View Source in your browser. Does it contain what you expect?
-----Original Message-----
From: Carl [mailto:cschmidt
latitude360.com]
Sent: Tuesday, April 02, 2002 4:45 PM
To: php-general
lists.php.net
Subject: [PHP] images not displaying
the images folder is in ..../website/testingArea/images the php page is located in ..../website/testingArea/administration/image.php I have confirmed that the file I want to display does exist in the images folder, and that the path is correct.
If I include a tag in images.php like so: <IMG SRC="/home<? echo $DOCUMENT_ROOT . SITE_LOCATION ?>/images/TopNavBar_01.jpg" WIDTH=93 HEIGHT=110>
Where SITE_LOCATION=testingArea/
The image will not display. I have tried with and without the /home at the beginning and neither one works. What's going on ?
Carl
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Nevermind, dumb mistake on my part. I need some HTML 101....
______________________________________
Carl Schmidt | Developer |
Latitude360.com a division of RWD Technologies,Inc. |
CSchmidt
latitude360.com |
877.9LAT360 | 410.869.7025 |
-----Original Message-----
From: Rick Emery [mailto:remery
excel.com]
Sent: Tuesday, April 02, 2002 5:49 PM
To: Schmidt, Carl; php-general
lists.php.net
Subject: RE: [PHP] images not displaying
examine the generated HTML with View Source in your browser. Does it contain what you expect?
-----Original Message-----
From: Carl [mailto:cschmidt
latitude360.com]
Sent: Tuesday, April 02, 2002 4:45 PM
To: php-general
lists.php.net
Subject: [PHP] images not displaying
the images folder is in ..../website/testingArea/images the php page is located in ..../website/testingArea/administration/image.php I have confirmed that the file I want to display does exist in the images folder, and that the path is correct.
If I include a tag in images.php like so: <IMG SRC="/home<? echo $DOCUMENT_ROOT . SITE_LOCATION ?>/images/TopNavBar_01.jpg" WIDTH=93 HEIGHT=110>
Where SITE_LOCATION=testingArea/
The image will not display. I have tried with and without the /home at the beginning and neither one works. What's going on ?
Carl
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
You're saying the generated URL contains 4 periods after the word "home"? That would be a problem. It needs to be the URL of the image source, as you suggest in your second sentence.
-----Original Message-----
From: Schmidt, Carl [mailto:CSchmidt
latitude360.com]
Sent: Tuesday, April 02, 2002 4:56 PM
To: 'Rick Emery'; php-general
lists.php.net
Subject: RE: [PHP] images not displaying
yes. the SRC=/home..../website/testingArea/images/<imagename.jpg>
Should I just make it http://website.com/testingArea/images/ ______________________________________
Carl Schmidt | Developer |
Latitude360.com a division of RWD Technologies,Inc. |
CSchmidt
latitude360.com
-----Original Message-----
From: Rick Emery [mailto:remery
excel.com]
Sent: Tuesday, April 02, 2002 5:49 PM
To: Schmidt, Carl; php-general
lists.php.net
Subject: RE: [PHP] images not displaying
examine the generated HTML with View Source in your browser. Does it contain what you expect?
-----Original Message-----
From: Carl [mailto:cschmidt
latitude360.com]
Sent: Tuesday, April 02, 2002 4:45 PM
To: php-general
lists.php.net
Subject: [PHP] images not displaying
the images folder is in ..../website/testingArea/images the php page is located in ..../website/testingArea/administration/image.php I have confirmed that the file I want to display does exist in the images folder, and that the path is correct.
If I include a tag in images.php like so: <IMG SRC="/home<? echo $DOCUMENT_ROOT . SITE_LOCATION ?>/images/TopNavBar_01.jpg" WIDTH=93 HEIGHT=110>
Where SITE_LOCATION=testingArea/
The image will not display. I have tried with and without the /home at the beginning and neither one works. What's going on ?
Carl
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I think he was doing that silly thing where people asking for help obfuscate IP addresses and pathnames, thinking somehow it improves their security, when in fact it only makes it difficult to figure out what on earth they're talking about - because they INVARIABLY hide relevant information or introduce errors in the process of obfuscation.
Folks, if your setup is so insecure that showing your pathname will leave your server vulnerable to attack, then disconnect it from the internet immediately.
If it is not, then post the real data.
miguel
On Tue, 2 Apr 2002, Rick Emery wrote:
> You're saying the generated URL contains 4 periods after the word "home"?
> That would be a problem. It needs to be the URL of the image source, as you
> suggest in your second sentence.
>
> -----Original Message-----
> From: Schmidt, Carl [mailto:CSchmidt
latitude360.com]
> Sent: Tuesday, April 02, 2002 4:56 PM
> To: 'Rick Emery'; php-general
lists.php.net
> Subject: RE: [PHP] images not displaying
>
>
> yes. the SRC=/home..../website/testingArea/images/<imagename.jpg>
> Should I just make it http://website.com/testingArea/images/
latitude360.com
excel.com]
> Sent: Tuesday, April 02, 2002 5:49 PM
> To: Schmidt, Carl; php-general
lists.php.net
> Subject: RE: [PHP] images not displaying
>
>
> examine the generated HTML with View Source in your browser. Does it
> contain what you expect?
>
> -----Original Message-----
> From: Carl [mailto:cschmidt
latitude360.com]
> Sent: Tuesday, April 02, 2002 4:45 PM
> To: php-general
lists.php.net
> Subject: [PHP] images not displaying
>
>
> the images folder is in ..../website/testingArea/images
> the php page is located in ..../website/testingArea/administration/image.php
> I have confirmed that the file I want to display does exist in the images
> folder, and that the path is correct.
>
> If I include a tag in images.php like so:
> <IMG SRC="/home<? echo $DOCUMENT_ROOT . SITE_LOCATION
> ?>/images/TopNavBar_01.jpg" WIDTH=93 HEIGHT=110>
>
> Where SITE_LOCATION=testingArea/
>
> The image will not display. I have tried with and without the /home at the
> beginning and neither one works. What's going on ?
>
> Carl
>
>
>
>
attached mail follows:
I use php4.0.5, OS : WIN2000, Webserver : Apache
I want to use session to make global variable in file php.ini..... I have set item below become enabled - register_globals - auto_start - use_trans_sid (to compiled with --enable-trans-sid)
in my first file myfirst.php, I register session like below : session_register ("ses_useid"); session_register ("ses_usename"); $ses_useid="4"; $ses_usename="toto";
and on second file mysecond.php, I get value of those session to check session value like below: print $ses_useid; print $ses_usename;
but I have no result from mysecond.php
Is there anybody can help me???
thx
regards,
Dini...
attached mail follows:
Hello List,
Has anyone ever converted an excel file over to a MySQL database via PHP? I'm currently doing it with perl, and this isn't a very good option for me. The client needs to login to a server via ssh every time they want to put data from their excel file to mysql. I'd like to find some way to do it through a web browser.
Thanks for any suggestions,
Tyler Longren
Captain Jack Communications
tyler
captainjack.com
www.captainjack.com
attached mail follows:
> Has anyone ever converted an excel file over to a MySQL database > via PHP? I'm currently doing it with perl, and this isn't a very > good option for me. The client needs to login to a server via ssh > every time they want to put data from their excel file to mysql. > I'd like to find some way to do it through a web browser.
If you can get them to save the Excel file as tab-delimited, you could just read it, explode on \t and assemble your SQL insert statements.
Failing that, you could continue to use the Perl script but accept the Excel file as a HTTP upload, and have PHP run the Perl script.
J
attached mail follows:
Thanks Jason, that is a pretty good idea. Any idea how well PHP handles large ammounts of data like that? There'll be about 25,000 lines in every excel file, and they come in groups of 5 or 6.
Tyler Longren
Captain Jack Communications
tyler
captainjack.com
www.captainjack.com
----- Original Message -----
From: "Jason Murray" <Jason.Murray
melbourneit.com.au>
To: "'Tyler Longren'" <tyler
captainjack.com>; "php-general"
<php-general
lists.php.net>
Sent: Tuesday, April 02, 2002 7:32 PM
Subject: RE: [PHP] reading excel file
> > Has anyone ever converted an excel file over to a MySQL database > > via PHP? I'm currently doing it with perl, and this isn't a very > > good option for me. The client needs to login to a server via ssh > > every time they want to put data from their excel file to mysql. > > I'd like to find some way to do it through a web browser. > > If you can get them to save the Excel file as tab-delimited, you > could just read it, explode on \t and assemble your SQL insert > statements. > > Failing that, you could continue to use the Perl script but accept > the Excel file as a HTTP upload, and have PHP run the Perl script. > > J > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
If it's possible, it probably better to deal with each line by itself, rather than try to load to whole file into memory.
Martin
-----Original Message-----
From: Tyler Longren [mailto:tyler
captainjack.com]
Sent: Wednesday, April 03, 2002 11:37 AM
To: Jason Murray; php-general
Subject: Re: [PHP] reading excel file
Thanks Jason, that is a pretty good idea. Any idea how well PHP handles large ammounts of data like that? There'll be about 25,000 lines in every excel file, and they come in groups of 5 or 6.
Tyler Longren
Captain Jack Communications
tyler
captainjack.com
www.captainjack.com
----- Original Message -----
From: "Jason Murray" <Jason.Murray
melbourneit.com.au>
To: "'Tyler Longren'" <tyler
captainjack.com>; "php-general"
<php-general
lists.php.net>
Sent: Tuesday, April 02, 2002 7:32 PM
Subject: RE: [PHP] reading excel file
> > Has anyone ever converted an excel file over to a MySQL database > > via PHP? I'm currently doing it with perl, and this isn't a very > > good option for me. The client needs to login to a server via ssh > > every time they want to put data from their excel file to mysql. > > I'd like to find some way to do it through a web browser. > > If you can get them to save the Excel file as tab-delimited, you > could just read it, explode on \t and assemble your SQL insert > statements. > > Failing that, you could continue to use the Perl script but accept > the Excel file as a HTTP upload, and have PHP run the Perl script. > > J > > -- > 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:
> Thanks Jason, that is a pretty good idea. Any idea how well > PHP handles large ammounts of data like that? There'll be about > 25,000 lines in every excel file, and they come in groups of 5 or 6.
I've rigged up an import script for similar functions before, it seems to run ok... it really depends on the specs of the server you're running it on. If you notice slowness, consider raising the timeout by X seconds per Y lines, then you can judge the size of the incoming file and change how long PHP gets to run.
J
attached mail follows:
> If it's possible, it probably better to deal with each line > by itself, rather than try to load to whole file into memory.
Good point. Shared server admins probably hate me. ;)
J
attached mail follows:
If you are running your server on windows, you may also have the option of using COM to access Excel to open the file and read the information contained in each cell, See
http://www.php.net/manual/en/ref.com.php
Warren Vail Tools, Metrics & Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658
-----Original Message-----
From: Jason Murray [mailto:Jason.Murray
melbourneit.com.au]
Sent: Tuesday, April 02, 2002 5:33 PM
To: 'Tyler Longren'; php-general
Subject: RE: [PHP] reading excel file
> Has anyone ever converted an excel file over to a MySQL database > via PHP? I'm currently doing it with perl, and this isn't a very > good option for me. The client needs to login to a server via ssh > every time they want to put data from their excel file to mysql. > I'd like to find some way to do it through a web browser.
If you can get them to save the Excel file as tab-delimited, you could just read it, explode on \t and assemble your SQL insert statements.
Failing that, you could continue to use the Perl script but accept the Excel file as a HTTP upload, and have PHP run the Perl script.
J
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
$guess = = $number is wrong.
You should write: $guess == $number
Regards, Hiroshi Ayukawa http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top
attached mail follows:
Eric,
Forgive me for coming in late on this... I haven't read the whole thread, but I'd start be saying that obviously JavaScript is not an option, and quite possible "asking them not to click the back button" is not an option either.
I use the following theory on a single page form, but can't see any reason why it can't happen on a multi part form.
I perform all form validation BEFORE outputting anything to the page, and establish if the form data was good or not. Good results in uploading to the DB, and a redirect to a thanks page (or in your case, another form), and bad results in the form being shown again.
Since nothing is sent to the page (other than a redirect) if the data is good, the page doesn't exist at the browser, so there's no chance of them hitting back and re-submitting the data twice by accident.
Of course they CAN hit back and see the form they just filled out, and make changes to it, and resubmit on purpose, but is this such a bad thing??
On the other hand, once they reach stage 2 (ie, stage 1 was valid), you could always set a cookie. If they DO click back to stage 1, you could always do a check for that cookie, and NOT show them the form again, which removes just about any chance of them resubmitting data, or going back thru the steps, UNLESS they have cookies turned off... which is a low percentage.
Changing this to sessions in the URL would remove the chance all together.
I'd recommend NOT breaking THEIR browser with the disabling of the back button... it's THEIRS after all, and they may WANT to go back through the sites they surfed before hitting you.
Just my opinion though :)
Justin French -------------------- Creative Director http://Indent.com.au --------------------
on 03/04/02 1:54 AM, Erik Price (pricee
hhbrown.com) wrote:
>
> On Tuesday, April 2, 2002, at 09:15 AM, Rick Emery wrote:
>
>> use cache control in your HTML to prevent BACK button usage
>> This is easily done
>
> I've tried this using the HTTP headers recommended on the header() man
> page, such as
>
> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
> header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
> header("Cache-Control: no-store, no-cache, must-revalidate");
> header("Cache-Control: post-check=0, pre-check=0", false);
> header("Pragma: no-cache");
>
> These don't seem to have the effect that I'm looking for. Someone else
> on the list suggested storing a session variable that basically says
> "this page has been filled out, do not do anything if it has been
> resubmit" which is a good idea, but I was hoping to have the user
> automatically re-routed to an error page if they hit the "back" button.
> (The session variable idea won't work until they refresh a page or
> submit a form, because they will be returning to a page in their
> history.)
>
>
> Erik
>
>
>
> ----
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> pricee
hhbrown.com
>
attached mail follows:
hi,
i was wondering if anyone knows how i can execute a cgi script (with -rwxrwxrwx mode) written in perl from within php?
i tried
<?php include ('mycgi.cgi'); ?>
but the content of the cgi file is displayed instead of executing it.
<?php system ('mycgi.cgi'); ?>
didn't help as well.
i also tried calling the url where this cgi is located (which is in the same file structure my php is located), like this:
<?php include ('http://www.myurl.org/mycgi.cgi'); ?>
but the browse keeps on loading and nothing shows up.
thanks in advance.
/bw
attached mail follows:
try exec() or back-ticks `` see how that goes
Martin
-----Original Message-----
From: Boris Wong [mailto:borisw
amazon.com]
Sent: Wednesday, April 03, 2002 11:54 AM
To: php-general
lists.php.net
Subject: [PHP] php and cgi
hi,
i was wondering if anyone knows how i can execute a cgi script (with -rwxrwxrwx mode) written in perl from within php?
i tried
<?php include ('mycgi.cgi'); ?>
but the content of the cgi file is displayed instead of executing it.
<?php system ('mycgi.cgi'); ?>
didn't help as well.
i also tried calling the url where this cgi is located (which is in the same file structure my php is located), like this:
<?php include ('http://www.myurl.org/mycgi.cgi'); ?>
but the browse keeps on loading and nothing shows up.
thanks in advance.
/bw
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I'm trying to use the mail() function to send mail to a mailing list and because of the junk mail problem of hotmail, I'm trying to send mail one by one. The problem of using this method is that it always exceed the max execution time of 30s before the script reaches end of parsing.
I'm using a remote hosting, so I cannot play with the configuration file. Also, the server is in safe mode, so I cannot use the set_time_limit() function to extend that max exec. time. The server also doesn't provide any existing mailing list tools.
Is there any way I can solve this problem? Is there any work arounds?
I'm not sending spam mail. It's for a student club.
Thank you.
attached mail follows:
How would I make an "<a name="blah"></a>" link in php?? I'm using php nuke.
---Alias: |{iller -Website: http://www.ai-syndicate.com -AIM: Prn2000Str -Email: gno1316
comcast.net
attached mail follows:
“中国足球出征2002年世界杯中国足球协会指定网站”正式上线 http://worldcup.sohu.com/ 搜狐焦点新闻天天送 http://sms.sohu.com/ 搜狐黄页登陆上海市场 http://114.sohu.com/
attached mail follows:
I got an email someone submitted through my web form. I've been using this form for a while, and it had always worked. It still works, but something new has popped up.
If someone writes, "I'm available to meet with you anytime. We'll talk about our project."
It appears as: I\'m available to meet with you anytime. We\'ll talk about our project.
The mail() function as shown: mail("$recipientname <$final_recipient>","$form[subject]","$form[first_name] $form[last_name] ($form[email]) send the following message to $recipientname ($final_recipient) : \n\n $form[message]\n\n Name: $form[first_name] $form[last_name] \n Email: $form[email] \n Subject: $form[subject] \n", "From: $form[first_name] $form[last_name] <$form[email]>\nReply-To: $form[first_name] $form[last_name] <$form[email]>\nContent-type: text/plain\nX-Mailer: PHP/" . phpversion());
Only a week or so ago, I've switched server machines from the one that had version 4.0.4pl1 (my old server) over to a new server that has version 4.1.2.
The other differences I can see from these two is that the 4.1.2 version has magic_quotes_gpc on, where the other one didn't.
How would I set this up so that the comments posted in my forms doesn't get addslashed? I tried adding the stripslashes, but what happened was I get an email with no data in it.
attached mail follows:
stripslashes() should work - or set the magic quote thingy to off
-----Original Message-----
From: lmlweb [mailto:junkit
lmlweb.com]
Sent: Wednesday, April 03, 2002 1:12 PM
To: php-general
lists.php.net
Subject: [PHP] Mail function acting a bit differently
I got an email someone submitted through my web form. I've been using this form for a while, and it had always worked. It still works, but something new has popped up.
If someone writes, "I'm available to meet with you anytime. We'll talk about our project."
It appears as: I\'m available to meet with you anytime. We\'ll talk about our project.
The mail() function as shown: mail("$recipientname <$final_recipient>","$form[subject]","$form[first_name] $form[last_name] ($form[email]) send the following message to $recipientname ($final_recipient) : \n\n $form[message]\n\n Name: $form[first_name] $form[last_name] \n Email: $form[email] \n Subject: $form[subject] \n", "From: $form[first_name] $form[last_name] <$form[email]>\nReply-To: $form[first_name] $form[last_name] <$form[email]>\nContent-type: text/plain\nX-Mailer: PHP/" . phpversion());
Only a week or so ago, I've switched server machines from the one that had version 4.0.4pl1 (my old server) over to a new server that has version 4.1.2.
The other differences I can see from these two is that the 4.1.2 version has magic_quotes_gpc on, where the other one didn't.
How would I set this up so that the comments posted in my forms doesn't get addslashed? I tried adding the stripslashes, but what happened was I get an email with no data in it.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hosted web, so option to turn on or off is up to the hosting company, not me.
stripslashes what?
$form = stripslashes($form); mail(...); or $form[message] = stripslashes($form[message]); mail(...);
"Martin Towell" <martin.towell
world.net> wrote in message
news:6416776FCC55D511BC4E0090274EFEF508A146
exchange.world.net...
> stripslashes() should work - or set the magic quote thingy to off
>
> -----Original Message-----
> From: lmlweb [mailto:junkit
lmlweb.com]
> Sent: Wednesday, April 03, 2002 1:12 PM
> To: php-general
lists.php.net
> Subject: [PHP] Mail function acting a bit differently
>
>
> I got an email someone submitted through my web form. I've been using this
> form for a while, and it had always worked. It still works, but something
> new has popped up.
>
> If someone writes, "I'm available to meet with you anytime. We'll talk
about
> our project."
>
> It appears as: I\'m available to meet with you anytime. We\'ll talk about
> our project.
>
> The mail() function as shown:
> mail("$recipientname
<$final_recipient>","$form[subject]","$form[first_name]
> $form[last_name] ($form[email]) send the following message to
$recipientname
> ($final_recipient) : \n\n $form[message]\n\n Name: $form[first_name]
> $form[last_name] \n Email: $form[email] \n Subject: $form[subject] \n",
> "From: $form[first_name] $form[last_name] <$form[email]>\nReply-To:
> $form[first_name] $form[last_name] <$form[email]>\nContent-type:
> text/plain\nX-Mailer: PHP/" . phpversion());
>
> Only a week or so ago, I've switched server machines from the one that had
> version 4.0.4pl1 (my old server) over to a new server that has version
> 4.1.2.
>
> The other differences I can see from these two is that the 4.1.2 version
> has magic_quotes_gpc on, where the other one didn't.
>
> How would I set this up so that the comments posted in my forms doesn't
get
> addslashed? I tried adding the stripslashes, but what happened was I get
an
> email with no data in it.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
the latter - you can't stripslashes() an array - okay, you can, but you're going to get back the literal "Array"
no, you'll have to do each one seperately. so: $form[message] = stripslashes($form[message]); mail(...); (personally, I put quotes around non-numerical indexes, but anyway) would be the way to go
Martin
-----Original Message-----
From: lmlweb [mailto:junkit
lmlweb.com]
Sent: Wednesday, April 03, 2002 2:00 PM
To: php-general
lists.php.net
Subject: Re: [PHP] Mail function acting a bit differently
Hosted web, so option to turn on or off is up to the hosting company, not me.
stripslashes what?
$form = stripslashes($form); mail(...); or $form[message] = stripslashes($form[message]); mail(...);
"Martin Towell" <martin.towell
world.net> wrote in message
news:6416776FCC55D511BC4E0090274EFEF508A146
exchange.world.net...
> stripslashes() should work - or set the magic quote thingy to off
>
> -----Original Message-----
> From: lmlweb [mailto:junkit
lmlweb.com]
> Sent: Wednesday, April 03, 2002 1:12 PM
> To: php-general
lists.php.net
> Subject: [PHP] Mail function acting a bit differently
>
>
> I got an email someone submitted through my web form. I've been using this
> form for a while, and it had always worked. It still works, but something
> new has popped up.
>
> If someone writes, "I'm available to meet with you anytime. We'll talk
about
> our project."
>
> It appears as: I\'m available to meet with you anytime. We\'ll talk about
> our project.
>
> The mail() function as shown:
> mail("$recipientname
<$final_recipient>","$form[subject]","$form[first_name]
> $form[last_name] ($form[email]) send the following message to
$recipientname
> ($final_recipient) : \n\n $form[message]\n\n Name: $form[first_name]
> $form[last_name] \n Email: $form[email] \n Subject: $form[subject] \n",
> "From: $form[first_name] $form[last_name] <$form[email]>\nReply-To:
> $form[first_name] $form[last_name] <$form[email]>\nContent-type:
> text/plain\nX-Mailer: PHP/" . phpversion());
>
> Only a week or so ago, I've switched server machines from the one that had
> version 4.0.4pl1 (my old server) over to a new server that has version
> 4.1.2.
>
> The other differences I can see from these two is that the 4.1.2 version
> has magic_quotes_gpc on, where the other one didn't.
>
> How would I set this up so that the comments posted in my forms doesn't
get
> addslashed? I tried adding the stripslashes, but what happened was I get
an
> email with no data in it.
>
>
>
> --
> 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:
On Tue, 2 Apr 2002, lmlweb wrote: > Hosted web, so option to turn on or off is up to the hosting company, not > me.
Perhaps you can control it from a .htaccess file?
miguel
attached mail follows:
I've answered myself, thanks all!
It's definitely > $form[message] = stripslashes($form[message]); mail(...);
"Lmlweb" <junkit
lmlweb.com> wrote in message
news:20020403035605.76157.qmail
pb1.pair.com...
> Hosted web, so option to turn on or off is up to the hosting company, not
> me.
>
> stripslashes what?
>
> $form = stripslashes($form);
> mail(...);
> or
> $form[message] = stripslashes($form[message]);
> mail(...);
>
> "Martin Towell" <martin.towell
world.net> wrote in message
> news:6416776FCC55D511BC4E0090274EFEF508A146
exchange.world.net...
> > stripslashes() should work - or set the magic quote thingy to off
> >
> > -----Original Message-----
> > From: lmlweb [mailto:junkit
lmlweb.com]
> > Sent: Wednesday, April 03, 2002 1:12 PM
> > To: php-general
lists.php.net
> > Subject: [PHP] Mail function acting a bit differently
> >
> >
> > I got an email someone submitted through my web form. I've been using
this
> > form for a while, and it had always worked. It still works, but
something
> > new has popped up.
> >
> > If someone writes, "I'm available to meet with you anytime. We'll talk
> about
> > our project."
> >
> > It appears as: I\'m available to meet with you anytime. We\'ll talk
about
> > our project.
> >
> > The mail() function as shown:
> > mail("$recipientname
> <$final_recipient>","$form[subject]","$form[first_name]
> > $form[last_name] ($form[email]) send the following message to
> $recipientname
> > ($final_recipient) : \n\n $form[message]\n\n Name: $form[first_name]
> > $form[last_name] \n Email: $form[email] \n Subject: $form[subject] \n",
> > "From: $form[first_name] $form[last_name] <$form[email]>\nReply-To:
> > $form[first_name] $form[last_name] <$form[email]>\nContent-type:
> > text/plain\nX-Mailer: PHP/" . phpversion());
> >
> > Only a week or so ago, I've switched server machines from the one that
had
> > version 4.0.4pl1 (my old server) over to a new server that has version
> > 4.1.2.
> >
> > The other differences I can see from these two is that the 4.1.2
version
> > has magic_quotes_gpc on, where the other one didn't.
> >
> > How would I set this up so that the comments posted in my forms doesn't
> get
> > addslashed? I tried adding the stripslashes, but what happened was I get
> an
> > email with no data in it.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
How can I do that - controlling via .htaccess? Pointing me to references would be good.
TIA
LML
"Miguel Cruz" <mnc
stoic.net> wrote in message
news:Pine.LNX.4.44.0204022159470.26341-100000
stoic.net...
> On Tue, 2 Apr 2002, lmlweb wrote:
> > Hosted web, so option to turn on or off is up to the hosting company,
not
> > me.
>
> Perhaps you can control it from a .htaccess file?
>
> miguel
>
attached mail follows:
Why not just do
foreach($form as $key => $value) { $form[$key] = stripslashes($form[$key]); }
Eric
----- Original Message -----
From: "lmlweb" <junkit
lmlweb.com>
To: <>
Sent: Tuesday, April 02, 2002 11:04 PM
Subject: Re: [PHP] Mail function acting a bit differently
> I've answered myself, thanks all!
>
> It's definitely > $form[message] = stripslashes($form[message]);
> mail(...);
>
>
> "Lmlweb" <junkit
lmlweb.com> wrote in message
> news:20020403035605.76157.qmail
pb1.pair.com...
> > Hosted web, so option to turn on or off is up to the hosting company,
not
> > me.
> >
> > stripslashes what?
> >
> > $form = stripslashes($form);
> > mail(...);
> > or
> > $form[message] = stripslashes($form[message]);
> > mail(...);
> >
> > "Martin Towell" <martin.towell
world.net> wrote in message
> > news:6416776FCC55D511BC4E0090274EFEF508A146
exchange.world.net...
> > > stripslashes() should work - or set the magic quote thingy to off
> > >
> > > -----Original Message-----
> > > From: lmlweb [mailto:junkit
lmlweb.com]
> > > Sent: Wednesday, April 03, 2002 1:12 PM
> > > To: php-general
lists.php.net
> > > Subject: [PHP] Mail function acting a bit differently
> > >
> > >
> > > I got an email someone submitted through my web form. I've been using
> this
> > > form for a while, and it had always worked. It still works, but
> something
> > > new has popped up.
> > >
> > > If someone