|
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: Fri Mar 23 2001 - 23:10:17 CST
php-general Digest 24 Mar 2001 05:10:17 -0000 Issue 585
Topics (messages 45315 through 45410):
NNTP
45315 by: Tim
Re: Move data from one MySql table to another?
45316 by: darion mapp
45321 by: Boget, Chris
45322 by: Altunergil, Oktay
45323 by: darion mapp
45324 by: darion mapp
45327 by: Boget, Chris
45329 by: darion mapp
45333 by: Boget, Chris
Re: Permission denied
45317 by: John Almberg
"w" problem
45318 by: Jorn van Eck
45319 by: Boget, Chris
Image background bleeding through text
45320 by: Kevin Rose
Re: security
45325 by: Boget, Chris
45326 by: Cal Evans
limiting .htaccess reach
45328 by: Joe Sheble (Wizaerd)
Re: Complex IF statement
45330 by: darion mapp
45366 by: Miles Thompson
Strange behave of ImageTTFText()
45331 by: Paulo Vinícius Vitto Ruthes
chrooting
45332 by: Kurth Bemis
Re: Pre-Written Script ?
45334 by: John McCreesh
Re: Array Cleansing
45335 by: pkshifted.slackin.com
45336 by: Cal Evans
45337 by: Szii
I don't understand HTTP_SESSION_VARS
45338 by: Michael Champagne
45339 by: hi
45340 by: Michael Champagne
45343 by: Johnson, Kirk
45344 by: hi
45345 by: Michael Champagne
45346 by: hi
45347 by: Michael Champagne
45348 by: Michael Champagne
45349 by: hi
45350 by: hi
45351 by: Johnson, Kirk
45358 by: Michael Champagne
45362 by: Johnson, Kirk
Re: Session Confusion
45341 by: hi
45342 by: hi
PHPBuilder website
45352 by: Boget, Chris
45356 by: Michael Kimsal
45357 by: Boget, Chris
Sessions: suggestions and comments
45353 by: ..s.c.o.t.t.. [gts]
How send a file usig PHP code ?
45354 by: pyramid.pyramid.pl
45355 by: ..s.c.o.t.t.. [gts]
Another problem installing PHP under Solaris 8.0
45359 by: Emiliano Marmonti
How do I get one data only from the array() script?
45360 by: Scott Fletcher
45368 by: Chris Lee
What is session.cookie_secure?
45361 by: Michael Champagne
mssql
45363 by: Mauricio Alarcon
45367 by: Felix Kronlage
connection id
45364 by: andrie
Re: writing to a file
45365 by: hi
Problem with cookies
45369 by: wx
45374 by: Jaxon
45376 by: wx
45390 by: Richard Lynch
Re: Date subtraction
45370 by: BlackLord
I need an expert to tell me what I am doing wrong
45371 by: YoBro
45373 by: John Almberg
45375 by: YoBro
45377 by: calvin_phung.non.agilent.com
45378 by: Michael Hall
PHP error parsing SQL string containing assoc. array
45372 by: Michael Champagne
45409 by: Frank M. Kromann
45410 by: Matt Friedman
Re: Image from db
45379 by: Richard Lynch
Re: output to html file
45380 by: Richard Lynch
Re: inner workings of extract
45381 by: Richard Lynch
Re: dynamic url from MySql field data
45382 by: Richard Lynch
Re: PHP not seeming to work
45383 by: Richard Lynch
Re: URL parsing
45384 by: Richard Lynch
45391 by: Jaxon
45394 by: Aaron Tuller
45395 by: Jaxon
45397 by: Jaxon
Re: values from text boxes
45385 by: Richard Lynch
Re: PHP - include / require
45386 by: Richard Lynch
Re: Cache bypass
45387 by: Richard Lynch
Re: Make Script login to password protected web sites
45388 by: Richard Lynch
Re: Fopen help
45389 by: Richard Lynch
quick array questions
45392 by: Jaxon
45393 by: Michael Hall
45399 by: Aaron Tuller
Gettext on Windows
45396 by: Julian
Valid Cookie Problems
45398 by: Chris Anderson
[php] Varible declaration
45400 by: Chris Doyle
45403 by: Chris Anderson
45404 by: Chris Doyle
45405 by: Chris Doyle
45407 by: Chris Anderson
installation problem
45401 by: Paulo Vinícius Vitto Ruthes
breadcrumbs? (Was: URL parsing)
45402 by: Jaxon
I want to execute a cgi
45406 by: Brandon Orther
Explode
45408 by: Randy Johnson
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:
Does anyone know of any examples of using IMAP to connect to NNTP
newsgroups, any feedback would be appreciated
Cheers.
attached mail follows:
i know what you are trying to do i have done it before, just don't quite remember how i solved the problem, but i think what i did was to create the move link with the id of the field that you want to move, then another php file will do the stuff:
1. using the insert with the select statment you will be able to insert the row into the new table using the id in the where clause of the select section.
2. check to ensure that the data was inserted
3. delete from oldtable where id = id passed from previous page
4. return the user to the page so that they can see that the row is no longer there.
--On Fri, 23 Mar 2001 11:19:34 YoBro wrote: >Hello, > >Does anybody know where I could find out how to Move data from one Mysql >table to another. > >I have a query showing all the results, and I am trying to put a link at the >end of each row that says "move" > >Clicking this will move that records information to another table. >IE From table orders to table ordered > >Make sense? > >Please help > >-- >Regards, > > >YoBro >------------------------------------------------------------- >DO NOT REPLY TO THIS VIA EMAIL >PLEASE USE THE NEWSGROUP >All emails sent to this address are automatically deleted. >This is to avoid SPAM! >------------------------------------------------------------- > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net >For additional commands, e-mail: php-general-help
lists.php.net >To contact the list administrators, e-mail: php-list-admin
lists.php.net > >
Get 250 color business cards for FREE! at Lycos Mail http://mail.lycos.com/freemail/vistaprint_index.html
attached mail follows:
> To populate new_table from old_table you can give it this SQL: > INSERT INTO new_table (name, address) VALUES SELECT name, address FROM > old_table;
Umm, I didn't think you could do subselects in MySQL? Or am I missing something?
Chris
attached mail follows:
from the docs;
The following will not yet work in MySQL:
SELECT * FROM table1 WHERE id IN (SELECT id FROM table2); SELECT * FROM table1 WHERE id NOT IN (SELECT id FROM table2); SELECT * FROM table1 WHERE NOT EXISTS (SELECT id FROM table2 where table1.id=table2.id);
. . .
MySQL only supports INSERT ... SELECT ... and REPLACE ... SELECT ... Independent sub-selects will probably be available in Version 4.0. You can now use the function IN() in other contexts, however.
-----Original Message-----
From: Boget, Chris [mailto:Chris.Boget
wild.net]
Sent: Friday, March 23, 2001 1:41 PM
To: 'James Atkinson'; YoBro
Cc: Php-General
Lists.Php.Net
Subject: RE: [PHP] Move data from one MySql table to another?
> To populate new_table from old_table you can give it this SQL: > INSERT INTO new_table (name, address) VALUES SELECT name, address FROM > old_table;
Umm, I didn't think you could do subselects in MySQL? Or am I missing something?
Chris
attached mail follows:
NO it is not possible to use subselects at this point BUT It is possible to insert via a select check the mysql site for the insert syntax
--On Fri, 23 Mar 2001 12:41:04 Boget, Chris wrote: >> To populate new_table from old_table you can give it this SQL: >> INSERT INTO new_table (name, address) VALUES SELECT name, address FROM >> old_table; > >Umm, I didn't think you could do subselects in MySQL? >Or am I missing something? > >Chris >
Get 250 color business cards for FREE! at Lycos Mail http://mail.lycos.com/freemail/vistaprint_index.html
attached mail follows:
NO it is not possible to use subselects at this point BUT It is possible to insert via a select check the mysql site for the insert syntax
--On Fri, 23 Mar 2001 12:41:04 Boget, Chris wrote: >> To populate new_table from old_table you can give it this SQL: >> INSERT INTO new_table (name, address) VALUES SELECT name, address FROM >> old_table; > >Umm, I didn't think you could do subselects in MySQL? >Or am I missing something? > >Chris >
Get 250 color business cards for FREE! at Lycos Mail http://mail.lycos.com/freemail/vistaprint_index.html
attached mail follows:
> MySQL only supports INSERT ... SELECT ... and REPLACE ... SELECT ... > Independent sub-selects will probably be available in Version > 4.0. You can now use the function IN() in other contexts, however.
I tried the query in the original post and I could not get it to work. This is what I got:
mysql> insert into new_names (name, email) values select name, email from old_names; ERROR 1064: You have an error in your SQL syntax near 'select name, email from old_names' at line 1
What's going wrong if this is supposed to work? I'm using mySQL 3.22.32
Chris
attached mail follows:
Remove the "values" in your sql and see
--On Fri, 23 Mar 2001 13:00:23 Boget, Chris wrote: >> MySQL only supports INSERT ... SELECT ... and REPLACE ... SELECT ... >> Independent sub-selects will probably be available in Version >> 4.0. You can now use the function IN() in other contexts, however. > >I tried the query in the original post and I could not get it to work. >This is what I got: > >mysql> insert into new_names (name, email) values select name, email from >old_names; >ERROR 1064: You have an error in your SQL syntax near 'select name, email >from old_names' at line 1 > >What's going wrong if this is supposed to work? >I'm using mySQL 3.22.32 > >Chris >
Get 250 color business cards for FREE! at Lycos Mail http://mail.lycos.com/freemail/vistaprint_index.html
attached mail follows:
> Remove the "values" in your sql and see
Bingo! Damn, this is *so* cool. This is going to save me much work in the future. :)
Thanks everyone, who was involved in this thead, for the insight! I read the docs a billion times... I'm not sure how I missed this. :p
Chris
attached mail follows:
Whoopee!!!
After two days of propeller-spinning, I finally uploaded a file successfully!!!
I had to use an FTP connection to do it, because my PHP process didn't have permission to write files to my directory, but that's fine.
Here's the code snippet that worked the trick, with my servername/username/password changed to protect the innocent (me!)
Thanks to Adam for putting me on the right track, vis-a-vis file permissions.
John
=================================
echo ("$userfile<br>"); echo ($HTTP_POST_FILES['userfile']['name'] ."<br>"); echo ($HTTP_POST_FILES['userfile']['type'] ."<br>"); echo ($HTTP_POST_FILES['userfile']['size'] ."<br>"); echo ($HTTP_POST_FILES['userfile']['tmp_name'] ."<br>");
//============================= // FTP //============================= $ftp_server = "server.name.com"; $ftp_user_name = "username"; $ftp_user_pass = "password";
// open source file if ($fd = fopen($userfile, "r") or die ("Can't open file $src<br>")) print("opened file $userfile<br>"); else die("couldn't open src file $src<br>");
// set up basic FTP connection $conn_id = ftp_connect("$ftp_server");
// login with username and password $login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass");
// check connection if ((!$conn_id) || (!$login_result))
echo "Ftp connection has failed!<br>"; echo "Attempted to connect to $ftp_server for user $user<br>"; die; } else { echo "Connected to $ftp_server, for user $ftp_user_name<br>"; }
if (ftp_fput($conn_id, "testfile.txt", $fd, FTP_BINARY)) { print("ftp_fput success!!!<br>"); } else { print("ftp_put failure!!!<br>"); }
ftp_quit($conn_id); fclose($fd); //================================
attached mail follows:
Hi there,
Does someone know what's the "w" is for. This is the error message:
Warning: fopen("../_webstats/include/caches/last_visitors.cache.html","w")
Does it has to do with "write" rights??
Thanks for your answers!
-- Jorn van Eck Student Information Engineering Almere Tel: +31 614430902 E-mail: Jorn.van.Eckiie.nl Website: http://www.jornvaneck.com
attached mail follows:
> Does someone know what's the "w" is for. This is the error message: > Warning: > fopen("../_webstats/include/caches/last_visitors.cache.html","w")
Read the docs on fopen();
> Does it has to do with "write" rights??
Yes.
Read the docs on fopen();
The documentation is your friend. :)
Chris
attached mail follows:
Hello,
I am using GD v. 1.8.3, freetype 1.3.1 and php 4.0.3.p1. I am having a problem with some of my background color bleeding through my font/text when I create a new image with ImageTTFText. Specifically I want my text to be pure white (255,255,255), but it is not appearing that way on my output image.
Here is the code I am using:
$fontColor = ImageColorAllocate ($im,255,255,255); ImageTTFText($im,$fontSize,0,$fontX,$fontY,$fontColor,$fontFile,$fontText);
Has anyone else experienced this?
Thank you, Kevin
attached mail follows:
> check HTTP_REFERER. If it's not your server. toss it. It's > not the most secure way but check the page, there are other > variables you can use to accomplish the same thing.
Even better (and it'll *always* work as far as I know), check $HTTP_HOST.
Chris
attached mail follows:
RE: [PHP] securityI was going to say that but I wasn't sure if $HTTP_HOST would get the host of the page that is now executing or the host of where the page was coming from.
-----Original Message-----
From: Boget, Chris [mailto:Chris.Boget
wild.net]
Sent: Friday, March 23, 2001 12:51 PM
To: 'Cal Evans'; Randy Johnson; php-general
lists.php.net
Subject: RE: [PHP] security
> check HTTP_REFERER. If it's not your server. toss it. It's > not the most secure way but check the page, there are other > variables you can use to accomplish the same thing.
Even better (and it'll *always* work as far as I know), check $HTTP_HOST.
Chris
attached mail follows:
I'm using an .htaccess file to auto_append and auto_prepend files within a specific directory, and it works great. Unfortunaltely if I create a new sub-directory that doesn't have it's own .htaccess file, it too tries to use the auto_append and auto_prepend values of the .htaccess file from the parent directory. In this subdirectory, I don't want anything appended or prepended to my php scripts. SO what I always end up doing is creating a new .htaccess file in this subdirectory and create and empty file and use this filename and path in that new .htaccess file.
Over all, it's a bit of a PITA... so is there a way to override the auto_append and auto_prepend from an .htaccess file in a parent directory without having to go through all this every time I create a new directory?
Joseph E. Sheble
wizaerd
wizaerd.com
========================
Wizaerd's Realm
http://www.wizaerd.com
attached mail follows:
try if($var = "duck" || $var = "goose"){}else{}
now you should look into the switch-case function also
--On Wed, 13 Dec 2000 00:19:08 JCampbell wrote: >Thank you all for your help earlier! > >Now I need to know if it is possible to create a complex if statement? > >if ($variable=="duck") || ($variable=="goose"){ }else{ } > >Is how I thought it would work. I just need to know if there is an easy way >to do an OR in if statements IF variable equals duck or goose... > ><Jon> >=============================== >And shepards we shall be >For thee, my lord, for thee >For thou hath descended forth from thy hands >That our feats may swiftly carry out thy command >We will flow a river forth unto thee >And teaming with souls shall it ever be... >=============================== >http://jcampbell.blacklightning.net > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net >For additional commands, e-mail: php-general-help
lists.php.net >To contact the list administrators, e-mail: php-list-admin
lists.php.net > >
Get 250 color business cards for FREE! at Lycos Mail http://mail.lycos.com/freemail/vistaprint_index.html
attached mail follows:
You mean
if( $var == "duck" || $var == "goose" ..etc
A single equal sign is assignment, double is test for equality.
Check the string functions, you could try something like:
if ( strpos( "duckgoosehenchickenpeacock", $var ) != 0 ) {do something} else {critter in $var not part of our set}
It all depends on what you want to do, and of course "duck ... cock" could be a variable.
Have a look at switch case break as well.
Miles Thompson
At 03:04 PM 3/23/01 -0400, darion mapp wrote:
>try
>if($var = "duck" || $var = "goose"){}else{}
>
>now you should look into the switch-case function also
>--
>
>On Wed, 13 Dec 2000 00:19:08
> JCampbell wrote:
> >Thank you all for your help earlier!
> >
> >Now I need to know if it is possible to create a complex if statement?
> >
> >if ($variable=="duck") || ($variable=="goose"){ }else{ }
> >
> >Is how I thought it would work. I just need to know if there is an easy way
> >to do an OR in if statements IF variable equals duck or goose...
> >
> ><Jon>
> >===============================
> >And shepards we shall be
> >For thee, my lord, for thee
> >For thou hath descended forth from thy hands
> >That our feats may swiftly carry out thy command
> >We will flow a river forth unto thee
> >And teaming with souls shall it ever be...
> >===============================
> >http://jcampbell.blacklightning.net
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> >For additional commands, e-mail: php-general-help
lists.php.net
> >To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
>
>Get 250 color business cards for FREE! at Lycos Mail
>http://mail.lycos.com/freemail/vistaprint_index.html
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
folks...
when using my ImageTTFText() it behave quite strangely, it writes my messages backwards...
can you explain me what tha hell it's going on?
-- [ Paulo Vinícius Vitto Ruthes ] [ paulo.ruthesuol.com.br ] [ ICQ#:18058144 ] [ "Viva la cucaracha!!" ]
attached mail follows:
has anyone seen ANY information on chrooting apache? i'm interested in file system security...keeping users from reading other users files, etc....
~kurth
attached mail follows:
In article <3AB95EA0.123CAD6E
innovativeinternet.com>, Jack Sasportas
<jack
innovativeinternet.com> writes
>PhpMyAdmin is to manage MySQL, I want to take an existing table lets say
>phone_book and then have a script generate the add/edit/modify scripts so I
>don't have to code it, and look at how it is coded...
http://phpmyedit.sourceforge.net
John
attached mail follows:
This is the code I'm currently using
/* testing stuff */ echo "<!-- testing for title\n"; $newloop = 0; while ($loop < count($work)) { if ($work[$loop] !== " ") { $lazy[$newloop] = $work[$loop]; ++$newloop; } echo " Slot: $loop Value: $work[$loop] - NewSlot: $newloop NewValue: $lazy[$newloop] \n"; ++$loop; } echo " end testing for title -->\n"; /* end of test */
And this is the output I'm getting
<!-- testing for title Slot: Value: - NewSlot: 1 NewValue: Slot: 1 Value: - NewSlot: 2 NewValue: Slot: 2 Value: - NewSlot: 3 NewValue: Slot: 3 Value: - NewSlot: 4 NewValue: Slot: 4 Value: - NewSlot: 5 NewValue: Slot: 5 Value: - NewSlot: 6 NewValue: Slot: 6 Value: - NewSlot: 7 NewValue: Slot: 7 Value: - NewSlot: 8 NewValue: Slot: 8 Value: 4285 - NewSlot: 9 NewValue: Slot: 9 Value: 10.0 - NewSlot: 10 NewValue: Slot: 10 Value: - NewSlot: 11 NewValue: Slot: 11 Value: 0.9 - NewSlot: 12 NewValue: Slot: 12 Value: - NewSlot: 13 NewValue: Slot: 13 Value: 6876 - NewSlot: 14 NewValue: Slot: 14 Value: 1448 - NewSlot: 15 NewValue: Slot: 15 Value: - NewSlot: 16 NewValue: Slot: 16 Value: ?? - NewSlot: 17 NewValue: Slot: 17 Value: - NewSlot: 18 NewValue: Slot: 18 Value: S - NewSlot: 19 NewValue: Slot: 19 Value: - NewSlot: 20 NewValue: Slot: 20 Value: - NewSlot: 21 NewValue: Slot: 21 Value: - NewSlot: 22 NewValue: Slot: 22 Value: 11:20AM - NewSlot: 23 NewValue: Slot: 23 Value: - NewSlot: 24 NewValue: Slot: 24 Value: 22:08.66 - NewSlot: 25 NewValue: Slot: 25 Value: mpg123: - NewSlot: 26 NewValue: Slot: 26 Value: 08_-_DJ_Mark_Farina_-_Rae_&_Christian_-_Spellbound.mp3 - NewSlot: 27 NewValue: Slot: 27 Value: (mp - NewSlot: 28 NewValue:
What I'd actually like to get out of it is something similiar to:
<!-- testing for title Slot: Value: - NewSlot: 1 NewValue: 4285 Slot: 1 Value: - NewSlot: 2 NewValue: 10.0 Slot: 2 Value: - NewSlot: 3 NewValue: 0.9 Slot: 3 Value: - NewSlot: 4 NewValue: 6876 Slot: 4 Value: - NewSlot: 5 NewValue: 1448 Slot: 5 Value: - NewSlot: 6 NewValue: ?? Slot: 6 Value: - NewSlot: 7 NewValue: S Slot: 7 Value: - NewSlot: 8 NewValue: 11:20AM Slot: 8 Value: 4285 - NewSlot: 9 NewValue: 22:08.66 Slot: 9 Value: 10.0 - NewSlot: 10 NewValue: mpg123: Slot: 10 Value: - NewSlot: 11 NewValue: 08_-_DJ_Mark_Farina_-_Rae_&_Christian_-_Spellbound.mp3 Slot: 11 Value: 0.9 - NewSlot: 12 NewValue: (mp Slot: 12 Value: - NewSlot: 13 NewValue: Slot: 13 Value: 6876 - NewSlot: 14 NewValue: Slot: 14 Value: 1448 - NewSlot: 15 NewValue: Slot: 15 Value: - NewSlot: 16 NewValue: Slot: 16 Value: ?? - NewSlot: 17 NewValue: Slot: 17 Value: - NewSlot: 18 NewValue: Slot: 18 Value: S - NewSlot: 19 NewValue: Slot: 19 Value: - NewSlot: 20 NewValue: Slot: 20 Value: - NewSlot: 21 NewValue: Slot: 21 Value: - NewSlot: 22 NewValue: Slot: 22 Value: 11:20AM - NewSlot: 23 NewValue: Slot: 23 Value: - NewSlot: 24 NewValue: Slot: 24 Value: 22:08.66 - NewSlot: 25 NewValue: Slot: 25 Value: mpg123: - NewSlot: 26 NewValue: Slot: 26 Value: 08_-_DJ_Mark_Farina_-_Rae_&_Christian_-_Spellbound.mp3 - NewSlot: 27 NewValue: Slot: 27 Value: (mp - NewSlot: 28 NewValue:
Any clue what I'm doing wrong? I mostly jsut can't figure out why all the new fields keep coming up blank.
attached mail follows:
Try:
if (!empty($work[$loop]))
-----Original Message-----
From: pkshifted
slackin.com [mailto:pkshifted
slackin.com]
Sent: Friday, March 23, 2001 2:07 PM
To: php-general
lists.php.net
Cc: cal
calevans.com
Subject: RE: [PHP] Array Cleansing
This is the code I'm currently using
/* testing stuff */ echo "<!-- testing for title\n"; $newloop = 0; while ($loop < count($work)) { if ($work[$loop] !== " ") { $lazy[$newloop] = $work[$loop]; ++$newloop; } echo " Slot: $loop Value: $work[$loop] - NewSlot: $newloop NewValue: $lazy[$newloop] \n"; ++$loop; } echo " end testing for title -->\n"; /* end of test */
And this is the output I'm getting
<!-- testing for title Slot: Value: - NewSlot: 1 NewValue: Slot: 1 Value: - NewSlot: 2 NewValue: Slot: 2 Value: - NewSlot: 3 NewValue: Slot: 3 Value: - NewSlot: 4 NewValue: Slot: 4 Value: - NewSlot: 5 NewValue: Slot: 5 Value: - NewSlot: 6 NewValue: Slot: 6 Value: - NewSlot: 7 NewValue: Slot: 7 Value: - NewSlot: 8 NewValue: Slot: 8 Value: 4285 - NewSlot: 9 NewValue: Slot: 9 Value: 10.0 - NewSlot: 10 NewValue: Slot: 10 Value: - NewSlot: 11 NewValue: Slot: 11 Value: 0.9 - NewSlot: 12 NewValue: Slot: 12 Value: - NewSlot: 13 NewValue: Slot: 13 Value: 6876 - NewSlot: 14 NewValue: Slot: 14 Value: 1448 - NewSlot: 15 NewValue: Slot: 15 Value: - NewSlot: 16 NewValue: Slot: 16 Value: ?? - NewSlot: 17 NewValue: Slot: 17 Value: - NewSlot: 18 NewValue: Slot: 18 Value: S - NewSlot: 19 NewValue: Slot: 19 Value: - NewSlot: 20 NewValue: Slot: 20 Value: - NewSlot: 21 NewValue: Slot: 21 Value: - NewSlot: 22 NewValue: Slot: 22 Value: 11:20AM - NewSlot: 23 NewValue: Slot: 23 Value: - NewSlot: 24 NewValue: Slot: 24 Value: 22:08.66 - NewSlot: 25 NewValue: Slot: 25 Value: mpg123: - NewSlot: 26 NewValue: Slot: 26 Value: 08_-_DJ_Mark_Farina_-_Rae_&_Christian_-_Spellbound.mp3 - NewSlot: 27 NewValue: Slot: 27 Value: (mp - NewSlot: 28 NewValue:
What I'd actually like to get out of it is something similiar to:
<!-- testing for title Slot: Value: - NewSlot: 1 NewValue: 4285 Slot: 1 Value: - NewSlot: 2 NewValue: 10.0 Slot: 2 Value: - NewSlot: 3 NewValue: 0.9 Slot: 3 Value: - NewSlot: 4 NewValue: 6876 Slot: 4 Value: - NewSlot: 5 NewValue: 1448 Slot: 5 Value: - NewSlot: 6 NewValue: ?? Slot: 6 Value: - NewSlot: 7 NewValue: S Slot: 7 Value: - NewSlot: 8 NewValue: 11:20AM Slot: 8 Value: 4285 - NewSlot: 9 NewValue: 22:08.66 Slot: 9 Value: 10.0 - NewSlot: 10 NewValue: mpg123: Slot: 10 Value: - NewSlot: 11 NewValue: 08_-_DJ_Mark_Farina_-_Rae_&_Christian_-_Spellbound.mp3 Slot: 11 Value: 0.9 - NewSlot: 12 NewValue: (mp Slot: 12 Value: - NewSlot: 13 NewValue: Slot: 13 Value: 6876 - NewSlot: 14 NewValue: Slot: 14 Value: 1448 - NewSlot: 15 NewValue: Slot: 15 Value: - NewSlot: 16 NewValue: Slot: 16 Value: ?? - NewSlot: 17 NewValue: Slot: 17 Value: - NewSlot: 18 NewValue: Slot: 18 Value: S - NewSlot: 19 NewValue: Slot: 19 Value: - NewSlot: 20 NewValue: Slot: 20 Value: - NewSlot: 21 NewValue: Slot: 21 Value: - NewSlot: 22 NewValue: Slot: 22 Value: 11:20AM - NewSlot: 23 NewValue: Slot: 23 Value: - NewSlot: 24 NewValue: Slot: 24 Value: 22:08.66 - NewSlot: 25 NewValue: Slot: 25 Value: mpg123: - NewSlot: 26 NewValue: Slot: 26 Value: 08_-_DJ_Mark_Farina_-_Rae_&_Christian_-_Spellbound.mp3 - NewSlot: 27 NewValue: Slot: 27 Value: (mp - NewSlot: 28 NewValue:
Any clue what I'm doing wrong? I mostly jsut can't figure out why all the new fields keep coming up blank.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
You assign to $newloop, then do a ++$newloop, and THEN dump $newloop.
ie, you assign to 0, inc to 1, and dump 1...which isn't filled in yet.
-Szii
----- Original Message -----
From: <pkshifted
slackin.com>
To: <php-general
lists.php.net>
Cc: <cal
calevans.com>
Sent: Friday, March 23, 2001 12:07 PM
Subject: RE: [PHP] Array Cleansing
>
> This is the code I'm currently using
>
> /* testing stuff */
> echo "<!-- testing for title\n";
> $newloop = 0;
> while ($loop < count($work))
> {
> if ($work[$loop] !== " ")
> {
> $lazy[$newloop] = $work[$loop];
> ++$newloop;
> }
> echo " Slot: $loop Value: $work[$loop] - NewSlot: $newloop
NewValue: $lazy[$newloop] \n";
> ++$loop;
> }
> echo " end testing for title -->\n";
> /* end of test */
>
> And this is the output I'm getting
>
> <!-- testing for title
> Slot: Value: - NewSlot: 1 NewValue:
> Slot: 1 Value: - NewSlot: 2 NewValue:
> Slot: 2 Value: - NewSlot: 3 NewValue:
> Slot: 3 Value: - NewSlot: 4 NewValue:
> Slot: 4 Value: - NewSlot: 5 NewValue:
> Slot: 5 Value: - NewSlot: 6 NewValue:
> Slot: 6 Value: - NewSlot: 7 NewValue:
> Slot: 7 Value: - NewSlot: 8 NewValue:
> Slot: 8 Value: 4285 - NewSlot: 9 NewValue:
> Slot: 9 Value: 10.0 - NewSlot: 10 NewValue:
> Slot: 10 Value: - NewSlot: 11 NewValue:
> Slot: 11 Value: 0.9 - NewSlot: 12 NewValue:
> Slot: 12 Value: - NewSlot: 13 NewValue:
> Slot: 13 Value: 6876 - NewSlot: 14 NewValue:
> Slot: 14 Value: 1448 - NewSlot: 15 NewValue:
> Slot: 15 Value: - NewSlot: 16 NewValue:
> Slot: 16 Value: ?? - NewSlot: 17 NewValue:
> Slot: 17 Value: - NewSlot: 18 NewValue:
> Slot: 18 Value: S - NewSlot: 19 NewValue:
> Slot: 19 Value: - NewSlot: 20 NewValue:
> Slot: 20 Value: - NewSlot: 21 NewValue:
> Slot: 21 Value: - NewSlot: 22 NewValue:
> Slot: 22 Value: 11:20AM - NewSlot: 23 NewValue:
> Slot: 23 Value: - NewSlot: 24 NewValue:
> Slot: 24 Value: 22:08.66 - NewSlot: 25 NewValue:
> Slot: 25 Value: mpg123: - NewSlot: 26 NewValue:
> Slot: 26 Value:
08_-_DJ_Mark_Farina_-_Rae_&_Christian_-_Spellbound.mp3 - NewSlot: 27
NewValue:
> Slot: 27 Value: (mp - NewSlot: 28 NewValue:
>
> What I'd actually like to get out of it is something similiar to:
>
> <!-- testing for title
> Slot: Value: - NewSlot: 1 NewValue: 4285
> Slot: 1 Value: - NewSlot: 2 NewValue: 10.0
> Slot: 2 Value: - NewSlot: 3 NewValue: 0.9
> Slot: 3 Value: - NewSlot: 4 NewValue: 6876
> Slot: 4 Value: - NewSlot: 5 NewValue: 1448
> Slot: 5 Value: - NewSlot: 6 NewValue: ??
> Slot: 6 Value: - NewSlot: 7 NewValue: S
> Slot: 7 Value: - NewSlot: 8 NewValue: 11:20AM
> Slot: 8 Value: 4285 - NewSlot: 9 NewValue: 22:08.66
> Slot: 9 Value: 10.0 - NewSlot: 10 NewValue: mpg123:
> Slot: 10 Value: - NewSlot: 11 NewValue:
08_-_DJ_Mark_Farina_-_Rae_&_Christian_-_Spellbound.mp3
> Slot: 11 Value: 0.9 - NewSlot: 12 NewValue: (mp
> Slot: 12 Value: - NewSlot: 13 NewValue:
> Slot: 13 Value: 6876 - NewSlot: 14 NewValue:
> Slot: 14 Value: 1448 - NewSlot: 15 NewValue:
> Slot: 15 Value: - NewSlot: 16 NewValue:
> Slot: 16 Value: ?? - NewSlot: 17 NewValue:
> Slot: 17 Value: - NewSlot: 18 NewValue:
> Slot: 18 Value: S - NewSlot: 19 NewValue:
> Slot: 19 Value: - NewSlot: 20 NewValue:
> Slot: 20 Value: - NewSlot: 21 NewValue:
> Slot: 21 Value: - NewSlot: 22 NewValue:
> Slot: 22 Value: 11:20AM - NewSlot: 23 NewValue:
> Slot: 23 Value: - NewSlot: 24 NewValue:
> Slot: 24 Value: 22:08.66 - NewSlot: 25 NewValue:
> Slot: 25 Value: mpg123: - NewSlot: 26 NewValue:
> Slot: 26 Value:
08_-_DJ_Mark_Farina_-_Rae_&_Christian_-_Spellbound.mp3 - NewSlot: 27
NewValue:
> Slot: 27 Value: (mp - NewSlot: 28 NewValue:
>
> Any clue what I'm doing wrong? I mostly jsut can't figure out why all the
new fields keep coming up blank.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I'm still having problems with this. I was able to get sessions and session variables working ok with register_globals=on, but I had read that it was better not to keep register_globals on so I turned it off and I'm trying to figure out how this works now.
I'm registering a variable in one function say like this: function set session() { global $my_session_var; session_start(); $my_session_var = "Blah blah"; session_register('my_session_var'); }
Then I'm trying to read it in another function like this: function read_session() { global $HTTP_SESSION_VARS; session_start(); echo ($HTTP_SESSION_VARS[my_session_var]); }
I assume this isn't the right way to do it since it doesn't seem to work. I have register_globals off. Does anyone know what I should be doing? Thanks in advance for any replies!
-- Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: mchampagnecapis.com hm: mchamp
texas.net
****************************************************************** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ******************************************************************
attached mail follows:
Hi,
The php manual at: http://www.php.net/manual/en/ref.session.php says:
"If track_vars is enabled and register_globals is disabled, only members of the global associative array $HTTP_SESSION_VARS can be registered as session variables. "
so, did you try this:
session_register($HTTP_SESSION_VARS["my_session_var"];
attached mail follows:
I tried this and could not get this working either. Does anyone know which is the best way to do it? What are the pros and cons of doing this with track_vars or as globals?
Thanks, Mike
> Hi, > > The php manual at: http://www.php.net/manual/en/ref.session.php > says: > > "If track_vars is enabled and register_globals is disabled, only members of > the global associative array $HTTP_SESSION_VARS can be registered as session > variables. " > > so, did you try this: > > session_register($HTTP_SESSION_VARS["my_session_var"]; > > > > >
-- Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: mchampagnecapis.com hm: mchamp
texas.net
****************************************************************** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ******************************************************************
attached mail follows:
Try as below. Note both the global and the session_register statements.
> function set session() > { > global $my_session_var,$HTTP_SESSION_VARS; > session_start(); > $my_session_var = "Blah blah"; > session_register($HTTP_SESSION_VARS['my_session_var']); > }
Kirk
> -----Original Message-----
> From: Michael Champagne [mailto:mchampagne
capis.com]
> Sent: Friday, March 23, 2001 1:32 PM
> To: PHP General Mailing List
> Subject: [PHP] I don't understand HTTP_SESSION_VARS
>
>
> I'm still having problems with this. I was able to get
> sessions and session
> variables working ok with register_globals=on, but I had read
> that it was
> better not to keep register_globals on so I turned it off and
> I'm trying to
> figure out how this works now.
>
> I'm registering a variable in one function say like this:
> function set session()
> {
> global $my_session_var;
> session_start();
> $my_session_var = "Blah blah";
> session_register('my_session_var');
> }
>
> Then I'm trying to read it in another function like this:
> function read_session()
> {
> global $HTTP_SESSION_VARS;
> session_start();
> echo ($HTTP_SESSION_VARS[my_session_var]);
> }
> Michael Champagne, Software Engineer
attached mail follows:
Hi,
That code causes php to crash. I have never had that happen before. Every time I try to run that script, I am given an internal server warning.
""Johnson, Kirk"" <kjohnson
zootweb.com> wrote in message
news:01A4B59FD1EBD311838100A0C98BE0D9AD582E
chef.zootweb.com...
> Try as below. Note both the global and the session_register statements.
>
> > function set session()
> > {
> > global $my_session_var,$HTTP_SESSION_VARS;
> > session_start();
> > $my_session_var = "Blah blah";
> > session_register($HTTP_SESSION_VARS['my_session_var']);
> > }
>
> Kirk
>
>
> > -----Original Message-----
> > From: Michael Champagne [mailto:mchampagne
capis.com]
> > Sent: Friday, March 23, 2001 1:32 PM
> > To: PHP General Mailing List
> > Subject: [PHP] I don't understand HTTP_SESSION_VARS
> >
> >
> > I'm still having problems with this. I was able to get
> > sessions and session
> > variables working ok with register_globals=on, but I had read
> > that it was
> > better not to keep register_globals on so I turned it off and
> > I'm trying to
> > figure out how this works now.
> >
> > I'm registering a variable in one function say like this:
> > function set session()
> > {
> > global $my_session_var;
> > session_start();
> > $my_session_var = "Blah blah";
> > session_register('my_session_var');
> > }
> >
> > Then I'm trying to read it in another function like this:
> > function read_session()
> > {
> > global $HTTP_SESSION_VARS;
> > session_start();
> > echo ($HTTP_SESSION_VARS[my_session_var]);
> > }
>
> > Michael Champagne, Software Engineer
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I'm trying this and it's still not working. Here is my code in 2 files, write_sess.php and read_sess.php. I've been trying to figure this out all day.
/* WRITE_SESS.PHP */ <?php
function write_session() { global $my_session_var, $HTTP_SESSION_VARS; session_start(); $my_session_var = "Boogedy Boogedy"; session_register($HTTP_SESSION_VARS['my_session_var']); }
write_session(); ?>
<HTML> <BODY> <a href = "read_sess.php"> Read Session Variable </a> </BODY> </HTML>
/* READ_SESS.PHP */ <?php session_start(); ?> <HTML> <BODY> <?php function read_session() { global $HTTP_SESSION_VARS; return $HTTP_SESSION_VARS['my_session_var']; } print"Session Variable: ". read_session(); ?> </BODY> </HTML>
Here is my php.ini file: /*** PHP Initialization File ***/
asp_tags=true include_path=.:/ora9ias/Apache/Apache/php auto_prepend_file=cisweb_global.inc session.gc_maxlifetime=14400 session.gc_probability=10 session.name=CIS_SECURE_SESSION register_globals off track_vars on
I'm so confused why I can't get this working. Thanks for everyone's help.
Mike
> Try as below. Note both the global and the session_register statements.
>
> > function set session()
> > {
> > global $my_session_var,$HTTP_SESSION_VARS;
> > session_start();
> > $my_session_var = "Blah blah";
> > session_register($HTTP_SESSION_VARS['my_session_var']);
> > }
>
> Kirk
>
>
> > -----Original Message-----
> > From: Michael Champagne [mailto:mchampagne
capis.com]
> > Sent: Friday, March 23, 2001 1:32 PM
> > To: PHP General Mailing List
> > Subject: [PHP] I don't understand HTTP_SESSION_VARS
> >
> >
> > I'm still having problems with this. I was able to get
> > sessions and session
> > variables working ok with register_globals=on, but I had read
> > that it was
> > better not to keep register_globals on so I turned it off and
> > I'm trying to
> > figure out how this works now.
> >
> > I'm registering a variable in one function say like this:
> > function set session()
> > {
> > global $my_session_var;
> > session_start();
> > $my_session_var = "Blah blah";
> > session_register('my_session_var');
> > }
> >
> > Then I'm trying to read it in another function like this:
> > function read_session()
> > {
> > global $HTTP_SESSION_VARS;
> > session_start();
> > echo ($HTTP_SESSION_VARS[my_session_var]);
> > }
>
> > Michael Champagne, Software Engineer
>
>
-- Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: mchampagnecapis.com hm: mchamp
texas.net
****************************************************************** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ******************************************************************
attached mail follows:
Also, you are registering a variable rather than a name. So, unless there is a quoted name for the variable value, I don't think that would work. For instance,
$a="b" session_register($a);
actually registers a variable called $b. I made that mistake in my post too.
attached mail follows:
Maybe I should just go back to using globals then. What does everyone else do normally? Globals or use the track_vars? I can't get these things working at all.
Mike
> Hi,
>
> That code causes php to crash. I have never had that happen before. Every
> time I try to run that script, I am given an internal server warning.
>
> ""Johnson, Kirk"" <kjohnson
zootweb.com> wrote in message
> news:01A4B59FD1EBD311838100A0C98BE0D9AD582E
chef.zootweb.com...
> > Try as below. Note both the global and the session_register statements.
> >
> > > function set session()
> > > {
> > > global $my_session_var,$HTTP_SESSION_VARS;
> > > session_start();
> > > $my_session_var = "Blah blah";
> > > session_register($HTTP_SESSION_VARS['my_session_var']);
> > > }
> >
> > Kirk
> >
> >
> > > -----Original Message-----
> > > From: Michael Champagne [mailto:mchampagne
capis.com]
> > > Sent: Friday, March 23, 2001 1:32 PM
> > > To: PHP General Mailing List
> > > Subject: [PHP] I don't understand HTTP_SESSION_VARS
> > >
> > >
> > > I'm still having problems with this. I was able to get
> > > sessions and session
> > > variables working ok with register_globals=on, but I had read
> > > that it was
> > > better not to keep register_globals on so I turned it off and
> > > I'm trying to
> > > figure out how this works now.
> > >
> > > I'm registering a variable in one function say like this:
> > > function set session()
> > > {
> > > global $my_session_var;
> > > session_start();
> > > $my_session_var = "Blah blah";
> > > session_register('my_session_var');
> > > }
> > >
> > > Then I'm trying to read it in another function like this:
> > > function read_session()
> > > {
> > > global $HTTP_SESSION_VARS;
> > > session_start();
> > > echo ($HTTP_SESSION_VARS[my_session_var]);
> > > }
> >
> > > Michael Champagne, Software Engineer
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
>
>
>
-- Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: mchampagnecapis.com hm: mchamp
texas.net
****************************************************************** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ******************************************************************
attached mail follows:
I tried quoting it as well - my last post is where I'm currently at with this. Still doesn't work, but doesn't crash anything either.
Mike
> Also, you are registering a variable rather than a name. So, unless there > is a quoted name for the variable value, I don't think that would work. For > instance, > > $a="b" > session_register($a); > > actually registers a variable called $b. I made that mistake in my post > too. > > > > >
-- Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: mchampagnecapis.com hm: mchamp
texas.net
****************************************************************** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ******************************************************************
attached mail follows:
Hi,
The default php setting is with track vars on, and register globals on I believe. I have never tried anything else. I turned globals off to see if I could help you with your problem. If you check the manual, they do not put much explanation into how to use sessions with globals off, though I have read that some webservers may have globals turned off.
attached mail follows:
Hi,
Go post your globals question at the php forum at www.devshed.com . You will usually get extremely quick responses to questions about php.
attached mail follows:
OK, try this. The session_start() has to come before the global statement:
<?php function write_session() { session_start(); global $HTTP_SESSION_VARS; $HTTP_SESSION_VARS[my_session_var] = "Boogedy Boogedy"; session_register($HTTP_SESSION_VARS["my_session_var"]); }
write_session(); echo $HTTP_SESSION_VARS['my_session_var']; ?>
attached mail follows:
YES! That's what it was. You rule man. Why would session_start need to come before the global variable declaration? You'd think session_start would need $HTTP_SESSION_VARS declared beforehand to load the session variables into?
Thanks, Mike
> OK, try this. The session_start() has to come before the global statement: > > <?php > function write_session() > { > session_start(); > global $HTTP_SESSION_VARS; > $HTTP_SESSION_VARS[my_session_var] = "Boogedy Boogedy"; > session_register($HTTP_SESSION_VARS["my_session_var"]); > } > > write_session(); > echo $HTTP_SESSION_VARS['my_session_var']; > ?> > > > > ****************************************************************** > This communication is for informational purposes only. It is not > intended as an offer or solicitation for the purchase or sale of > any financial instrument or as an official confirmation of any > transaction, unless specifically agreed otherwise. All market > prices, data and other information are not warranted as to > completeness or accuracy and are subject to change without > notice. Any comments or statements made herein do not > necessarily reflect the views or opinions of Capital Institutional > Services, Inc. Capital Institutional Services, Inc. accepts no > liability for any errors or omissions arising as a result of > transmission. Use of this communication by other than intended > recipients is prohibited. > ****************************************************************** >
-- Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: mchampagnecapis.com hm: mchamp
texas.net
attached mail follows:
Mike, my experiments suggest you can also get rid of the session_register() statement. Seems that simply assigning to $HTTP_SESSION_VARS[my_session_var] is enough.
Kirk
> -----Original Message-----
> From: Michael Champagne [mailto:mchampagne
capis.com]
> Subject: RE: [PHP] I don't understand HTTP_SESSION_VARS
>
>
> YES! That's what it was. You rule man. Why would
> session_start need to come
> before the global variable declaration? You'd think
> session_start would need
> $HTTP_SESSION_VARS declared beforehand to load the session
> variables into?
>
> Thanks,
> Mike
>
> > OK, try this. The session_start() has to come before the
> global statement:
> >
> > <?php
> > function write_session()
> > {
> > session_start();
> > global $HTTP_SESSION_VARS;
> > $HTTP_SESSION_VARS[my_session_var] = "Boogedy Boogedy";
> > session_register($HTTP_SESSION_VARS["my_session_var"]);
> > }
> >
> > write_session();
> > echo $HTTP_SESSION_VARS['my_session_var'];
> > ?>
attached mail follows:
Hi,
All the session functions check to see if you have a session running first before starting a session, to prevent you from starting two sessions by accident. If for some reason you want to start another session, you can do that by supplying your own session id to the function session_start() to start another session.
However, you do not need to do that for your purposes. You can start the only session you need when they submit their form info, and to keep them from signing up twice, before you record the data use an if statement to check if there is a session(if ($PHPSESSID)). If there is already a session, do not record the data, and display a message: "You have already signed up, proceed to login." and redirect them to the login page.
attached mail follows:
Hi,
Just to explain a point on my previous post:
If at the top of your page that processes the registration info, you include:
session_start(); session_register("is_registered"); is_registered="yes";
and then use this test:
if($PHPSESSID) { warning, redirect to login } else { record info, redirect to login }
Will the condition in the if statement be true? It seems like it should because you started the session. But a session id is a cookie, and a cookie is not available on the page it is set. So, the first time this script is encountered, e.g. when they register for the first time, even though you started the session, the if statement condition will be false, indicating the first time someone is registering. Subsequently, if someone uses the back button and then clicks submit to get to this page again, then the cookie will be set, and the if statement will return true, causing the other branch of the if statement to execute.
attached mail follows:
What's up with the PHPBuilder website? It's been down all day. :( Does anyone know?
Chris
attached mail follows:
I can get to it OK.
"Boget, Chris" wrote:
> What's up with the PHPBuilder website? It's been down all day. > :( Does anyone know? > > Chris
attached mail follows:
> > What's up with the PHPBuilder website? It's been down all day. > > :( Does anyone know? > I can get to it OK.
Well, I can now... :p
Chris
attached mail follows:
what i did was implement my own session class so that i can have a single session variable ($s) and have it handle all my session needs via an OO interface ($s->CleanUp(), $s->Update(), ...)
consequently, all of my session data is in a simple assoc. array that's a variable of the session class (sdata) so i can get to all of my session data via $s->sdata[...]
i update a value by: $s->Update('name', 'newvalue) and start the session: $s = new Session( $cookie_sid );
no mucking around with multiple global variables and such... no registering of variables and worrying about PHP's internals - just one object (and thus, one variable) is all i need for session handling.
i dont understand why more people dont use assoc. arrays for their session needs... ive never used PHP's built-in session handling so im not too sure of it's limitations, but are there any (good) reasons why more people dont use associative arrays as their session variables?
for example:
instead of having a mess of globals: $username $firstname $session_id $this $that
you could just register one variable and use it as an assoc. array to store all of the values you needed. ($svar, for instance)
$svar['username'] $svar['firstname'] $svar['session_id'] $svar['this'] $svar['that']
this would enable you to take an arbitrary number of variables and cut it down to *one* single assoc array.... seems to be a rather large benefit in doing things this way... so i cannot figure out why i dont see more people taking this road....
--i come from a perl background, so im used to using hashes (assoc. arrays) for lots of things. i get the feeling that not very many people on this list (newbies, at least) are familiar or comfortable with assoc. arrays.
any comments are welcome :)
> -----Original Message----- > From: Michael Champagne [mailto:mchampagne
capis.com] > Sent: Friday, March 23, 2001 4:48 PM > To: hi > Cc: php-general
lists.php.net > Subject: Re: [PHP] I don't understand HTTP_SESSION_VARS > > > Maybe I should just go back to using globals then. What does everyone else do > normally? Globals or use the track_vars? I can't get these things working at > all. > > Mike > > > Hi, > > > > That code causes php to crash. I have never had that happen before. Every > > time I try to run that script, I am given an internal server warning. > > > > ""Johnson, Kirk"" <kjohnson
zootweb.com> wrote in message > > news:01A4B59FD1EBD311838100A0C98BE0D9AD582E
chef.zootweb.com... > > > Try as below. Note both the global and the session_register statements. > > > > > > > function set session() > > > > { > > > > global $my_session_var,$HTTP_SESSION_VARS; > > > > session_start(); > > > > $my_session_var = "Blah blah"; > > > > session_register($HTTP_SESSION_VARS['my_session_var']); > > > > } > > > > > > Kirk > > > > > > > > > > -----Original Message----- > > > > From: Michael Champagne [mailto:mchampagne
capis.com] > > > > Sent: Friday, March 23, 2001 1:32 PM > > > > To: PHP General Mailing List > > > > Subject: [PHP] I don't understand HTTP_SESSION_VARS > > > > > > > > > > > > I'm still having problems with this. I was able to get > > > > sessions and session > > > > variables working ok with register_globals=on, but I had read > > > > that it was > > > > better not to keep register_globals on so I turned it off and > > > > I'm trying to > > > > figure out how this works now. > > > > > > > > I'm registering a variable in one function say like this: > > > > function set session() > > > > { > > > > global $my_session_var; > > > > session_start(); > > > > $my_session_var = "Blah blah"; > > > > session_register('my_session_var'); > > > > } > > > > > > > > Then I'm trying to read it in another function like this: > > > > function read_session() > > > > { > > > > global $HTTP_SESSION_VARS; > > > > session_start(); > > > > echo ($HTTP_SESSION_VARS[my_session_var]); > > > > } > > > > > > > Michael Champagne, Software Engineer > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > > > For additional commands, e-mail: php-general-help
lists.php.net > > > To contact the list administrators, e-mail: php-list-admin
lists.php.net > > > > > > > > > > > > > -- > Michael Champagne, Software Engineer > Capital Institutional Services, Inc. > wk: mchampagne
capis.com > hm: mchamp
texas.net > > > > ****************************************************************** > This communication is for informational purposes only. It is not > intended as an offer or solicitation for the purchase or sale of > any financial instrument or as an official confirmation of any > transaction, unless specifically agreed otherwise. All market > prices, data and other information are not warranted as to > completeness or accuracy and are subject to change without > notice. Any comments or statements made herein do not > necessarily reflect the views or opinions of Capital Institutional > Services, Inc. Capital Institutional Services, Inc. accepts no > liability for any errors or omissions arising as a result of > transmission. Use of this communication by other than intended > recipients is prohibited. > ****************************************************************** > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
Hi
I need send to user a file.zip using PHP code. Someone have a idea ?
Thx a lot
Krzysztof.Szachun
pyramid.pl
attached mail follows:
send the proper HTTP headers and then output the contents of the file.... here's what i used when i had to prompt the user for a download box for arbitrary binary files (.gif, .zip, .png, .pdf)
you might be able to not tell the browser the size of the data, but it's best to offer that information if you have it.
print "Content: $filename\r\n"; print "Content-disposition: inline; filename=\"$filename\"\r\n"; print "Content-length: $size\r\n"; print "Content-type: application/octet-stream\r\n"; print "\r\n";
then start outputting the actual data from the file.zip....
that should work.
> -----Original Message-----
> From: pyramid
pyramid.pl [mailto:pyramid
pyramid.pl]
> Sent: Friday, March 23, 2001 5:18 PM
> To: php-general
lists.php.net
> Subject: [PHP] How send a file usig PHP code ?
>
>
> Hi
>
> I need send to user a file.zip using PHP code.
> Someone have a idea ?
>
> Thx a lot
>
> Krzysztof.Szachun
pyramid.pl
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Dear Friends:
I have had another problem, after succesfully find flex package installed in this machine and make a link to a folder that is included in PATH. After ./configure, after the message that PHP was configured OK, following the instructions I write: make.
This is the error that appears
Making all in Zend make[1]: Entering directory '/usr/local/php-4.0.4pl1/Zend' /bin/sh../libtool --silent --mode=link gcc -g -02 -o libZend_c.la zend_language_scanner.lo zend_ini_scanner.lo ../libtool: ar: not found make[1]: *** [libZend_c.la] Error 1 leaving directory make[1]: *** [all- recursive] Error 1
I have looked at /php folder and exists a file called libtool. Anybody knows what is the problem?
Thank you very much Emiliano.
attached mail follows:
Hi!
I write the script for the array stuffs using hte array function --> $menu=array(0,0,1,0);
I'm trying to get this array to carry over using the $PHP_SELF to the same page over and over. However, I'm not getting the right result. So, is there a better way?
What about $menu[0]="1" and then use $menu as part of $PHP_SELF to carry it over to teh same page?
Scott
attached mail follows:
best/easiest/bulkist way it to serialize it and urlencode it.
<?php
$test[] = 'chris'; $test[] = 'lee';
echo "<a href=''$PHP_SELF?". urlencode(serialize($test)) .">test</a>";
?>
--Chris Lee lee
mediawaveonline.com
""Scott Fletcher"" <scott
abcoa.com> wrote in message news:99gkbv$tcg$1
toye.p.sourceforge.net... Hi!
I write the script for the array stuffs using hte array function --> $menu=array(0,0,1,0);
I'm trying to get this array to carry over using the $PHP_SELF to the same page over and over. However, I'm not getting the right result. So, is there a better way?
What about $menu[0]="1" and then use $menu as part of $PHP_SELF to carry it over to teh same page?
Scott
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I noticed the setting session.cookie_secure in my php_info(), but could not find anything mentioned about it in the documentation. Does anyone know what this setting does?
-- Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: mchampagnecapis.com hm: mchamp
texas.net
****************************************************************** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ******************************************************************
attached mail follows:
Hello I want to connect to a Microsoft SQL Server, I try with mssql_connect but the script don't work, it always say Call to unsupported or undefined function What I do worng?
Thanks
-- Mauricio Alarcon Rincon Webmaster - Webdepot Linux Registered User # 157093CF-18 Hornet
\ / \ _ / ----/_\---- x--------------( . )--------------x x|x | |_|\_/|_| | x|x x x x x
attached mail follows:
On Fri, Mar 23, 2001 at 06:16:10PM -0500, Mauricio Alarcon wrote:
> I want to connect to a Microsoft SQL Server, I try with mssql_connect > but the script don't work, it always say Call to unsupported or undefined function
are you sure, that ms-sql support is compiled into your php? what does phpinfo() say about it?
-fkr
-- gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | |all your base are belong to us | shame on me | fkrIRCnet |
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.3 (OpenBSD) Comment: For info see http://www.gnupg.org
iD8DBQE6u+I2DTGb09msdNARAidhAJ4/fu+lR2ZK2/bKkD/PGinWUMc+awCcCmBE YOeiqCJmXJclG4l2KLF+0xY= =FpCk -----END PGP SIGNATURE-----
attached mail follows:
Hello php mania, i was connecting into mysql using mysql_connect, and i just saved the return value from this funtion. now i want to use this connection id in the other page so i dont have to connect into mysql again. is it possible for me to do that ? anybody could tell me the different between persistence connection or not ? and how the implementation ?
TIA
-- Best regards, andrie mailto:andrieajk.its-sby.edu
attached mail follows:
Hi,
What was so difficult about implementing my last post?
attached mail follows:
Hello:
I've set up a authentication script in PHP, and have made it to where once the user has been successfully authenticated, it puts the username ($global[username]), password ($global[password]), and realname ($global[realname]) into a cookie. The included functions file (./inc/common.inc) does this, my problem is:
Once it has been authenticated, the main page (index.php) goes through an if statement for the variable $authok, if $authok is "1", then display the main page, elseif $authok != 1, then display login, it displays the main page fine except, the realname and the username don't show up, until I reload the page and the realname and the username then show up. I don't understand why it is doing this. Please if you can, help me fix this.
Thanks a lot Rob Vella
attached mail follows:
Rob,
perhaps some code?
regards, jaxon
On 3/23/01 7:03 PM, "wx" <wx
wxcs.com> wrote:
> Hello: > > I've set up a authentication script in PHP, and have made it to where once > the user has been successfully authenticated, it puts the username > ($global[username]), password ($global[password]), and realname > ($global[realname]) into a cookie. The included functions file > (./inc/common.inc) does this, my problem is: > > Once it has been authenticated, the main page (index.php) goes through an if > statement for the variable $authok, if $authok is "1", then display the main > page, elseif $authok != 1, then display login, it displays the main page fine > except, the realname and the username don't show up, until I reload the page > and the realname and the username then show up. I don't understand why it is > doing this. Please if you can, help me fix this. > > Thanks a lot > Rob Vella >
attached mail follows:
Well, I got it fixed, I was told PHP is picky about cookies, so I was told to make it redirect to the same page (so i just put a header(Location: $PHP_SELF);, and it works
- rob
attached mail follows:
When you SET a cookie, the browser has the cookie, but it has not been sent back by the browser to the server yet -- Only on the second page does that happen.
So, in addition to setting a cookie, you should also set the variable at the same time.
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "wx" <wxwxcs.com> Newsgroups: php.general Sent: Friday, March 23, 2001 6:00 PM Subject: [PHP] Problem with cookies
Hello:
I've set up a authentication script in PHP, and have made it to where once the user has been successfully authenticated, it puts the username ($global[username]), password ($global[password]), and realname ($global[realname]) into a cookie. The included functions file (./inc/common.inc) does this, my problem is:
Once it has been authenticated, the main page (index.php) goes through an if statement for the variable $authok, if $authok is "1", then display the main page, elseif $authok != 1, then display login, it displays the main page fine except, the realname and the username don't show up, until I reload the page and the realname and the username then show up. I don't understand why it is doing this. Please if you can, help me fix this.
Thanks a lot Rob Vella
attached mail follows:
thanks for your help.
""Jeff Armstrong"" <jeff.armstrong
pirum.com> wrote in message
news:NFBBLGBDNILEEAOGBCFEAEHOCAAA.jeff.armstrong
pirum.com...
> Do it in MySQL = Fast
> Don't fiddle in PHP = waste of your time.
>
> Look into the following:
>
> select
> UNIX_TIMESTAMP(date1)-UNIX_TIMESTAMP(date1) as diff_secs,
> TO_DAYS(date1)-TO_DAYS(date1) as diff_days,
> PERIOD_DIFF(date1,date2) as diff_months,
> YEAR(date1) - YEAR(date2) as diff_years
> from MYTABLE
> where id=$id
>
> I'm not sure what
> select date1-date2 as date_diff
> returns?
>
> beware of the 2037 limitation using UNIX_TIMESTAMP()
>
> regards
> Jeff
>
>
>
> -----Original Message-----
> From: BlackLord [mailto:black_lordus
yahoo.com]
> Sent: Thursday, March 22, 2001 5:41 PM
> To: php-general
lists.php.net
> Subject: [PHP] Date subtraction
>
>
> Hi!
>
> I want to subtract to date times from each other. Like :
>
> '2000 12 01 12:12:12' - '2000 11 10 11:39:59'
>
> Is there any function to do this subtraction or can i do it with MySQL's
> SELECT query ?
>
> Thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
What could I possibly be doing wrong here. The information just will not insert into my database. ARGH!
Please help if you can...
<?php
$user = "xyz"; $pass = "123";
//Connect to Database xyz $db = mysql_connect("localhost", $user, $pass)OR DIE("Unable to connect to database");
mysql_select_db("xyz",$db) OR DIE("Unable to connect to database");
$sql = ("INSERT INTO orders VALUES 'product,name,email'($product,$name,$email)"); $result = mysql_query($sql); echo "Order for the $product has been sent";
?>
-- Regards,YoBro ------------------------------------------------------------- DO NOT REPLY TO THIS VIA EMAIL PLEASE USE THE NEWSGROUP All emails sent to this address are automatically deleted. This is to avoid SPAM! -------------------------------------------------------------
attached mail follows:
You don't say where the failure is, but I'm guessing its when you do the mysql_query. Your INSERT statement looks a bit odd. Try:
$sql = "INSERT INTO orders (product,name,email) VALUES ($product,$name,$email)";
John
attached mail follows:
I have tried that, and I have been reading all sorts of info and been copying it exact, but it still doesn't work. I am not receiving any errors, but the data just doesn't appear in the database. I have the table set up and it all works fine in phpMyAdmin, but I cant get my own form to work.
There is a page called order.php with a form that on submit goes to the discussed page. All field variables are correct. Any other ideas.
: You don't say where the failure is, but I'm guessing its when you do the
: mysql_query. Your INSERT statement looks a bit odd.
: Try:
:
: $sql = "INSERT INTO orders (product,name,email)
: VALUES ($product,$name,$email)";
:
: John
:
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
: For additional commands, e-mail: php-general-help
lists.php.net
: To contact the list administrators, e-mail: php-list-admin
lists.php.net
:
attached mail follows:
YoBro,
I think you need to wrap $product, $name and $email in quotes when sending the statement to MYSQL.
Calvin
-----Original Message-----
From: YoBro [mailto:nospam
brochures.co.nz]
Sent: Friday, March 23, 2001 4:38 PM
To: php-general
lists.php.net
Subject: [PHP] I need an expert to tell me what I am doing wrong
What could I possibly be doing wrong here. The information just will not insert into my database. ARGH!
Please help if you can...
<?php
$user = "xyz"; $pass = "123";
//Connect to Database xyz $db = mysql_connect("localhost", $user, $pass)OR DIE("Unable to connect to database");
mysql_select_db("xyz",$db) OR DIE("Unable to connect to database");
$sql = ("INSERT INTO orders VALUES 'product,name,email'($product,$name,$email)"); $result = mysql_query($sql); echo "Order for the $product has been sent";
?>
-- Regards,YoBro ------------------------------------------------------------- DO NOT REPLY TO THIS VIA EMAIL PLEASE USE THE NEWSGROUP All emails sent to this address are automatically deleted. This is to avoid SPAM! -------------------------------------------------------------
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Something else to investigate could be whether you've passed the db name to the script. If the the name of the db is different to $user, you'll need to do something like
$dbname = "whatever"; mysql_select_db("$dbname",$db);
Mick
On Sat, 24 Mar 2001, YoBro wrote:
> What could I possibly be doing wrong here. The information just will not
> insert into my database.
> ARGH!
>
> Please help if you can...
>
> <?php
>
> $user = "xyz";
> $pass = "123";
>
>
> //Connect to Database xyz
> $db = mysql_connect("localhost", $user, $pass)OR DIE("Unable to connect to
> database");
>
> mysql_select_db("xyz",$db) OR DIE("Unable to connect to database");
>
> $sql = ("INSERT INTO orders VALUES
> 'product,name,email'($product,$name,$email)");
> $result = mysql_query($sql);
> echo "Order for the $product has been sent";
>
>
> ?>
>
> --
> Regards,
>
>
> YoBro
> -------------------------------------------------------------
> DO NOT REPLY TO THIS VIA EMAIL
> PLEASE USE THE NEWSGROUP
> All emails sent to this address are automatically deleted.
> This is to avoid SPAM!
> -------------------------------------------------------------
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
I'm trying to write a sql statement (for Oracle) that uses an associative array element as a dynamic value. PHP is choking on this line:
$sql = "insert into sessions(session_id, user_id, session_expiration) values ('$sess_id', $user_fields['USER_ID'], sysdate + ($user_fields['MINS_TILL_EXPIRE'] * 1/1440))"
I get this error back from PHP:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
Can I not use my associative array like this?
-- Michael Champagne, Software Engineer Capital Institutional Services, Inc. wk: mchampagnecapis.com hm: mchamp
texas.net
****************************************************************** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ******************************************************************
attached mail follows:
Hi All,
PHP is unable to resolve the variable you are trying to use within a stting. If you use complex array structures you have to write it like this:
$sql = "insert into sessions(session_id, user_id, session_expiration) values ('$sess_id', " . $user_fields['USER_ID'] . "', sysdate + (" . $user_fields'MINS_TILL_EXPIRE'] . " * 1/1440))";
or use
$sql = sprintf("insert into sessions(session_id, user_id, session_expiration) values ('%s', sysdate + (%i * 1/1440))", $sess_id', $user_fields['USER_ID'], $user_fields['MINS_TILL_EXPIRE']);
Your sample code also mised a ' after the first variable !
- Frank
> I'm trying to write a sql statement (for Oracle) that uses an associative
> array element as a dynamic value. PHP is choking on this line:
>
> $sql = "insert into sessions(session_id, user_id, session_expiration) values ('$sess_id', $user_fields['USER_ID'], sysdate + ($user_fields['MINS_TILL_EXPIRE'] * 1/1440))"
>
> I get this error back from PHP:
>
> Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
>
> Can I not use my associative array like this?
>
> --
> Michael Champagne, Software Engineer
> Capital Institutional Services, Inc.
> wk: mchampagne
capis.com
> hm: mchamp
texas.net
>
>
>
> ******************************************************************
> This communication is for informational purposes only. It is not
> intended as an offer or solicitation for the purchase or sale of
> any financial instrument or as an official confirmation of any
> transaction, unless specifically agreed otherwise. All market
> prices, data and other information are not warranted as to
> completeness or accuracy and are subject to change without
> notice. Any comments or statements made herein do not
> necessarily reflect the views or opinions of Capital Institutional
> Services, Inc. Capital Institutional Services, Inc. accepts no
> liability for any errors or omissions arising as a result of
> transmission. Use of this communication by other than intended
> recipients is prohibited.
> ******************************************************************
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
attached mail follows:
I learned recently that you can put an array into a string using the braces operator like so:
$string = "Here's an interpolated {$array['key']}";
This is really handy for sql statements and other neat things.
You can use indexed arrays too. Actually, all arrays in php are hashes (associative). That's why they're so quick.
Happy interpolation!
Matt Friedman
----- Original Message -----
From: "Frank M. Kromann" <frank
frontbase.com>
To: "Michael Champagne" <mchampagne
capis.com>
Cc: "PHP General Mailing List" <php-general
lists.php.net>
Sent: Friday, March 23, 2001 8:25 PM
Subject: Re: [PHP] PHP error parsing SQL string containing assoc. array
> Hi All,
>
> PHP is unable to resolve the variable you are trying to use within a
stting. If you use complex array structures you have to write it like this:
>
>
> $sql = "insert into sessions(session_id, user_id, session_expiration)
values ('$sess_id', " . $user_fields['USER_ID'] . "', sysdate + (" .
$user_fields'MINS_TILL_EXPIRE'] . " * 1/1440))";
>
> or use
>
> $sql = sprintf("insert into sessions(session_id, user_id,
session_expiration) values ('%s', sysdate + (%i * 1/1440))", $sess_id',
$user_fields['USER_ID'], $user_fields['MINS_TILL_EXPIRE']);
>
>
> Your sample code also mised a ' after the first variable !
>
> - Frank
>
> > I'm trying to write a sql statement (for Oracle) that uses an
associative
> > array element as a dynamic value. PHP is choking on this line:
> >
> > $sql = "insert into sessions(session_id, user_id, session_expiration)
values ('$sess_id', $user_fields['USER_ID'], sysdate +
($user_fields['MINS_TILL_EXPIRE'] * 1/1440))"
> >
> > I get this error back from PHP:
> >
> > Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING'
> >
> > Can I not use my associative array like this?
> >
> > --
> > Michael Champagne, Software Engineer
> > Capital Institutional Services, Inc.
> > wk: mchampagne
capis.com
> > hm: mchamp
texas.net
> >
> >
> >
> > ******************************************************************
> > This communication is for informational purposes only. It is not
> > intended as an offer or solicitation for the purchase or sale of
> > any financial instrument or as an official confirmation of any
> > transaction, unless specifically agreed otherwise. All market
> > prices, data and other information are not warranted as to
> > completeness or accuracy and are subject to change without
> > notice. Any comments or statements made herein do not
> > necessarily reflect the views or opinions of Capital Institutional
> > Services, Inc. Capital Institutional Services, Inc. accepts no
> > liability for any errors or omissions arising as a result of
> > transmission. Use of this communication by other than intended
> > recipients is prohibited.
> > ******************************************************************
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
> >
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
attached mail follows:
You need to have a separate page that returns that image as if it were a static file on your site.
------- image.php?id=42 ------------- <?php $query = 'select blob from blobs where id = $id'; #I'm sure that's not the right SQL... $image = pg_something($result, 'image'); $imagetype = pg_something($result, 'image_type'); #$image now contains the JPG or GIF or PNG #and $imagetype is image/jpg or image/gif or image/png header("Content-type: $imagetype"); header("Content-length: " . strlen($image)); #more headers here for, say, caching etc echo $image; ?>
Then, in your HTML, you would have: <IMG SRC=image.php?id=42>
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Kassai Istvan <kako_jfreemail.hu> Newsgroups: php.general Sent: Friday, March 16, 2001 4:12 AM Subject: [PHP] Image from db
> Hello everyone! > > Could anyone help me? My problem is the following: > I have to insert an image from a PostgreSQL database(Large Object), into > a web- page. > > > How can I make it? > > Thanks, bye! > Istvan Kassai > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
> I have some scripts to build pages that will be sent to a production server. > Is is possible to redirect the page to a file with an html extention that > could be sent via the ftp functions to the production server.
I suspect I'm not the only one who doesn't understand the question properly...
User asks for URL foo.htm
The web-server can have foo.htm sitting there, or PHP can generate it, or you could have PHP get the file (via FTP or HTTP) from another server, or the missing file could maybe trigger a routine to get the file and then continue with the request or...
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
attached mail follows:
It shouldn't matter, but try moving the global *AFTER* the extract().
Meanwhile, I think you should probably report this at http://bugs.php.net
Seems pretty broken to this naive user...
(Who likes the idea of extract, but can never remember the darn function name when I need it...)
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: <dempsejngeorgetown.edu> Newsgroups: php.general Sent: Friday, March 16, 2001 2:13 PM Subject: [PHP] inner workings of extract
> Hi all, > > I've recently discovered the extract function (thanks to the poster > regarding it), and have found it to save lots of time. > I'm having a problem though. 99 times out of 100 when someone thinks > they've found a "bug" it's actually their misuse of the function, so i'm > pretty sure this is the case with me. Anyway, here's the deal: > > I have a function. Inside this function i have > > global $name, $type, $location; (and others) > > I make a call to a mysql database and get the result in $result. > Then I used to do this: > > $name = $row["name"]; > $type = $type["type"]; > etc. > > extract makes this a lot nicer. However, at the end of this function i > call another function. This also uses the same global variables. Previous > this worked fine. But now that i'm using extract, while i do have access > to the variables in the function, i can't get them in the next. > > My guess is that the way extract works, (somehow, who knows), its > creating a local variable named $name and setting my info to that, as > opposed to $name = $row["name"] which sets the global. So, even though i > can access $name in the function, its lost to the next. > This isn't a huge issue--i can go back to the old way, or pass the > variables in the function, but there are enough that i wanted to know if > anyone else has experienced this. Is there some way to tell extract to > extract the variables and set the results to the global versions? > Maybe i'm way off and its a small code error, but I really do doubt this, > as i've commented out lines and gone back and forth and get the same > result. here's the basic idea though: > function tester(){ > global $name; > $row = mysql_fetch_array($sql_result); > $name = $row["name"]; > nextone(); > /*this works fine, but if i have extract($row) and comment out > the $name = $row["name"] line, then i can't see the variable in the > next function*/ > > } > function nextone(){ > global $name; > echo $name; > } > > any ideas? > > thanks, > jack > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
I'm guessing that the data you are getting has various funky characters in it that are not surviving the database or HTML Input/Output.
Do you see the correct URL as the link?
Or is there *nothing* for afl?
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Claudia" <claudiasmtsprynet.com> Newsgroups: php.general Sent: Friday, March 16, 2001 2:49 PM Subject: [PHP] dynamic url from MySql field data
> I am attempting to create a dynamic url from a field that has the value of > the dynamic url. > > Here is the scenario: > > 1 - Field in MySql database = $logo_link_var = > page.php3?afl=$afl&site=$site&page=contact&ad=$ad_type > 2 - Select logo_link_var from database and assign to $logo_link -- code is: > > $search_query = "select site.logo_link_var from site where ( $afl = > site.afl_name )"; > $result = mysql_query ( $search_query ); > > $logo_link = mysql_result ( $result, 0, "site.logo_link_var" ); (only 1 > record matches query) > $logo = "<a href='$logo_link'><img src='../allimages/$logo_graphic' > width='$logo_link_width' height='$logo_link_height' border='0' > alt='$logo_alt_text'></a>"; > > When I click on the link I receive parse errors -- and the window displays > this section in the url: > > page.php3?afl=$afl&site=$site&page=contact&ad=$ad_type > > The program is not finding the $afl or $site values > > if I create the $logo variable as follows -- it works OK. > > $logo = "<a > href='page.php3?afl=$afl&site=$site&page=contact&ad=$ad_type'><img > src='../allimages/$logo_graphic' width='$logo_link_width' > height='$logo_link_height' border='0' alt='$logo_alt_text'></a>"; > > Any suggestions? > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
Check your Apache error log, usually at /usr/local/apache/logs/error.log
You may have a message there giving you some idea of what's going wrong.
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Don Weeks <dweeksipverse.com> Newsgroups: php.general Sent: Friday, March 16, 2001 5:38 PM Subject: [PHP] PHP not seeming to work
> I am having a helluva time getting PHP 4.0 to work with my apache browser. I > add code for the PHP software for instance: > > <?php > phpinfo(); > ?> > > And all I get is a blank screen. I built php as an apache DSO. I know it is > getting loaded cause it bitches if the libphp file is not available. I have > recompiled several time. I'd sure like some help with this. Spending way to > much time getting it to work and no time developing the app. > > -- <?xml:namespace prefix = o ns = > "urn:schemas-microsoft-com:office:office" /> > Don .~. > Weeks /V\ L I N U X > dweeks
ipVerse.com // \\ >Phear the Penguin< > dlweeks
home.com /( )\ > ^^-^^ > >
---------------------------------------------------------------------------- ----
> -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I think you can change the separator in php.ini, and for sure you could do it by hand using $PATH_INFO or something.
Personally, my first question would be if the new "standard" is actually being used or supported by anybody else...
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Dave Smith <dave.searthcorp.com> Newsgroups: php.general Sent: Saturday, March 17, 2001 10:55 AM Subject: [PHP] URL parsing
> I have heard that the new standard for URLS is ...test.php?op=3;op2=6... > using the semi colon as a seperator. Is this currently supported by php 4.0.3? > > Cheers > > Dave Smith > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
how about parsing a url from passing variables like : test.php/op/3/op2/6/pagename.html
cannot this be parsed, to let search engines spider past the "?" properly?
regards, jaxon
On 3/23/01 7:46 PM, "Richard Lynch" <richard
zend.com> wrote:
> I think you can change the separator in php.ini, and for sure you could do
> it by hand using $PATH_INFO or something.
>
> Personally, my first question would be if the new "standard" is actually
> being used or supported by anybody else...
>
> --
> Visit the Zend Store at http://www.zend.com/store/
> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
> ----- Original Message -----
> From: Dave Smith <dave.s
earthcorp.com>
> Newsgroups: php.general
> Sent: Saturday, March 17, 2001 10:55 AM
> Subject: [PHP] URL parsing
>
>
>> I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
>> using the semi colon as a seperator. Is this currently supported by php
> 4.0.3?
>>
>> Cheers
>>
>> Dave Smith
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>> For additional commands, e-mail: php-general-help
lists.php.net
>> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>>
>
attached mail follows:
super easy.
$path_array = explode('/', $REQUEST_URI); $numPathElements = count($path_array);
then loop through the elements and do what you need, you might need to use strtok() if you're expecting slashes in your arguments.
-aaron
At 8:58 PM -0500 3/23/01, Jaxon wrote:
>how about parsing a url from passing variables like :
>test.php/op/3/op2/6/pagename.html
>
>cannot this be parsed, to let search engines spider past the "?" properly?
>
>regards,
>jaxon
>
>On 3/23/01 7:46 PM, "Richard Lynch" <richard
zend.com> wrote:
>
>> I think you can change the separator in php.ini, and for sure you could do
>> it by hand using $PATH_INFO or something.
>>
>> Personally, my first question would be if the new "standard" is actually
>> being used or supported by anybody else...
>>
>> --
>> Visit the Zend Store at http://www.zend.com/store/
>> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
>> Volunteer a little time: http://chatmusic.com/volunteer.htm
>> ----- Original Message -----
>> From: Dave Smith <dave.s
earthcorp.com>
>> Newsgroups: php.general
>> Sent: Saturday, March 17, 2001 10:55 AM
>> Subject: [PHP] URL parsing
>>
>>
>>> I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
>>> using the semi colon as a seperator. Is this currently supported by php
>> 4.0.3?
>>>
>>> Cheers
>>>
>>> Dave Smith
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>>> For additional commands, e-mail: php-general-help
lists.php.net
>>> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>>>
>>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Well assuming that this: index.php/tpl/main/ii/1/pagename/name.html is representative of this: index.php?tpl=main&ii=1$pagename=name.html then: $path_array = explode('/', $REQUEST_URI); $numPathElements = count($path_array);
gives me:
$path_array[0] = tpl $path_array[1] = main $path_array[2] = ii $path_array[3] = 1 $path_array[4] = pagename $path_array[5] = name.html
But can I make that:
$path_array[tpl] = main $path_array[ii] = 1 $path_array[pagename] = name.html
Instead?
I'm going to have to do this for every page, so I want to avoid much that would slow the page down - what do folks think?
regards, jaxon
On 3/23/01 9:09 PM, "Aaron Tuller" <mandelbaum
olywa.net> wrote:
> super easy.
>
> $path_array = explode('/', $REQUEST_URI);
> $numPathElements = count($path_array);
>
> then loop through the elements and do what you need, you might need
> to use strtok() if you're expecting slashes in your arguments.
>
> -aaron
>
> At 8:58 PM -0500 3/23/01, Jaxon wrote:
>> how about parsing a url from passing variables like :
>> test.php/op/3/op2/6/pagename.html
>>
>> cannot this be parsed, to let search engines spider past the "?" properly?
>>
>> regards,
>> jaxon
>>
>> On 3/23/01 7:46 PM, "Richard Lynch" <richard
zend.com> wrote:
>>
>>> I think you can change the separator in php.ini, and for sure you could do
>>> it by hand using $PATH_INFO or something.
>>>
>>> Personally, my first question would be if the new "standard" is actually
>>> being used or supported by anybody else...
>>>
>>> --
>>> Visit the Zend Store at http://www.zend.com/store/
>>> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
>>> Volunteer a little time: http://chatmusic.com/volunteer.htm
>>> ----- Original Message -----
>>> From: Dave Smith <dave.s
earthcorp.com>
>>> Newsgroups: php.general
>>> Sent: Saturday, March 17, 2001 10:55 AM
>>> Subject: [PHP] URL parsing
>>>
>>>
>>>> I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
>>>> using the semi colon as a seperator. Is this currently supported by php
>>> 4.0.3?
>>>>
>>>> Cheers
>>>>
>>>> Dave Smith
>
attached mail follows:
Oh wait, just do this in my page :
URL -> index.php/main/1/pagename.html
$path_array = explode('/', $REQUEST_URI); $tpl = $path_array[0]; $ii = $path_array[1]; $pagename = $path_array[2];
that works - sorry for being obtuse.
regards, jaxon
On 3/23/01 9:30 PM, "Jaxon" <jaxon
salamander.net> wrote:
>
> Well assuming that this: index.php/tpl/main/ii/1/pagename/name.html
> is representative of this: index.php?tpl=main&ii=1$pagename=name.html
>
> then:
>
> $path_array = explode('/', $REQUEST_URI);
> $numPathElements = count($path_array);
>
> gives me:
>
> $path_array[0] = tpl
> $path_array[1] = main
> $path_array[2] = ii
> $path_array[3] = 1
> $path_array[4] = pagename
> $path_array[5] = name.html
>
> But can I make that:
>
> $path_array[tpl] = main
> $path_array[ii] = 1
> $path_array[pagename] = name.html
>
> Instead?
>
> I'm going to have to do this for every page, so I want to avoid much that
> would slow the page down - what do folks think?
>
> regards,
> jaxon
>
>
>
>
> On 3/23/01 9:09 PM, "Aaron Tuller" <mandelbaum
olywa.net> wrote:
>
>> super easy.
>>
>> $path_array = explode('/', $REQUEST_URI);
>> $numPathElements = count($path_array);
>>
>> then loop through the elements and do what you need, you might need
>> to use strtok() if you're expecting slashes in your arguments.
>>
>> -aaron
>>
>> At 8:58 PM -0500 3/23/01, Jaxon wrote:
>>> how about parsing a url from passing variables like :
>>> test.php/op/3/op2/6/pagename.html
>>>
>>> cannot this be parsed, to let search engines spider past the "?" properly?
>>>
>>> regards,
>>> jaxon
>>>
>>> On 3/23/01 7:46 PM, "Richard Lynch" <richard
zend.com> wrote:
>>>
>>>> I think you can change the separator in php.ini, and for sure you could do
>>>> it by hand using $PATH_INFO or something.
>>>>
>>>> Personally, my first question would be if the new "standard" is actually
>>>> being used or supported by anybody else...
>>>>
>>>> --
>>>> Visit the Zend Store at http://www.zend.com/store/
>>>> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
>>>> Volunteer a little time: http://chatmusic.com/volunteer.htm
>>>> ----- Original Message -----
>>>> From: Dave Smith <dave.s
earthcorp.com>
>>>> Newsgroups: php.general
>>>> Sent: Saturday, March 17, 2001 10:55 AM
>>>> Subject: [PHP] URL parsing
>>>>
>>>>
>>>>> I have heard that the new standard for URLS is ...test.php?op=3;op2=6...
>>>>> using the semi colon as a seperator. Is this currently supported by php
>>>> 4.0.3?
>>>>>
>>>>> Cheers
>>>>>
>>>>> Dave Smith
>>
>
attached mail follows:
> do I have to cast values from text boxes into ints?
Not usually, because PHP and MySQL take care of converting for you, 99.9999% of the time.
But what you get from a FORM (or a GET URL) are all strings. The HTTP spec doesn't have any way to distinguish one data type from another. It's all strings.
> If so, it's wierd, because I have taken the values from text inputs > before > and just put them into insert string statements for mysql. It turned > them > into ints just fine.
Actually, PHP didn't turn them into ints in that case -- MySQL did.
> I use the following code to MAKE a table of input boxes on the screen, > and the exact > same thing to READ it after submission. > > the value $$vent_flow_identifier comes back with the entered value, but > as a string.
I'm not finding the actual problem here...
Can you pin-point it for us?
> and example of the names of the INPUT boxes out and comes back is:
> Vent1MinFlow
> Vent1MaxFlow
> Vent2FixedFlow
> The '1' and the 'xxxFlow' are from columns in a set of tables.
>
> <code>
> //$room_vent_values are a two colomn result in an array of length2
> arrays
> //for the vents in a room, numbered 1..vents_in_the_room
> //functions of vents are supply, return, exhaust
> //A supply vent has a MaxFlow, and a MinFlow, Returns and Exhausts have
> a Fixed Flow
> //Those allowable flows are in $allowed_ventflowtype_values, indexed by
> the
> //Vent functionID
>
>
>
> while ( list( $this_vent_num, $this_vent_functionID) = each(
> $room_vent_values )){
> $alt_bgcolor="";
> if ( $this_vent_num % 2 ) $alt_bgcolor = "bgcolor=\"#E69B9F\"";
> // causes alternating colors in odd/even vent numbers
> echo("<br>\n");
> reset( $allowed_ventflowtype_values );
> while ( $vent_function_flow_array = each(
> $allowed_ventflowtype_values )){
> $flow_type_vent_functionID = $vent_function_flow_array[1][0];
> $flow_type = $vent_function_flow_array[1][1];
> if ( $this_vent_functionID == $flow_type_vent_functionID ){
> $vent_function_name =
> $vent_function_values[$this_vent_functionID];
> $vent_flow_identifier = "Vent" . $this_vent_num .
> $flow_type;
> //start of row for output table, only the <input ...> is
> entered by user
> // the rest is from a database retrieval and fill in.
> $flow_entry_table .= " <tr $alt_bgcolor>\n";
> $flow_entry_table .= " <td
> align=\"center\"> $this_vent_num </td>\n";
> $flow_entry_table .= " <td
> align=\"center\"> $vent_function_name </td>\n";
> $flow_entry_table .= " <td
> align=\"center\"> $flow_type </td>\n";
> $flow_entry_table .= " <td align=\"center\"> <INPUT
> type=\"text\" name =\"$vent_flow_identifier\" size=\"5\"> </td>\n";
> $flow_entry_table .= " </tr>\n";
> }
> }
> }
> </end_code>
>
> The form that this makes, and later tests the results of looks like:
> <html out>------------
> <form name="Entry"
> action="FlowReadingsEntryTable.php"
> method="POST">
> <INPUT type="hidden" name="FlowDataSubmitted" value="1"> <!--name of
> event submission of this table results in-->
> <INPUT type="hidden" name="PurvineRoomID" value="1"> <!--relevant room
> passed through from prevouos form-->
> <INPUT type="submit" value="Send This Puppy">
> <table BORDER="0" CELLSPACING="0" COLS="4" width="100"
> BGCOLOR="#FF5c5c">
> <tr><!-- THIS ROW sets column widths -->
> <td WIDTH="85" height="0"></td>
> <td WIDTH="85" height="0"></td>
> <td WIDTH="85" height="0"></td>
> <td WIDTH="85" height="0"></td>
> </tr>
> <!-- Heading Row -->
> <tr>
> <td colspan="4" align="center" nowrap><b><b>Enter Flow For Each
> Vent<br>And Appropriate Flow Type<br>Date will be The Current
> Date/Time</b><br> </td>
> </tr>
> <tr>
> <td align="left" colspan="4">PurvineRoom<br>Designation </td>
> </tr>
> <tr>
> <td align="left" colspan="4">
> <b>101</b><br> </td>
> </tr>
> <tr valign"bottom">
> <td align="center"> Vent<br>Num </td>
> <td align="center"> Vent<br>Function </td>
> <td align="center"> Flow<br>Type </td>
> <td align="center"> Flow<br>Value </td>
> </tr>
> <tr bgcolor="#E69B9F">
> <td align="center"> 1 </td>
> <td align="center"> Supply </td>
> <td align="center"> MinFlow </td>
> <td align="center"> <INPUT type="text" name ="Vent1MinFlow"
> size="5"> </td>
> </tr>
> <tr bgcolor="#E69B9F">
> <td align="center"> 1 </td>
> <td align="center"> Supply </td>
> <td align="center"> MaxFlow </td>
> <td align="center"> <INPUT type="text" name ="Vent1MaxFlow"
> size="5"> </td>
> </tr>
> <tr >
> <td align="center"> 2 </td>
> <td align="center"> Supply </td>
> <td align="center"> MinFlow </td>
> <td align="center"> <INPUT type="text" name ="Vent2MinFlow"
> size="5"> </td>
> </tr>
> <tr >
> <td align="center"> 2 </td>
> <td align="center"> Supply </td>
> <td align="center"> MaxFlow </td>
> <td align="center"> <INPUT type="text" name ="Vent2MaxFlow"
> size="5"> </td>
> </tr>
> <tr bgcolor="#E69B9F">
> <td align="center"> 3 </td>
> <td align="center"> Supply </td>
> <td align="center"> MinFlow </td>
> <td align="center"> <INPUT type="text" name ="Vent3MinFlow"
> size="5"> </td>
> </tr>
> <tr bgcolor="#E69B9F">
> <td align="center"> 3 </td>
> <td align="center"> Supply </td>
> <td align="center"> MaxFlow </td>
> <td align="center"> <INPUT type="text" name ="Vent3MaxFlow"
> size="5"> </td>
> </tr>
> <tr >
> <td align="center"> 4 </td>
> <td align="center"> Supply </td>
> <td align="center"> MinFlow </td>
> <td align="center"> <INPUT type="text" name ="Vent4MinFlow"
> size="5"> </td>
> </tr>
> <tr >
> <td align="center"> 4 </td>
> <td align="center"> Supply </td>
> <td align="center"> MaxFlow </td>
> <td align="center"> <INPUT type="text" name ="Vent4MaxFlow"
> size="5"> </td>
> </tr>
> <tr bgcolor="#E69B9F">
> <td align="center"> 5 </td>
> <td align="center"> Return </td>
> <td align="center"> FixedFlow </td>
> <td align="center"> <INPUT type="text" name ="Vent5FixedFlow"
> size="5"> </td>
> </tr>
>
> </table>
> </form>
> </html out>-----------
> --
> ________________________________________________________________
> Sites by friends of mine: http://www.myhiddentreasures.com/
> ________________________________________________________________
> WARNING personal propaganda signature
> TAKE WHAT YOU LIKE AND LEAVE THE REST
>
> SINCE OUR GOVERNMENT WON'T PRESERVE OUR CLIMATE, IT'S UP TO US!
> Imagine ** yourself ** and your kids now an endangered species
> <1>Inflate automobile tires to near maximum in summer, -2psi in winter
> <2>add insulation to house and hot water heater, and refrigerator,
> <3>combine trips in cars, make less of them <4>buy cars, sports
> vehicles and recreational vehicles with good if not best mileage
> <4>put awnings over windows is summer, remove in winter. <5> add
> solar hot water heating. <6>Push for energy recycling clothes
> dryers <7> walk more, play outside with your kids! <8> let your
> grass grow to 3-4 inches, chokes weeds, saves water and energy,
> keeps house cooler <9> Put WHITE or REFLECTIVE materials on
> roofs to send energy back into space. <10> Vote for burial of
> logging slash onsite in logging areas for better watersheds
> and less burned vegetation. <11> compost your leaves and grass,
> bury in flower beds, lawns, gardens, or give away. <12> VOTE
> for energy and CO2 ratings on ALL products and foods. KNOW how
> much damage your purchases do to the climate. <13> Give your kids
> less stuff and more of you. <14> recycle everything you can <15>
> limit your children to an average 1 per adult between all your
> marriages. (Only REPLACE yourself, not expand the population)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
<HTML> blah blah blha <?php echo "Let's put some PHP code in here too!"; ?> blah blah blah <?php require 'navbar.inc';?> </HTML>
---------- navbar.inc ------------ <TABLE><TR ALIGN=CENTER> <TD><A HREF=page2.htm>Page 2</A></TD> <TD><A HREF=page3.htm>Page 3</A></TD> <TD><A HREF=page4.htm>Page 4</A></TD> </TR></TABLE> ----------------------------------
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Surfer!" <surfernevis-view.demon.co.uk> Newsgroups: php.general Sent: Monday, March 19, 2001 3:20 AM Subject: [PHP] PHP - include / require
> I was wanting a set of pages generated by individual PHP scripts to each > > use one PHP script to generate the navigation links. However I'm not > winning - a suitable example would be much appreciated. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
If you can add a unique number (microtime() * 1000000) or uniqid() to the URL, then the browser and server and everybody in between will be pretty sure it's a different URL and re-load it.
echo "<A HREF=foo.php?unique=", uniqid(), ">foo</A>";
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Barry Russell" <brinwave.demon.co.uk> Newsgroups: php.general Sent: Tuesday, March 20, 2001 8:25 PM Subject: [PHP] Cache bypass
> Can anyone point me at a way to pick up a url entered in a form > and construct an HTTP request that will download the requested > page into the browser window with an enforced refresh that > bypasses a local cache ? > > (I have a tough local policy to get thru which doesn't take account > of developers working at a distance...) > > Thanks, > Barry > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
If you are attempting to connect to a site that uses HTTP Authentication (that popup window), I *THINK* you can use:
username:password
http://whatever.com
If you need to get to/through a web-page with a FORM in it, dig out Rasmus' posttohost() function and use that to send the username/password to the login URL, and then see what you get back from that page that makes you a "valid" user from then on.
You may need to re-present an ID or something as part of each GET/POST from then on.
This kind of stuff *can* be done, but it's usually quite a headache the first time to figure out what has to go between the servers.
Oh. If it's an https:// connection, you need to use cURL.
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Brandon Orther <ortherwebintellects.com> Newsgroups: php.general Sent: Thursday, March 22, 2001 12:25 PM Subject: [PHP] Make Script login to password protected web sites
> Hello, > > Can I put the user name and password at the top of my php script so it can > loggin to a site that requires authentication? > > Can i put it anywhere in teh script to amek it do this? > > Thank you, > > -------------------------------------------- > Brandon Orther > WebIntellects Design/Development Manager > brandon
webintellects.com > 800-994-6364 > www.webintellects.com > -------------------------------------------- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
Basically, you shouldn't be checking for '1' as an answer.
Either you got 0, and it didn't work, or you didn't, and the URL is valid.
-- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Kenneth R Zink II" <Hellcat1EV1.Net> Newsgroups: php.general Sent: Thursday, March 22, 2001 3:47 PM Subject: [PHP] Fopen help
I'm trying to use Fopen to check and see if a URL exist with this bit of code. $url=$row[url]; echo "<strong>Old URL = ".$url."</strong><br>"; $urlcheck = fopen($url,"r"); echo "urlcheck = ".$urlcheck."<br>"; switch ($url){ case "": case "http://": echo "<strong>No URL Set</strong><br>"; break; default: switch ($urlcheck){ case 1: echo "<strong>Valid URL</strong><br>"; break; case 0: echo "<strong>URL Is Not Valid</strong><br>"; $url="http://"; break; default: echo "<strong>Fopen Did Not Work</strong><br>"; } break; } echo "<strong>New URL = ".$url."</strong><br>";
So far all I can get it to do is the default response. Can someone point out what I'm doing wrong or tell me how to see what the contents of a resource id is please?
Old URL = http://www.s-series.org/htm/firestorm/firestorm.htm urlcheck = Resource id #4 Fopen Did Not Work New URL = http://www.s-series.org/htm/firestorm/firestorm.htm
Kenneth R Zink II Hellcat1
S-Series.Org ICQ# 5095094 '87 2.8L TBI GMC S-15 Ext. Cab (Hurricane) ...524 in the works !!! http://www.s-series.org/htm/windstorm/project-windstorm.htm '85 3.4L Carbed Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI DIS !!! http://www.s-series.org/htm/firestorm/firestorm.htm '84 5.0L (307 "Y") Carbed Oldsmobile Delta 88 Royal Brougham. Daily driver until FireStorm is ready. Racing by the Grace of God!!
attached mail follows:
can an array be stored in a database field? E.g. make a few runtime settings for a page, store the settings as an array in a field, and use that array to make some runtime settings?
Follow up to that question, can that array be persisted from page to page without a cookie?
regards, jaxon
attached mail follows:
Yes it can.
Try serialize() and unserialize() functions.
Mick
On Fri, 23 Mar 2001, Jaxon wrote:
>
> can an array be stored in a database field?
> E.g. make a few runtime settings for a page, store the settings as an array
> in a field, and use that array to make some runtime settings?
>
> Follow up to that question, can that array be persisted from page to page
> without a cookie?
>
> regards,
> jaxon
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
see:
http://www.php.net/manual/en/function.serialize.php
you could store a unique id in your URL that refers to the ow in your DB where the array is stored.
-aaron
At 9:04 PM -0500 3/23/01, Jaxon wrote:
>can an array be stored in a database field?
>E.g. make a few runtime settings for a page, store the settings as an array
>in a field, and use that array to make some runtime settings?
>
>Follow up to that question, can that array be persisted from page to page
>without a cookie?
>
>regards,
>jaxon
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hello,
Has anyone successfully implemented gettext on windows? If so how do you go about creating po files and using the bindtextdomain function;
Thanks
attached mail follows:
I have a script that sets cookies for validation. The problem is that on some servers(wwws) it works fine, but on another when submitted it gives a 404 error. I can send the code to someone if they like, but this is driving me insane. It's just too long to add here Thanks
attached mail follows:
Hi,
when I declare the varible $cid like this "http://myserver/index.php?cid=1" it works fine, but when i declare it in the code like this $cid = '1';
it doesn't work... is this maybe because of the level i declare the varible? how to i declare it the same as "http://myserver/index.php?cid=1" but in my php code...
PS. I use this varible in a function that is called by a function wich is included and so on... it is rather far down.
Thanks Gaur _______________________________
This email may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you have received this email in error, please contact the sender and delete all copies. Opinions, conclusions or other information expressed or contained in this email are not given or endorsed by the sender unless otherwise affirmed independently by the sender.
_________________________________
attached mail follows:
Remove the '' around the 1.
----- Original Message -----
From: "Chris Doyle" <gaur
planetveggie.com>
To: "PHP List" <php-general
lists.php.net>
Sent: Friday, March 23, 2001 9:44 PM
Subject: [PHP] [php] Varible declaration
Hi,
when I declare the varible $cid like this "http://myserver/index.php?cid=1" it works fine, but when i declare it in the code like this $cid = '1';
it doesn't work... is this maybe because of the level i declare the varible? how to i declare it the same as "http://myserver/index.php?cid=1" but in my php code...
PS. I use this varible in a function that is called by a function wich is included and so on... it is rather far down.
Thanks Gaur _______________________________
This email may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you have received this email in error, please contact the sender and delete all copies. Opinions, conclusions or other information expressed or contained in this email are not given or endorsed by the sender unless otherwise affirmed independently by the sender.
_________________________________
attached mail follows:
Doesn't work still in my function i put a die($cid); and it doesn't display anything value....
----- Original Message -----
From: "Chris Anderson" <chrisderson
ameritech.net>
To: "Chris Doyle" <gaur
planetveggie.com>; "PHP List"
<php-general
lists.php.net>
Sent: Friday, March 23, 2001 6:40 AM
Subject: Re: [PHP] [php] Varible declaration
> Remove the '' around the 1.
> ----- Original Message -----
> From: "Chris Doyle" <gaur
planetveggie.com>
> To: "PHP List" <php-general
lists.php.net>
> Sent: Friday, March 23, 2001 9:44 PM
> Subject: [PHP] [php] Varible declaration
>
>
> Hi,
>
> when I declare the varible $cid like this
"http://myserver/index.php?cid=1"
> it works fine, but when i declare it in the code like this
> $cid = '1';
>
> it doesn't work... is this maybe because of the level i declare the
varible?
> how to i declare it the same as "http://myserver/index.php?cid=1" but in
> my php code...
>
> PS.
> I use this varible in a function that is called by a function wich is
> included and so on... it is rather far down.
>
> Thanks
> Gaur
> _______________________________
>
> This email may contain confidential and/or privileged information for the
> sole use of the intended recipient. Any review or distribution by others
is
> strictly prohibited. If you have received this email in error, please
> contact the sender and delete all copies. Opinions, conclusions or other
> information expressed or contained in this email are not given or endorsed
> by the sender unless otherwise affirmed independently by the sender.
>
> _________________________________
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
no problem i have got it now.. needed to declare it global.
----- Original Message -----
From: "Chris Anderson" <chrisderson
ameritech.net>
To: "Chris Doyle" <gaur
planetveggie.com>; "PHP List"
<php-general
lists.php.net>
Sent: Friday, March 23, 2001 6:40 AM
Subject: Re: [PHP] [php] Varible declaration
> Remove the '' around the 1.
> ----- Original Message -----
> From: "Chris Doyle" <gaur
planetveggie.com>
> To: "PHP List" <php-general
lists.php.net>
> Sent: Friday, March 23, 2001 9:44 PM
> Subject: [PHP] [php] Varible declaration
>
>
> Hi,
>
> when I declare the varible $cid like this
"http://myserver/index.php?cid=1"
> it works fine, but when i declare it in the code like this
> $cid = '1';
>
> it doesn't work... is this maybe because of the level i declare the
varible?
> how to i declare it the same as "http://myserver/index.php?cid=1" but in
> my php code...
>
> PS.
> I use this varible in a function that is called by a function wich is
> included and so on... it is rather far down.
>
> Thanks
> Gaur
> _______________________________
>
> This email may contain confidential and/or privileged information for the
> sole use of the intended recipient. Any review or distribution by others
is
> strictly prohibited. If you have received this email in error, please
> contact the sender and delete all copies. Opinions, conclusions or other
> information expressed or contained in this email are not given or endorsed
> by the sender unless otherwise affirmed independently by the sender.
>
> _________________________________
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
thats good, in the future a code snippet helps
----- Original Message -----
From: "Chris Doyle" <gaur
planetveggie.com>
To: "PHP List" <php-general
lists.php.net>
Sent: Friday, March 23, 2001 11:12 PM
Subject: Re: [PHP] [php] Varible declaration
> no problem i have got it now..
> needed to declare it global.
>
> ----- Original Message -----
> From: "Chris Anderson" <chrisderson
ameritech.net>
> To: "Chris Doyle" <gaur
planetveggie.com>; "PHP List"
> <php-general
lists.php.net>
> Sent: Friday, March 23, 2001 6:40 AM
> Subject: Re: [PHP] [php] Varible declaration
>
>
> > Remove the '' around the 1.
> > ----- Original Message -----
> > From: "Chris Doyle" <gaur
planetveggie.com>
> > To: "PHP List" <php-general
lists.php.net>
> > Sent: Friday, March 23, 2001 9:44 PM
> > Subject: [PHP] [php] Varible declaration
> >
> >
> > Hi,
> >
> > when I declare the varible $cid like this
> "http://myserver/index.php?cid=1"
> > it works fine, but when i declare it in the code like this
> > $cid = '1';
> >
> > it doesn't work... is this maybe because of the level i declare the
> varible?
> > how to i declare it the same as "http://myserver/index.php?cid=1" but
in
> > my php code...
> >
> > PS.
> > I use this varible in a function that is called by a function wich is
> > included and so on... it is rather far down.
> >
> > Thanks
> > Gaur
> > _______________________________
> >
> > This email may contain confidential and/or privileged information for
the
> > sole use of the intended recipient. Any review or distribution by others
> is
> > strictly prohibited. If you have received this email in error, please
> > contact the sender and delete all copies. Opinions, conclusions or other
> > information expressed or contained in this email are not given or
endorsed
> > by the sender unless otherwise affirmed independently by the sender.
> >
> > _________________________________
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
can somebody explain me WHY I can't make my PHP compile with GD? I put --with-gd=/usr/lib/ where usualy the libgd.* are, and there THEY ARE, but the ./configure (blabla yada yada yada) returns me that COULDN'T FIND the libgd.* in /usr/lib/
does anybody have some solution please?
-- [ Paulo Vinícius Vitto Ruthes ] [ paulo.ruthesuol.com.br ] [ ICQ#:18058144 ] [ "Viva la cucaracha!!" ]
attached mail follows:
could someone check this?
From the URL parsing discussions, you should be able to do these two things with a URL like this: index.php/main/default/sitelevel1/sitelevel2/sitelevel3/name.html
1. set some page variables from the URL:
function page_init() { global $REQUEST_URI; global $init_vars[]; //array set in config file, eg. //$init_vars[]="$tpl"; //$init_vars[]="$stylesheet";
$path_array = explode('/', $REQUEST_URI);
while (list ($init_key,$init_value) = each($init_var[])) { list($uri_key, $uri_value) = each($path_array[]) $init_value = uri_value } }
2. create a you-are-here thingy like: sitelevel1 >> sitelevel2 >> sitelevel3 >> name.html
function breadcrumbs() { global $REQUEST_URI global $init_depth; //how much of initial uri items to discard
$path_array = explode('/', $REQUEST_URI);
for ($i=0, $i <= $init_depth; $i++); { array_shift($path_array); //discard config item - not used here }
$page_name = array_pop($path_array); //strip page name from end of array $crumbs_length = count($page_array); //how long is path now? $crumbs_div = " >> "; //use to divide the breadcrumbs
for ($i=0, $i <= $crumbs_length; $i++); { list($position, $value) = each($path_array); echo $value; echo $crumb_div; }
echo($pagename); }
now, anyone have any idea how to make each sitelevel item an href???
regards, jaxon
attached mail follows:
Hello,
I have a cgi that I run in telnet by doing this:
perl /script/cgi-script.cgi name=cgi+script purpose=test
is there a way I can run a cgi script and pass it variables?
Thanks Brandon
attached mail follows:
How would I use to explode to extract the following....
"name address city state zip"
I want to break that up and then do this....
if (empty($name))
if (empty($address)
thanks
randy
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]