[PHP] session

2003-03-10 Thread Shaun van den Berg
Hi,

What should the probability of your garbadge collector be ? is a 100% bad ,
and how long must the max lifetime of your session variables be , the
default is 1440 secs(24 min) , is 24 hours to much ? Thanks

Shaun

--
Novtel Consulting
Tel: +27 21 9822373
Fax: +27 21 9815846
Please visit our website:
www.novtel.co.za



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



[PHP] Maths on variables - please help

2003-03-10 Thread Adriaan Nel
Hi every1,

I would like some help on multiplication/division of variables on 1
anotherI have looked at the bcmath() function, but it doesn't seem to
work.

Could any1 pls assist.

Adriaan



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



[PHP] Calling all values of variables into one variable

2003-03-10 Thread Rahul.Brenda
What the following script does is that it gives a
result of 4 rows, from the database, and generates 4
variables (newsbits0, newsbits1, newsbits2,
newsbits3), and inserts result data into each of these
variables. 

What i want is a final 5th variable which contains all
the data of the first 4 variables.. so that i can call
that variable in my Flash file and display the result
in one Dynamic Text field..



Rahul S. Johari

__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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



[PHP] Re: Form input security

2003-03-10 Thread Manuel Lemos
Hello,

On 03/09/2003 04:18 PM, Chris Cook wrote:
When using forms, when do I have to worry about cleaning up user data? I 
know to use escapeshellarg() when using system functions, but how about 
when using the user data for database inserts? Also, if I do not insert 
the data into the database or use any system commands, do I still need 
to clean the data?
Of course you have to assure that data used in SQL queries is formatted 
properly or else your applications may be vulnerable to hacker exploits 
often known as SQL injections.

If you need to validate form data to assure it is formatted properly, 
you may want to try this forms generation and validation class that does 
most of the work for you:

http://www.phpclasses.org/formsgeneration

Data to be inserted in text fields also needs to be properly quoted and 
escaped to prevent SQL injection of commands that make your database 
execute arbitrary actions that may compromise your server security.

Database text data quoting depends on the database you use. If you use a 
database abstraction layer package like this you may call a function to 
do the appropriate quoting independently of the type of database you use:

http://www.phpclasses.org/metabase

--

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


Re: [PHP] help needed with code!!

2003-03-10 Thread Hugh Danaher
You might try changing  to php?>
something about short tags
hugh
- Original Message - 
From: "Karl James" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 10:14 PM
Subject: [PHP] help needed with code!!


> Can anyone give me some pointers on why im note seeing 
> Any output to the browser.
> 
> Thanks Karl
> 
> 
> my link
> http://66.12.3.67/webdb/webdb13/assignment_1.php
> 
> my code
> http://nopaste.php-q.net/7560
> 
> ultimatefootballleague.com/index.php
> [EMAIL PROTECTED]
>  
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



[PHP] Re: Persistent values between executions

2003-03-10 Thread Manuel Lemos
Hello,

On 03/10/2003 01:30 PM, Mike Mannakee wrote:
I have some sets of values that I have stored in several tables in a mySQL
database.  These don't often change, but are referenced on every single page
view.  While each call is quick, as a gross the load on the server is too
high.  I would like to know if there is a way to have these sets of values
remain persistent in the server's memory between calls from browsers, like
environment variables, to reduce the back and forth calls to mySQL.  As the
data from the calls are almost always the same, it would seem easier this
way.
Any thoughts?  Comments?  RTFM suggestions?
You may want to try this cache class. You can take any variable and 
serialize it so it can be stored for later retrieval without querying 
your database.

http://www.phpclasses.org/filecacheclass

Usually I do not recommend caching just variables. For instance, if your 
variables will be used to generate portions of HTML pages, it would be 
more efficient to cache those portions of HTML data instead of the 
variables that is only used to regenerate such HTML data.

--

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


[PHP] Re: html mail

2003-03-10 Thread Manuel Lemos
Hello,

On 03/10/2003 10:47 AM, Ian a. gray wrote:
I am quite new to php and I am trying to find a way of
sending details of a web form over e-mail in both text
and html format.  There are numerous sites on the web
that try and explain how to do this but they are
worded very complicated and to be honest I haven't
found one that is particularly good.
I want to send an e-mail that contains html code, with
the option of attatching images and other files as
well as a text version of the email so that the viewer
can read the same e-mail whether or not he can view
html email or not.
Any ideas?
Try this class that does exactly what you ask and comes with easy to 
understand examples to get you started with it very quickly:

http://www.phpclasses.org/mimemessage

--

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


[PHP] Re: help needed with code!!

2003-03-10 Thread chris
On Tue, 11 Mar 2003 01:14:09 -0500, Karl James <[EMAIL PROTECTED]> 
wrote:

Can anyone give me some pointers on why im note seeing Any output to the 
browser.

Thanks Karl

my link
http://66.12.3.67/webdb/webdb13/assignment_1.php
my code
http://nopaste.php-q.net/7560
ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
You might have some sort of error message disabled in php.ini.  If you just 
copy and paste from that html file, it's riddled with invalid characters.  
You'll have to manually go through the copied source and replace all of the 
spaces and newlines.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Error in $_POST

2003-03-10 Thread chris
On Sun, 9 Mar 2003 20:01:33 +0530, Aspire Something <[EMAIL PROTECTED]> 
wrote:

Hi guys ,

I am getting this error in php
___What I am doing;
1. I am posting data from one form and collecting it for execution as 
follows
$_POST['cust_id[0]']; // cust_id is an array of length 1 which is 
selected form an drop down menu

2. register_globals is off
3. Also when i try to call an array element in to other array like
$first_array=[$second_array[the_index_value]];
I encounter the same problem.
___The error is:

Parse error: parse error, unexpected '[', expecting ']'

why am i getting this error am i doing some blunders ???

Loads of thanks in advance
Regards,
V Kashyap
Try $_POST['cust_id'][0]

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] help needed with code!!

2003-03-10 Thread Karl James
Can anyone give me some pointers on why im note seeing 
Any output to the browser.

Thanks Karl


my link
http://66.12.3.67/webdb/webdb13/assignment_1.php

my code
http://nopaste.php-q.net/7560

ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 



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



Re: [PHP] Forms & Session variables

2003-03-10 Thread Justin French
You need to slow down and think things through.  My recommendation would be
to get a SINGLE PAGE form to work how you want first, then assess the logic
needed to move onto multiple forms.

Also, this was asked a while back, so here was my answer & sample code last
time:

http://marc.theaimsgroup.com/?l=php-general&m=104371796307302&w=2


Justin




on 11/03/03 4:45 PM, Ashley M. Kirchner ([EMAIL PROTECTED]) wrote:

> 
> I'm trying to build a multi-step form and using sessions to register
> the field values, but having serious issues.  This is what I'd like to do:
> 
> step 1 (first page): ask for name, address, email. [submit]
> step 2 (second page): ask for more personal information [submit]
> step 3 (last page): ask for specific event information [submit]
> send everything to a back end MySQL db, and redirect to a thank you
> page.
> 
> This whole process is just one form.php file that posts to a
> process.php script.  The content of form.php gets changed based on the
> step# (they get included step1.inc, step2.inc, and step3.inc.)
> 
> However, after each [submit] I would like to verify the data prior
> to continuing to the next page.  If any of the fields are missing or
> incorrect, we re-post the same page with the correct fields already
> filled in (based on whatever the user entered), and the missing one ...
> blank (obviously.)  But, if everything is okay, and all fields check
> out, register the values and go on to the next page.  Repeat the process.
> 
> I'm having a heck of a time with the validation part.  Either things
> don't register, or it gets stuck in a loop, regardless of what I change
> after the re-post.  So, I need some help.  I need some code...help!


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



Re: [PHP] newbie: contents will not output

2003-03-10 Thread Hugh Danaher
Anthony,
Oh, I forgot to close the file, and it's an important step!

 fclose($fp);

Hugh
- Original Message - 
From: "Anthony Ritter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 7:22 PM
Subject: [PHP] newbie: contents will not output


> I'm trying to test the following script to display the contents of the
> following URL but it will not output.
> 
> Any advice will be greatly appreciated.
> Thank you.
> Tony Ritter
> ...
> 
> 
> 
> 
> 
> $file_handler = fopen("http://www.weather.com";, "r");
> $contents = fread($file_handler, filesize($file));
> fclose($file_handler);
> echo $contents;
>  ?>
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



Re: [PHP] Subtracting two dates

2003-03-10 Thread Justin French
on 11/03/03 5:04 PM, Ben C. ([EMAIL PROTECTED]) wrote:

> Thanks, Justin.  It works.

Of course it does :P

HTH

Justin


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



Re: [PHP] newbie: contents will not output

2003-03-10 Thread Hugh Danaher
Anthony,

Try:

 $file_to_open="http://www.weather.com";;
 $fp=fopen($file_to_open,"r");
 $contents=fread($fp,1); //reads to eof or  ~10K whichever comes first
 print $contents;

Hope this helps.
Hugh
- Original Message - 
From: "Anthony Ritter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 7:22 PM
Subject: [PHP] newbie: contents will not output


> I'm trying to test the following script to display the contents of the
> following URL but it will not output.
> 
> Any advice will be greatly appreciated.
> Thank you.
> Tony Ritter
> ...
> 
> 
> 
> 
> 
> $file_handler = fopen("http://www.weather.com";, "r");
> $contents = fread($file_handler, filesize($file));
> fclose($file_handler);
> echo $contents;
>  ?>
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



[PHP] RE: tricky exec problem

2003-03-10 Thread daniel
hi guys i am having a problem getting certain command line output bak to php
i am using the time binary to show the ammount of time it takes for the php 
script to be compiled using the command line php although i am not getting any 
output

exec("/usr/bin/time php -q /www/sbsmain/worldarts/index.php3 > /dev/null 
2>&1",$results,$err);

i have tried this but it wont work , any ideas ?



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



RE: [PHP] Subtracting two dates

2003-03-10 Thread Ben C.
Thanks, Justin.  It works.

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 8:27 PM
To: Ben C.; [EMAIL PROTECTED]
Subject: Re: [PHP] Subtracting two dates




Then you need to decide if you want to show days, or hours, or years
difference...

I'll show you hours and days:



You then need to round the number using round().


Justin



on 11/03/03 3:02 PM, Ben C. ([EMAIL PROTECTED]) wrote:

> There are a lot of artlicles on this but I need a simple solution.  I need
> to subtract two dates as follows:
>
> $date = date("Y-m-d");
> $date1 = "2003-03-03";
> $differencedate = ($date - $date1);
> echo $differencedate;
>
> When I do this I get 0.  Please help!
>
>
> --
> The content of this email message and any attachments are confidential and
> may be legally privileged, intended solely for the addressee.  If you are
> not the intended recipient, be advised that any use, dissemination,
> distribution, or copying of this e-mail is strictly prohibited.  If you
> receive this message in error, please notify the sender immediately by
reply
> email and destroy the message and its attachments.
>


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



[PHP] Forms & Session variables

2003-03-10 Thread Ashley M. Kirchner
   I'm trying to build a multi-step form and using sessions to register 
the field values, but having serious issues.  This is what I'd like to do:

   step 1 (first page): ask for name, address, email. [submit]
   step 2 (second page): ask for more personal information [submit]
   step 3 (last page): ask for specific event information [submit]
   send everything to a back end MySQL db, and redirect to a thank you 
page.

   This whole process is just one form.php file that posts to a 
process.php script.  The content of form.php gets changed based on the 
step# (they get included step1.inc, step2.inc, and step3.inc.)

   However, after each [submit] I would like to verify the data prior 
to continuing to the next page.  If any of the fields are missing or 
incorrect, we re-post the same page with the correct fields already 
filled in (based on whatever the user entered), and the missing one ... 
blank (obviously.)  But, if everything is okay, and all fields check 
out, register the values and go on to the next page.  Repeat the process.

   I'm having a heck of a time with the validation part.  Either things 
don't register, or it gets stuck in a loop, regardless of what I change 
after the re-post.  So, I need some help.  I need some code...help!

--
M | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [PHP] Subtracting two dates

2003-03-10 Thread Justin French


Then you need to decide if you want to show days, or hours, or years
difference...

I'll show you hours and days:



You then need to round the number using round().


Justin



on 11/03/03 3:02 PM, Ben C. ([EMAIL PROTECTED]) wrote:

> There are a lot of artlicles on this but I need a simple solution.  I need
> to subtract two dates as follows:
> 
> $date = date("Y-m-d");
> $date1 = "2003-03-03";
> $differencedate = ($date - $date1);
> echo $differencedate;
> 
> When I do this I get 0.  Please help!
> 
> 
> --
> The content of this email message and any attachments are confidential and
> may be legally privileged, intended solely for the addressee.  If you are
> not the intended recipient, be advised that any use, dissemination,
> distribution, or copying of this e-mail is strictly prohibited.  If you
> receive this message in error, please notify the sender immediately by reply
> email and destroy the message and its attachments.
> 


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



[PHP] md5 encrypt problem

2003-03-10 Thread CF High
Hey all.

Having a wee bit o' trouble with a simple md5 script:

  for ($x=1 ; $x <62 ; $x++) {

  $mypass = "sports" . $x;
  $mypass = md5($mypass);

  dbConnect("UPDATE user_login SET password = '$mypass' WHERE school_id
= $x");

  }

For some reason, when I attempt to login with my md5'd user supplied
password I get no match.  Bizarre, haven't had this problem
before...

Any help always appreciated

--Noah

--




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



[PHP] Subtracting two dates

2003-03-10 Thread Ben C.
There are a lot of artlicles on this but I need a simple solution.  I need
to subtract two dates as follows:

$date = date("Y-m-d");
$date1 = "2003-03-03";
$differencedate = ($date - $date1);
echo $differencedate;

When I do this I get 0.  Please help!


--
The content of this email message and any attachments are confidential and
may be legally privileged, intended solely for the addressee.  If you are
not the intended recipient, be advised that any use, dissemination,
distribution, or copying of this e-mail is strictly prohibited.  If you
receive this message in error, please notify the sender immediately by reply
email and destroy the message and its attachments.


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



[PHP] Error in $_POST

2003-03-10 Thread Aspire Something
Hi guys ,

I am getting this error in php
___What I am doing;
1. I am posting data from one form and collecting it for execution as follows
  $_POST['cust_id[0]']; // cust_id is an array of length 1 which is selected form 
an drop down menu

2. register_globals is off
3. Also when i try to call an array element in to other array like
   $first_array=[$second_array[the_index_value]];
   I encounter the same problem.

___The error is:

Parse error: parse error, unexpected '[', expecting ']'

why am i getting this error am i doing some blunders ???

Loads of thanks in advance
Regards,
V Kashyap


Re: [PHP] fopen and PHP 4.3.x

2003-03-10 Thread CDitty
At 09:42 PM 3/10/2003, Liam Gibbs wrote:
> This is the code around line 30.
> $local_file = $feed;
> $fp = fopen($local_file, "r");
>
> Anyone have any ideas?  I have looked over the manual and the only thing I
> could find similar to this is in the comments.  Apache was restarted.
I get the same thing so I'm working through it. But here are some ideas that
may work for you: What are the permissions of the file in question? And do
you know the exact path of the file? Also, is the first line above (line
29?) needed? Why not just use $feed as the filename?
Forgot to mention this. Pulling via http. Works in the browser, but not in 
the script. The line above is needed, but it has nothing to do with fopen. 
Using url instead of $file produces same error.

Chris

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


Re: [PHP] fopen and PHP 4.3.x

2003-03-10 Thread Liam Gibbs
> This is the code around line 30.
> $local_file = $feed;
> $fp = fopen($local_file, "r");
>
> Anyone have any ideas?  I have looked over the manual and the only thing I
> could find similar to this is in the comments.  Apache was restarted.

I get the same thing so I'm working through it. But here are some ideas that
may work for you: What are the permissions of the file in question? And do
you know the exact path of the file? Also, is the first line above (line
29?) needed? Why not just use $feed as the filename?


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



RE: [PHP] newbie: contents will not output

2003-03-10 Thread John W. Holmes
> I'm trying to test the following script to display the contents of the
> following URL but it will not output.
> 
> Any advice will be greatly appreciated.
> Thank you.
> Tony Ritter
> ...
> 
> 
> 
> 
> 
> $file_handler = fopen("http://www.weather.com";, "r");
> $contents = fread($file_handler, filesize($file));
> fclose($file_handler);
> echo $contents;
>  ?>
> 
> 

filesize() won't work on remote files (through http) and like Justin
said... what's $file??

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] fopen and PHP 4.3.x

2003-03-10 Thread CDitty
I seem to be having a problem with fopen on apache 1.3.27/php 4.3 
servers.  Scripts that worked before and on other servers do not work on 
this one.  The web host recently upgraded both php and apache.   Below is 
the error.

Warning: fopen(XX) [function.fopen]: failed to create 
stream: Invalid argument in /path/to/script/import.php on line 30

This is the code around line 30.
$local_file = $feed;
$fp = fopen($local_file, "r");
Anyone have any ideas?  I have looked over the manual and the only thing I 
could find similar to this is in the comments.  Apache was restarted.

CDitty



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


Re: [PHP] newbie: contents will not output

2003-03-10 Thread Justin French
I've never opened a URL with fopen.

Have you looked for examples in the manual?  http://php.net/fopen ???

however, I can see one problem...

filesize($file) -- where is $file


Justin French


on 11/03/03 2:22 PM, Anthony Ritter ([EMAIL PROTECTED])
wrote:

> I'm trying to test the following script to display the contents of the
> following URL but it will not output.
> 
> Any advice will be greatly appreciated.
> Thank you.
> Tony Ritter
> ...
> 
> 
> 
> 
> 
>  $file_handler = fopen("http://www.weather.com";, "r");
> $contents = fread($file_handler, filesize($file));
> fclose($file_handler);
> echo $contents;
> ?>
> 
> 
> 
> 
> 
> 
> 


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



[PHP] newbie: contents will not output

2003-03-10 Thread Anthony Ritter
I'm trying to test the following script to display the contents of the
following URL but it will not output.

Any advice will be greatly appreciated.
Thank you.
Tony Ritter
...





http://www.weather.com";, "r");
$contents = fread($file_handler, filesize($file));
fclose($file_handler);
echo $contents;
 ?>








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



[PHP] Re: Persistent values between executions

2003-03-10 Thread Mike Mannakee
Yeah, it's on linux.  I had a similar thought.  I figured, if no other
solutions came from the post, I could hard code the variables into a file,
and if I needed to update it, make it self updating.  Like do a string
replace to add the new variables I need in the include file itself.  Bit of
a pain, but once it's running it should be alright.

Mike


"Chris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Mon, 10 Mar 2003 11:30:25 -0500, Mike Mannakee <[EMAIL PROTECTED]>
> wrote:
>
> > I have some sets of values that I have stored in several tables in a
> > mySQL
> > database.  These don't often change, but are referenced on every single
> > page
> > view.  While each call is quick, as a gross the load on the server is
too
> > high.  I would like to know if there is a way to have these sets of
> > values
> > remain persistent in the server's memory between calls from browsers,
> > like
> > environment variables, to reduce the back and forth calls to mySQL.  As
> > the
> > data from the calls are almost always the same, it would seem easier
this
> > way.
> >
> > Any thoughts?  Comments?  RTFM suggestions?
> >
> > Mike
> >
>
> Happen to be on a unix system?  What you could do is have a particular
> script that will do your mysql call and output the variables in a another
> file.  Then, have a cron job run that script however often you need to
have
> those variables updated.
>
> Another way you could do it is initialize the variables you need as
session
> variables if the user logs in (assuming you're using an authentication
> system), which will stay active as long as the user has a valid session.
>
> --
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/



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



RE: [PHP] sessions terminating randomly please help

2003-03-10 Thread John W. Holmes
> Is your session.save_path set to /tmp? It's my understanding that you
> should
> specify a directory for saving session data -- or use a database --
that
> /tmp is subject to garbage collection, and specifying a directory
prevents
> that. I made this change to a site recently. In tests prior to the
change
> the session would last up to about 2.5 hours with no activity. After
> specifying a directory with session_save_path() right before
> session_start(), the session was still OK after almost 4 hours of
> inactivity. (Not much of a controlled test, I admit.)

Note that your session files will never be cleaned up if you use
session_save_path(), unless you do it yourself. This means that a file
will be created each time someone comes to your site and it won't be
erased. Only the path specified in php.ini will be cleaned up... which
is what you want. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] Re: Persistent values between executions

2003-03-10 Thread chris
On Mon, 10 Mar 2003 11:30:25 -0500, Mike Mannakee <[EMAIL PROTECTED]> 
wrote:

I have some sets of values that I have stored in several tables in a 
mySQL
database.  These don't often change, but are referenced on every single 
page
view.  While each call is quick, as a gross the load on the server is too
high.  I would like to know if there is a way to have these sets of 
values
remain persistent in the server's memory between calls from browsers, 
like
environment variables, to reduce the back and forth calls to mySQL.  As 
the
data from the calls are almost always the same, it would seem easier this
way.

Any thoughts?  Comments?  RTFM suggestions?

Mike

Happen to be on a unix system?  What you could do is have a particular 
script that will do your mysql call and output the variables in a another 
file.  Then, have a cron job run that script however often you need to have 
those variables updated.

Another way you could do it is initialize the variables you need as session 
variables if the user logs in (assuming you're using an authentication 
system), which will stay active as long as the user has a valid session.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] .htaccess Help

2003-03-10 Thread Justin French
Get on the Apache list, not the PHP one :)

Justin

on 11/03/03 10:39 AM, Pushpinder Singh Garcha ([EMAIL PROTECTED]) wrote:

> Hello All
> 
> I need to allow users to be able to access ONLY non-html files in a
> Secret Dir.
> Can anyone suggest a .htaccess method to do just that.
> 
> I have a .htaccess script which will prevent anybody from viewing the
> contents of a Dir via http, but this time , I need to allow users to
> view the PHP Files
> 
> 
> TIA
> 
> Pushpinder Singh Garcha
> _
> Web Architect
> 


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



Re: [PHP] sessions terminating randomly please help

2003-03-10 Thread Lowell Allen
> From: "freaky deaky" <[EMAIL PROTECTED]>
> 
> i am experiencing a major problem with sessions expiring randomly in some of
> my 
> apps. i will log in and start clicking around and then i will eventually
> arrive at a page that tells me that i'm not logged in anymore. this happens
> apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc,
> and mozilla 
> 
> the apps are hosted on
> 
> freebsd 4.7-release p2
> apache 1.3.27 
> php version 4.2.3
> compiled with --enable-trans-sid
> 
> i can't go into production if there's the possibility that users will be
> randomly logged off. i went through all of my code over the weekend, and i
> don't think i can attribute this to a miscoding:
> 
> when a user logs in, i create a session with
> 
> session_start(); 
> $valid_user=$_POST['username'];
> session_register("valid_user");
> 
> i have the following code at the top of each page to check to see if the
> session 
> is valid: 
> 
> session_start(); 
> $valid_user=$_SESSION['valid_user'];
> global $valid_user;
> if (session_is_registered("valid_user")
> {...function to spit out an error message if the session is not valid...;}
> 
> i have a logout page that destroys the session
> 
> session_start(); 
> session_destroy();
> 
> i also have a javascript timer in the header of every page that redirects to
> the 
> logout page if the user has been inactive for 20 minutes.
> 
> i have played around with session.gc_probability, setting it to 100, but that
> doesn't seem to have fixed the problem.
> 
> this is a huge problem.
> if anyone can give some advice, i'd really appreciate it.

Is your session.save_path set to /tmp? It's my understanding that you should
specify a directory for saving session data -- or use a database -- that
/tmp is subject to garbage collection, and specifying a directory prevents
that. I made this change to a site recently. In tests prior to the change
the session would last up to about 2.5 hours with no activity. After
specifying a directory with session_save_path() right before
session_start(), the session was still OK after almost 4 hours of
inactivity. (Not much of a controlled test, I admit.)

That said, here's a disturbing fact that turned up last week -- a designer
working on the same site was continually being logged off unexpectedly.
After many tests he identified that the problem was Microsoft IE/Entourage.
Every time he checks email he's no longer recognized as logged in (Mac OSX
IE). He got Microsoft tech support to duplicate the behavior and confirm
it's a problem with IE -- doesn't happen with Mozilla.

So, it's important to verify the problem with more than one system, but it
sounds like you have since you mention both IE6 and IE Mac!

--
Lowell Allen


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



Re: [PHP] Re: sessions terminating randomly please help

2003-03-10 Thread Justin French
Check if your server is using files or shared memory to save the sessions...
My ISP was using mm (memory), and it was buggy... when they changed back to
files, all was well.

Justin


on 11/03/03 7:40 AM, David Chamberlin ([EMAIL PROTECTED]) wrote:

> It's possible you're being afflicted with the same problem I am.  See
> the message just one or two above this about "Sessions problem".  What I
> found in my debugging is that it had to do with how I was
> mix-and-matching the way I specified links.
> 
> Short version of the problem is that http://mysite.org/ has one session
> and http://www.mysite.org/ has another.  In my code, I sometimes have
> the links as  and sometimes it's explicit, as  href="http://www.mysite.org/";>.  So if a user went to the site as
> http://mysite.org - the pages that used the explicit www.mysite.org
> would fail.
> 
> So if there's anything in your pages/links that may change how the link
> is referred, you may be have different sessions occuring.
> 
> I would imagine it should be pretty easy for you to debug whether or not
> this is the problem.  Have each of your pages echo out the current
> session id (echo 'session is '.session_id().'';) and see if it
> changes at any point, and especially on the pages that fail.
> 
> -Dave
> 
> Freaky Deaky wrote:
>> hi 
>> 
>> i am experiencing a major problem with sessions expiring randomly in some of
>> my 
>> apps. i will log in and start clicking around and then i will eventually
>> arrive at a page that tells me that i'm not logged in anymore. this happens
>> apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc,
>> and mozilla 
>> 
>> the apps are hosted on
>> 
>> freebsd 4.7-release p2
>> apache 1.3.27 
>> php version 4.2.3
>> compiled with --enable-trans-sid
>> 
>> i can't go into production if there's the possibility that users will be
>> randomly logged off. i went through all of my code over the weekend, and i
>> don't think i can attribute this to a miscoding:
>> 
>> when a user logs in, i create a session with
>> 
>> session_start();
>> $valid_user=$_POST['username'];
>> session_register("valid_user");
>> 
>> i have the following code at the top of each page to check to see if the
>> session 
>> is valid: 
>> 
>> session_start();
>> $valid_user=$_SESSION['valid_user'];
>> global $valid_user;
>> if (session_is_registered("valid_user")
>> {...function to spit out an error message if the session is not valid...;}
>> 
>> i have a logout page that destroys the session
>> 
>> session_start();
>> session_destroy();
>> 
>> i also have a javascript timer in the header of every page that redirects to
>> the 
>> logout page if the user has been inactive for 20 minutes.
>> 
>> i have played around with session.gc_probability, setting it to 100, but that
>> doesn't seem to have fixed the problem.
>> 
>> this is a huge problem.
>> if anyone can give some advice, i'd really appreciate it.
>> 
>> thanks
>> 
> 


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



Re: [PHP] PHP Online Store

2003-03-10 Thread Justin French
You only have two options really... either they manually change each product
themselves via a web based form, or the process is managed by a CSV file.
The first thing you need to ensure is that every product in the catalogue
has a unique key (identifier / product number / barcode number / whatever).

This value needs to be present in the database, and in the case of a CSV
file, needs to match the CSV.


You take the following CSV:

'10034','Socks - Red','2.99'
'10485','Socks - Blue','3.24'

And parse it into your database, where you'd have columns like:

id,description,price


They can change the description all they want... they can also change the
price, but they need to leave the id alone.  If they change the ID, it's
like a new product.


If their supplier can't supply an Excel or CSV file, or doesn't have unique
codes for each product, then your client has no choice but to manually
update the data themselves via web forms, or maintain THEIR OWN Excel file
which you can parse weekly/daily/whatever.


I'd avoid doing anything manually.  Try to get an agreed format CSV from the
supplier monthly, and parse it.


Justin



on 11/03/03 9:51 AM, Pag ([EMAIL PROTECTED]) wrote:

> 
> Hi,
> 
> I have to write a PHP/MySQL online store with product catalogs, prices,
> descriptions, and ordering (no payment) etc, but i have a big doubt when it
> comes to updating.
> How is it usually done? I mean, i never did a project like this, with a
> big amount of products to update. Whats the easiest way of updating the
> prices like say, every week? The suppliers send a list of the new prices to
> the store, and the store has to update the prices online manually, one by one?
> Also i thought of saving the excel file in csv format and uploading to the
> site, where some sort of parser would collect the new info from it. The
> problem with that approach would be if the supplier changes a cel on some
> product name, then everything would be ruined.
> How is it usually done?
> 
> Big thanks, i am completely blind in this.
> 
> Pag
> 
> 


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



Re: [PHP] Enabling HTTP_REFERER

2003-03-10 Thread Stephen
But it works on other websites I've made, esspecially on my local server.

Thanks,
Stephen Craton
http://www.melchior.us


- Original Message -
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Stephen'" <[EMAIL PROTECTED]>; "'PHP List'"
<[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 8:16 PM
Subject: RE: [PHP] Enabling HTTP_REFERER


> For some reason my webhost doesn't allow the HTTP_REFERER variable. I
call
> it up and it's empty, so I did a print_r($HTTP_SERVER_VARS); and there
> wasn't a variable called HTTP_REFERER. I've heard that some servers
> disable it. Since I have a dedicated server, how can I enable this
> variable again?

HTTP_REFERER (is that the right spelling?) is set by the browser, not
the server. So if you're not seeing a value, then your browser is not
setting it. Or something is stripping it on the way out from your
computer.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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





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



[PHP] cURL & PHP compile error

2003-03-10 Thread Bryan Brannigan
Trying to setup PHP with cURL support... I run this configure command:

./configure --with-mysql --with-apxs --with-openssl=/usr/local/ssl
--with-curl --with-mcrypt --enable-sockets

and receive this error:

/usr/local/lib/libcurl.so: undefined reference to `UI_OpenSSL'

Help!!




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



RE: [PHP] quick question

2003-03-10 Thread John W. Holmes
> >>I'm sending credit card info to a 3rd party credit card processing
site.
> >>  I would like to keep the inputted values and, after the approval,
have
> >>them appear in the value part of the form so that they don't have to
> >>re-input the same values they had just put in for the credit card.
how
> >>can i do this?
> >>
> >
> > So put the value in the "value" attribute of your text box.
> >
> > 
> >
> > substitute $_POST['cc_number'] with whatever you send to the
processing
> > site.
>
> Right - but the problem is, the form is submitting to another site, so
i
> don't have a way to store the variables.   I could put them in session
> variables, but I would have to create another script and then forward
> the form submission to the outside side.  This isn't working because
the
>   outside site requires the variables to be submitted via a form, or
> POST i guess.  I don't even know if I'm going about this the right way
-
> I just need to somehow store variables on my site that are submitted
for
> processing to another site, so that when the user is sent back from
that
> other site, i can put the values in the form fields of a new page.

Well, if the site doesn't return the number back to you, then you can't
do it with the method you're using. You could use sockets or cURL to
POST the info yourself from within a script and then you'd still
maintain all of the $_POST information when you get the result back...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] How to set a timeout limit for a call of a connection?

2003-03-10 Thread Alex Shi
> > I have a script in which there is a call to open a remote file:
> > 
> > fopen ("http://www.somewhere.com/file.php?foo=bar";, "r");
> > 
> > Sometimes if www.somewhere.com is down, it will stuck at the function
> > for very long a time. I hope to setup a timeout limit for this
> function
> > (just
> > this), so that it won't stay very long to wait for a result, but just
> quit
> > if the
> > call take a time longer than timeout limit, and then go on for next
> steps.
> 
> You can't control the timeout with fopen(). Try looking at fsockopen().
> You can set a timeout for that.

Oh, yes, you are right! there is a parameter for timeout! 
Thanks a lot!

alex


> 
> ---John W. Holmes...
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
> 
> 

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



RE: [PHP] arrray

2003-03-10 Thread John W. Holmes
> you can 'serialize' it and pass it as POST or GET
> variable too, then deserialize it again.
> 
> Check out these PHP functions :
> 
> serialize() and deserialize()

 unserialize().

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] How to set a timeout limit for a call of a connection?

2003-03-10 Thread Alex Shi
> > I have a script in which there is a call to open a remote file:
> > 
> > fopen ("http://www.somewhere.com/file.php?foo=bar";, "r");
> > 
> > Sometimes if www.somewhere.com is down, it will stuck at the function
> > for very long a time. I hope to setup a timeout limit for this
> function
> > (just
> > this), so that it won't stay very long to wait for a result, but just
> quit
> > if the
> > call take a time longer than timeout limit, and then go on for next
> steps.
> 
> You can't control the timeout with fopen(). Try looking at fsockopen().
> You can set a timeout for that.

I checked the manual. From the example, it is apparently that timeout only 
works for the handle setup by fsockopen, but not for fsockopen itself.

Alex


> 
> ---John W. Holmes...
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
> 
> 

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



RE: [PHP] How to set a timeout limit for a call of a connection?

2003-03-10 Thread John W. Holmes
> I have a script in which there is a call to open a remote file:
> 
> fopen ("http://www.somewhere.com/file.php?foo=bar";, "r");
> 
> Sometimes if www.somewhere.com is down, it will stuck at the function
> for very long a time. I hope to setup a timeout limit for this
function
> (just
> this), so that it won't stay very long to wait for a result, but just
quit
> if the
> call take a time longer than timeout limit, and then go on for next
steps.

You can't control the timeout with fopen(). Try looking at fsockopen().
You can set a timeout for that.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] Enabling HTTP_REFERER

2003-03-10 Thread John W. Holmes
> For some reason my webhost doesn't allow the HTTP_REFERER variable. I
call
> it up and it's empty, so I did a print_r($HTTP_SERVER_VARS); and there
> wasn't a variable called HTTP_REFERER. I've heard that some servers
> disable it. Since I have a dedicated server, how can I enable this
> variable again?

HTTP_REFERER (is that the right spelling?) is set by the browser, not
the server. So if you're not seeing a value, then your browser is not
setting it. Or something is stripping it on the way out from your
computer.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] Enabling HTTP_REFERER

2003-03-10 Thread James
It will be something like Norton Firewalling -

Enabled, norton will disable the referer val.

jim.

"Stephen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've tried both. I think the server has 4.2.3.
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
>
>
> - Original Message -
> From: "Sebastian" <[EMAIL PROTECTED]>
> To: "Stephen" <[EMAIL PROTECTED]>; "PHP List"
> <[EMAIL PROTECTED]>
> Sent: Monday, March 10, 2003 8:02 PM
> Subject: Re: [PHP] Enabling HTTP_REFERER
>
>
> What php version?
> For older php version:
> $HTTP_SERVER_VARS['HTTP_REFERER'];
>
> Newer:
> $_SERVER['HTTP_REFERER'];
>
> Or you can usually do: echo $HTTP_REFERER;
>
> I don't think there is even a way of disabling it in the php.ini
>
> warm regards,
> Sebastian - [BBR] Gaming Clan
> http://www.broadbandreports.com
>
> - Original Message -
> From: "Stephen" <[EMAIL PROTECTED]>
> To: "PHP List" <[EMAIL PROTECTED]>
> Sent: Monday, March 10, 2003 7:45 PM
> Subject: [PHP] Enabling HTTP_REFERER
>
>
> For some reason my webhost doesn't allow the HTTP_REFERER variable. I call
> it up and it's empty, so I did a print_r($HTTP_SERVER_VARS); and there
> wasn't a variable called HTTP_REFERER. I've heard that some servers
disable
> it. Since I have a dedicated server, how can I enable this variable again?
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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



[PHP] How to set a timeout limit for a call of a connection?

2003-03-10 Thread Alex Shi
Hi,

I have a script in which there is a call to open a remote file:

fopen ("http://www.somewhere.com/file.php?foo=bar";, "r");

Sometimes if www.somewhere.com is down, it will stuck at the function
for very long a time. I hope to setup a timeout limit for this function
(just
this), so that it won't stay very long to wait for a result, but just quit
if the
call take a time longer than timeout limit, and then go on for next steps.

Thanks in advance!

Alex Shi


--
==
Cell Phone Batteries at 30-50%+ off retail prices!
http://www.pocellular.com
==
TrafficBuilder Network:
http://www.bestadv.net/index.cfm?ref=7029
==


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



Re: [PHP] Enabling HTTP_REFERER

2003-03-10 Thread Stephen
I've tried both. I think the server has 4.2.3.

Thanks,
Stephen Craton
http://www.melchior.us


- Original Message -
From: "Sebastian" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>; "PHP List"
<[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 8:02 PM
Subject: Re: [PHP] Enabling HTTP_REFERER


What php version?
For older php version:
$HTTP_SERVER_VARS['HTTP_REFERER'];

Newer:
$_SERVER['HTTP_REFERER'];

Or you can usually do: echo $HTTP_REFERER;

I don't think there is even a way of disabling it in the php.ini

warm regards,
Sebastian - [BBR] Gaming Clan
http://www.broadbandreports.com

- Original Message -
From: "Stephen" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 7:45 PM
Subject: [PHP] Enabling HTTP_REFERER


For some reason my webhost doesn't allow the HTTP_REFERER variable. I call
it up and it's empty, so I did a print_r($HTTP_SERVER_VARS); and there
wasn't a variable called HTTP_REFERER. I've heard that some servers disable
it. Since I have a dedicated server, how can I enable this variable again?

Thanks,
Stephen Craton
http://www.melchior.us




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




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



[PHP] Removing a Blank line from a text file

2003-03-10 Thread Richard Kurth

This function removes a line from a text file list. It has one problem if
it removes a line from the beginning or middle of the text file list
it leaves a blank line. How can I make it remove the blank line also?

function remove_email($email){
global $members,$datadir,$email;
$recordsarray = file($members);
$temp = array();
for ($i=0;$imailto:[EMAIL PROTECTED]


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



Re: [PHP] Enabling HTTP_REFERER

2003-03-10 Thread Sebastian
What php version?
For older php version:
$HTTP_SERVER_VARS['HTTP_REFERER'];

Newer:
$_SERVER['HTTP_REFERER'];

Or you can usually do: echo $HTTP_REFERER;

I don't think there is even a way of disabling it in the php.ini

warm regards,
Sebastian - [BBR] Gaming Clan
http://www.broadbandreports.com

- Original Message -
From: "Stephen" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 7:45 PM
Subject: [PHP] Enabling HTTP_REFERER


For some reason my webhost doesn't allow the HTTP_REFERER variable. I call
it up and it's empty, so I did a print_r($HTTP_SERVER_VARS); and there
wasn't a variable called HTTP_REFERER. I've heard that some servers disable
it. Since I have a dedicated server, how can I enable this variable again?

Thanks,
Stephen Craton
http://www.melchior.us




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



[PHP] Enabling HTTP_REFERER

2003-03-10 Thread Stephen
For some reason my webhost doesn't allow the HTTP_REFERER variable. I call it up and 
it's empty, so I did a print_r($HTTP_SERVER_VARS); and there wasn't a variable called 
HTTP_REFERER. I've heard that some servers disable it. Since I have a dedicated 
server, how can I enable this variable again?

Thanks,
Stephen Craton
http://www.melchior.us



RE: [PHP] PHP Online Store

2003-03-10 Thread Michael Roger C. Bianan


Hi Pag,

In my experience, I usually have two database systems.
I have the Live DB which is currently the one used 
by the website which is the one on the hosting server, 
and I also have a local DB on our local server just here.

What I do is I create the back-end applications for the
administration of records, like add, edit, and delete.

The idea is that for a certain time of day or perhaps
weekly, it depends on your need... these two databases
should be synchronized...  meaning their records be
reconciled... Most often in my case it's a one-way 
direction.  

Records from your local database will be sent to the
live server either for addition or just updating some
fields... As a hint: you can just add a field if 
you'll either ADD or just EDIT a record in the live
database... or you can issue a SELECT query and then
if it exists.. you can either interpret it as a
condition for ADD, else, EDIT..  It depends on your
system.

On doing the syncs, you can create just a PHP script
to send data (i.e. CSV) to the server.. you can
use fopen("http://www";) or perhaps just use the
POST and GET Methods.  The recieving script on your
live server will parse and do the necessary actions
for your data.

Furthermore, you could add your PHP script to your
CRON (*nix systems) if you want to create a schedule
for your sync times.  (say 12:00 Midnight when no 
one is around in your office) :)  Or you can do
another workaround in your OS. Otherwise, just
run the script manually. ;)  Watch out for expiration
limits too...  as you may have large data to send. :)


Hope this helps,

Miches


-Original Message-
From: Pag [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 2:51 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Online Store



Hi,

I have to write a PHP/MySQL online store with product catalogs, prices,
descriptions, and ordering (no payment) etc, but i have a big doubt when it
comes to updating.
How is it usually done? I mean, i never did a project like this, with a
big amount of products to update. Whats the easiest way of updating the
prices like say, every week? The suppliers send a list of the new prices to
the store, and the store has to update the prices online manually, one by one?
Also i thought of saving the excel file in csv format and uploading to the
site, where some sort of parser would collect the new info from it. The
problem with that approach would be if the supplier changes a cel on some
product name, then everything would be ruined.
How is it usually done?

Big thanks, i am completely blind in this.

Pag



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


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



RE: [PHP] Automatically Save Image?

2003-03-10 Thread Michael Roger C. Bianan
Hi,

You can read the file via fopen() and fread(),
and then pass the resulting data to the client browser...



Thanks,

Miches;)

-Original Message-
From: Boaz Yahav [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 2:44 PM
To: Doug Coning; [EMAIL PROTECTED]
Subject: RE: [PHP] Automatically Save Image?


How to let a user download a picture by clicking on it instead of
needing to right click and Save-As.
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1562

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Doug Coning [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 05, 2003 1:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Automatically Save Image?


Hi,

I'm developing a flash site that uses PHP and MySQL to pull in images.
My client would like to have a button in flash underneath the images he
has shown that would enable the viewer to download the images to their
own harddrive.

I know I could set it up to open the picture in a new window and have
the viewer 'right' click on it and select Save.  But is there anyway to
automate this so that Flash would open the URL that would automatically
open the "Save Picture" window for saving to the person's harddrive?

Thanks,

Doug Coning




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


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


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



[PHP] .htaccess Help

2003-03-10 Thread Pushpinder Singh Garcha
Hello All

I need to allow users to be able to access ONLY non-html files in a 
Secret Dir.
Can anyone suggest a .htaccess method to do just that.

I have a .htaccess script which will prevent anybody from viewing the 
contents of a Dir via http, but this time , I need to allow users to 
view the PHP Files

TIA

Pushpinder Singh Garcha
_
Web Architect


[PHP] PHP Online Store

2003-03-10 Thread Pag
	Hi,

I have to write a PHP/MySQL online store with product catalogs, prices,
descriptions, and ordering (no payment) etc, but i have a big doubt when it
comes to updating.
How is it usually done? I mean, i never did a project like this, with a
big amount of products to update. Whats the easiest way of updating the
prices like say, every week? The suppliers send a list of the new prices to
the store, and the store has to update the prices online manually, one by one?
Also i thought of saving the excel file in csv format and uploading to the
site, where some sort of parser would collect the new info from it. The
problem with that approach would be if the supplier changes a cel on some
product name, then everything would be ruined.
How is it usually done?
	Big thanks, i am completely blind in this.

	Pag



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


RE: [PHP] Automatically Save Image?

2003-03-10 Thread Boaz Yahav
How to let a user download a picture by clicking on it instead of
needing to right click and Save-As.
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1562

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Doug Coning [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 05, 2003 1:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Automatically Save Image?


Hi,

I'm developing a flash site that uses PHP and MySQL to pull in images.
My client would like to have a button in flash underneath the images he
has shown that would enable the viewer to download the images to their
own harddrive.

I know I could set it up to open the picture in a new window and have
the viewer 'right' click on it and select Save.  But is there anyway to
automate this so that Flash would open the URL that would automatically
open the "Save Picture" window for saving to the person's harddrive?

Thanks,

Doug Coning




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


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



RE: [PHP] Help Needed

2003-03-10 Thread Michael Roger C. Bianan
I agree with the security on files especially on case 
of downloadable files.

I suggest you use absolute paths for retrieving your files.

say ( http://www.a.com/pathofyourfile/ or 
simply the platform /home/user/htdocs/files/pathtoyourfile/)

Also, it's neat to have sorta config file on your scripts
to maintain the directory paths.

But oops, I maybe over acting here:)))

Yet, I'm sorry I'm not familiar with the MacOS Jag Platform,
but perhaps PNG files aren't compatible on that machine.

Thanks,

Miches

-Original Message-
From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 2:13 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Help Needed


Thanks for the prompt reply Michael

I am trying to protect files on the site, my script checks for a valid 
session ID and fopens() a File. This file is located in a different Dir 
from the php script. When the file is a simple html file , I can easily 
fopen() the file  (Even though it contains gifs)

The real problem arises is when this html file has been exported from 
Fireworks (I.E. ".png" file ) The resulting file shows many missing 
links wihen  I try to fread() the html file. Although the file is 
displayed fine when I point my Browser (Mozilla)
to it. I am testing on the MAC OS Jaguar Platform


Thanks again
--pS

On Tuesday, March 11, 2003, at 09:12 AM, Michael Roger C. Bianan wrote:

> Garcha,
>
> Kindly check your file paths.  When you export it, it may not point
> to what really is the real path online.
>
> May I ask what are you trying to achieve?
>
> -Original Message-
> From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 10, 2003 1:45 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Help Needed
>
>
> Hey All
>
>
> My Php App is trying to fopen() and fread() a File that is located in
> the Web Server. This works if the file is a simple html file. However
> the complicated  part is that the file is not displayed correctly i.e.
> it has missing gifs if, it was created using Fireworks and then
> subsequently exported as a html.
>
> Any help will be highly appreciated
> TIA
>
> Pushpinder Singh Garcha
> _
> Web Architect
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Pushpinder Singh Garcha
_
Web Architect



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



Re: [PHP] auto_increment $value

2003-03-10 Thread John Taylor-Johnston
Sounds better. Thanks

Jimmy Brake wrote:

> hmm
>
>
> i could be misunderstanding but
>
> select max(your_autoincrment_column) from your_table

--
John Taylor-Johnston
-
"If it's not open-source, it's Murphy's Law."

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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



Re: [PHP] Help Needed

2003-03-10 Thread Pushpinder Singh Garcha
Thanks for the prompt reply Michael

I am trying to protect files on the site, my script checks for a valid 
session ID and fopens() a File. This file is located in a different Dir 
from the php script. When the file is a simple html file , I can easily 
fopen() the file  (Even though it contains gifs)

The real problem arises is when this html file has been exported from 
Fireworks (I.E. ".png" file ) The resulting file shows many missing 
links wihen  I try to fread() the html file. Although the file is 
displayed fine when I point my Browser (Mozilla)
to it. I am testing on the MAC OS Jaguar Platform

Thanks again
--pS
On Tuesday, March 11, 2003, at 09:12 AM, Michael Roger C. Bianan wrote:

Garcha,

Kindly check your file paths.  When you export it, it may not point
to what really is the real path online.
May I ask what are you trying to achieve?

-Original Message-
From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 1:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Help Needed
Hey All

My Php App is trying to fopen() and fread() a File that is located in
the Web Server. This works if the file is a simple html file. However
the complicated  part is that the file is not displayed correctly i.e.
it has missing gifs if, it was created using Fireworks and then
subsequently exported as a html.
Any help will be highly appreciated
TIA
Pushpinder Singh Garcha
_
Web Architect
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Pushpinder Singh Garcha
_
Web Architect


Re: [PHP] header function

2003-03-10 Thread Barry Gould
AHA!

Thank you!

Barry

At 01:38 PM 3/10/2003, you wrote:
Use INCLUDE(), not virtual(). virtual() isn't supposed to be used with PHP
files.
---John Holmes...

- Original Message -
From: "Barry Gould" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 4:26 PM
Subject: Re: [PHP] header function
> I'm starting to think this is a BUG.
>
> Can anyone else test this and confirm or contradict?
>
> Thanks,
> Barry
>
> At 03:35 PM 3/7/2003, you wrote:
> >I am having a hard time with the header("Location:") function inside an
> >include file with PHP 4.3.1 (Linux, running as a module w/ Apache
1.3.27).
> >
> >At the VERY TOP of my php page, I have:
> >
> >
> >logincheck.php contains exactly:
> > >// login check
> >if(!isset($_SESSION["agent_id"]))
> >{
> > header("Location:/");
> > header("Connection: close");
> > exit;
> >}
> >?>
> >
> >However, if this "agent_id" is not set, I just get a blank page with html
> >open and close tags.
> >
> >I'm SURE there are no spaces or blank lines before these lines.
> >
> >It works fine if I put the code in the main page instead of using the
> >virtual include.
> >
> >Output buffering is set to 4096 in php.ini.
> >
> >Any suggestions would be appreciated.
> >
> >Thanks,
> >Barry
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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


RE: [PHP] arrray

2003-03-10 Thread Michael Roger C. Bianan
you can 'serialize' it and pass it as POST or GET
variable too, then deserialize it again. 

Check out these PHP functions :

serialize() and deserialize()

Hope this helps,

Miches:)

-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 9:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] arrray


Is the only way to keep an array alive between one class and another to
store it as a session array?



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


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



RE: [PHP] auto_increment $value

2003-03-10 Thread Michael Roger C. Bianan
I think this is facing a bigger issue when it comes to 
Concurrency. When two or more apps in a given time pops
the auto_increment or mysql_insert_id (they will get 
THE SAME ID assuming no other transaction issued an 
INSERT sql to the table while retrieving the ID).

Now, I don't know if this has a major effect on your
applications but when your programs get bigger and
larger... basing algos on things like this just won't 
work.   

Just be very careful though.

Thanks,

Miches:)

-Original Message-
From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 1:41 PM
To: Eddie Lien
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] auto_increment $value


Necessary, or at least cleaner, if  there are less than 5 records in your database.


> Why don't you just use "select * from table order by id DESC limit 0,5"?
>
> I don't see any necessary to get the auto_increment value.
> > Anyone know how to get the auto_increment $value out of a mysql table.
> > I'm thinking it is in mysql_fetch_array but don't see how to get it.
> > > $SQL = "SELECT * FROM table ORDER BY id asc LIMIT $autoindex -5 ,5;";
> > > I would like to get the autoindex value of my table and use it in my
> SQL. Can I get the autoindex? :) How?


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


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



RE: [PHP] Help Needed

2003-03-10 Thread Michael Roger C. Bianan
Garcha,

Kindly check your file paths.  When you export it, it may not point
to what really is the real path online. 

May I ask what are you trying to achieve?

-Original Message-
From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 1:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Help Needed


Hey All


My Php App is trying to fopen() and fread() a File that is located in 
the Web Server. This works if the file is a simple html file. However 
the complicated  part is that the file is not displayed correctly i.e. 
it has missing gifs if, it was created using Fireworks and then 
subsequently exported as a html.

Any help will be highly appreciated
TIA

Pushpinder Singh Garcha
_
Web Architect


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



[PHP] Help Needed

2003-03-10 Thread Pushpinder Singh Garcha
Hey All

My Php App is trying to fopen() and fread() a File that is located in 
the Web Server. This works if the file is a simple html file. However 
the complicated  part is that the file is not displayed correctly i.e. 
it has missing gifs if, it was created using Fireworks and then 
subsequently exported as a html.

Any help will be highly appreciated
TIA
Pushpinder Singh Garcha
_
Web Architect


Re: [PHP] auto_increment $value

2003-03-10 Thread John Taylor-Johnston
Necessary, or at least cleaner, if  there are less than 5 records in your database.


> Why don't you just use "select * from table order by id DESC limit 0,5"?
>
> I don't see any necessary to get the auto_increment value.
> > Anyone know how to get the auto_increment $value out of a mysql table.
> > I'm thinking it is in mysql_fetch_array but don't see how to get it.
> > > $SQL = "SELECT * FROM table ORDER BY id asc LIMIT $autoindex -5 ,5;";
> > > I would like to get the autoindex value of my table and use it in my
> SQL. Can I get the autoindex? :) How?


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



Re: [PHP] header function

2003-03-10 Thread CPT John W. Holmes
Use INCLUDE(), not virtual(). virtual() isn't supposed to be used with PHP
files.

---John Holmes...

- Original Message -
From: "Barry Gould" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 4:26 PM
Subject: Re: [PHP] header function


> I'm starting to think this is a BUG.
>
> Can anyone else test this and confirm or contradict?
>
> Thanks,
> Barry
>
> At 03:35 PM 3/7/2003, you wrote:
> >I am having a hard time with the header("Location:") function inside an
> >include file with PHP 4.3.1 (Linux, running as a module w/ Apache
1.3.27).
> >
> >At the VERY TOP of my php page, I have:
> >
> >
> >logincheck.php contains exactly:
> > >// login check
> >if(!isset($_SESSION["agent_id"]))
> >{
> > header("Location:/");
> > header("Connection: close");
> > exit;
> >}
> >?>
> >
> >However, if this "agent_id" is not set, I just get a blank page with html
> >open and close tags.
> >
> >I'm SURE there are no spaces or blank lines before these lines.
> >
> >It works fine if I put the code in the main page instead of using the
> >virtual include.
> >
> >Output buffering is set to 4096 in php.ini.
> >
> >Any suggestions would be appreciated.
> >
> >Thanks,
> >Barry
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



Re: [PHP] header function

2003-03-10 Thread Barry Gould
I'm starting to think this is a BUG.

Can anyone else test this and confirm or contradict?

Thanks,
Barry
At 03:35 PM 3/7/2003, you wrote:
I am having a hard time with the header("Location:") function inside an 
include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27).

At the VERY TOP of my php page, I have:

logincheck.php contains exactly:

However, if this "agent_id" is not set, I just get a blank page with html 
open and close tags.

I'm SURE there are no spaces or blank lines before these lines.

It works fine if I put the code in the main page instead of using the 
virtual include.

Output buffering is set to 4096 in php.ini.

Any suggestions would be appreciated.

Thanks,
Barry


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


[PHP] Redirect...

2003-03-10 Thread Doug Coning
Hi all,

I'm running the below code to download a text file.  After the save as
window comes up, I can correctly save the document.  However, the browser
goes to a "Action Cancelled" error page.

Here's my code:



Am I suppose to redirect the page after it saves the file, and if so how
would I do that?

Thanks,

Doug Coning




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



Re: [PHP] header function

2003-03-10 Thread Barry Gould
I have session auto start on.

Plus, like I said, it works fine if it's at the top of the page, not in the 
include file.

Thanks,
Barry
At 05:19 PM 3/7/2003, Jim Lucas wrote:
if you put this at the very to of the page, I am guessing
then that you haven't ran session_start()  ??
if you are trying to access a value stored in a session variable, you need
to initialize the session first, then access the variable.
Jim
- Original Message -
From: "Barry Gould" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 3:35 PM
Subject: [PHP] header function
> I am having a hard time with the header("Location:") function inside an
> include file with PHP 4.3.1 (Linux, running as a module w/ Apache 1.3.27).
>
> At the VERY TOP of my php page, I have:
> 
>
> logincheck.php contains exactly:
>  // login check
> if(!isset($_SESSION["agent_id"]))
> {
> header("Location:/");
> header("Connection: close");
> exit;
> }
> ?>
>
> However, if this "agent_id" is not set, I just get a blank page with html
> open and close tags.
>
> I'm SURE there are no spaces or blank lines before these lines.
>
> It works fine if I put the code in the main page instead of using the
> virtual include.
>
> Output buffering is set to 4096 in php.ini.
>
> Any suggestions would be appreciated.
>
> Thanks,
> Barry
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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


Re: [PHP] ob_start -- output buffer problem

2003-03-10 Thread Ernest E Vogelsinger
At 11:22 09.03.2003, Alex Lance said:
[snip]
>here's my example:
>
>
>$x = new test();
>
>echo "hey";
>
>// IF next line is uncommented so it manually flushes
>// then the finish method WILL get called. But I need
>// get around calling anything at the *end* of a script.
>
>//ob_end_flush();
>
>
>class test {
> ...etc
[snip] 

This won't work anyway since your class test is declared after using it -
it should be the other way 'round:

class test {}
$x = new test();


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



Re: [PHP] ob_start -- output buffer problem

2003-03-10 Thread Jim Lucas
because the flush happens after everything is done, including the fputs
thingy.

you have to call ob_get_contents() or something like that.

I always to this

ob_start();

do something

$data = ob_get_contents();
ob_end_clean();

then I work with the $data later.

but if you don't use the ob_get_contents(); or ob_end_clean();  then PHP
waits until everything is done, and then flushes.

Jim
- Original Message -
From: "Alex Lance" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 09, 2003 2:22 AM
Subject: [PHP] ob_start -- output buffer problem


>
> Hi all,
>
> to quote from http://www.php.net/manual/en/function.ob-start.php
>
> > void ob_start ( [string output_callback])
> >
> > An optional output_callback function may be specified. This function
> > takes a string as a parameter and should return a string. The function
> > will be called when  ob_end_flush() is called, or when the output
> > buffer is flushed to the browser at the end of the request.
>
> My callback function does not get called unless I manually call
> ob_end_flush().
>
> I'm not interested in calling ob_end_flush() at all,  I want my callback
> function to be called "when the output buffer is flushed to the browser
> at the end of the request" so the question is why isn't this happening?
>
> here's my example:
>
> 
> $x = new test();
>
> echo "hey";
>
> // IF next line is uncommented so it manually flushes
> // then the finish method WILL get called. But I need
> // get around calling anything at the *end* of a script.
>
> //ob_end_flush();
>
>
> class test {
>
> var $msg_file = "cooked_html/error_log2";
>
> function test() {
> ob_start(array(&$this, "finish"));
> $this->msg("got to initialize");
> }
>
> function finish($page) {
> $this->msg("GOT TO FINISH!!!");
> return $page;
> }
>
> function msg ($msg) {
> $msg = "\n" . exec("date") ." ::: ". $msg;
> $fp = fopen($this->msg_file, "a") or die ("cannot open
".$this->msg_file);
> fputs ($fp, $msg, strlen($msg)) or die ("cannot write to
".$this->msg_file);
> fclose($fp);
> }
>
> }
>
> ?>
>
>
> But if ob_end_flush() IS called then the error log WILL have the "GOT TO
> FINISH" message.
>
> Any ideas on why the output is not being flushed automatically?
> thanks
> Alex
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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



[PHP] php.ini - PHP version 4.3.1 - CGI Error....

2003-03-10 Thread Scott Fletcher
I'm a little baffled and I'm wondering if anyone here can help me out on
this one...  I just upgraded the PHP from 4.0.6 to 4.3.1, yes I know the
upgrade is long overdue  Anyway, I just upgraded and update the php
scripts to work with newer versions but here is on part that I have not
figured out why is that.  By the way, I'm using IIS 5.0  The error message I
got are 

--clip--
CGI Error

The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
--clip--

Can anyone help me out?
 Thanks
  Scott Fletcher



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



Re: [PHP] html mail

2003-03-10 Thread Frank Keessen
Hi,

I found this one and it's quite handy;

http://phpmailer.sourceforge.net/

Regards,

Frank
- Original Message -
From: "Ian A. Gray" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 2:47 PM
Subject: [PHP] html mail


> Hi,
> I am quite new to php and I am trying to find a way of
> sending details of a web form over e-mail in both text
> and html format.  There are numerous sites on the web
> that try and explain how to do this but they are
> worded very complicated and to be honest I haven't
> found one that is particularly good.
>
> I want to send an e-mail that contains html code, with
> the option of attatching images and other files as
> well as a text version of the email so that the viewer
> can read the same e-mail whether or not he can view
> html email or not.
>
> Any ideas?
>
> Ian Gray.
>
> =
>
> -
> Ian A. Gray
> Manchester, UK
> Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44
(0) 7900 996 328
> US Fax no.:  707-885-3582
> E-mail: [EMAIL PROTECTED] - Websites: www.baritone.uk.com
(performance) & www.vocalstudio.co.uk (Tuition)
> -
>
>
> __
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



RE: [PHP] Re: sessions terminating randomly please help

2003-03-10 Thread Dennis Cole
Assuming that php is configued to rewrite the url tags, try turning off
cokkies in the browser and let the Session if carry over. This might help
you debugg it.

-Original Message-
From: David Chamberlin [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 3:41 PM
To: [EMAIL PROTECTED]; Freaky Deaky
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: sessions terminating randomly please help
Importance: Low


It's possible you're being afflicted with the same problem I am.  See
the message just one or two above this about "Sessions problem".  What I
found in my debugging is that it had to do with how I was
mix-and-matching the way I specified links.

Short version of the problem is that http://mysite.org/ has one session
and http://www.mysite.org/ has another.  In my code, I sometimes have
the links as  and sometimes it's explicit, as http://www.mysite.org/";>.  So if a user went to the site as
http://mysite.org - the pages that used the explicit www.mysite.org
would fail.

So if there's anything in your pages/links that may change how the link
is referred, you may be have different sessions occuring.

I would imagine it should be pretty easy for you to debug whether or not
this is the problem.  Have each of your pages echo out the current
session id (echo 'session is '.session_id().'';) and see if it
changes at any point, and especially on the pages that fail.

-Dave

Freaky Deaky wrote:
> hi
>
> i am experiencing a major problem with sessions expiring randomly in some
of my
> apps. i will log in and start clicking around and then i will eventually
> arrive at a page that tells me that i'm not logged in anymore. this
happens
> apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for
pc,
> and mozilla
>
> the apps are hosted on
>
> freebsd 4.7-release p2
> apache 1.3.27
> php version 4.2.3
> compiled with --enable-trans-sid
>
> i can't go into production if there's the possibility that users will be
> randomly logged off. i went through all of my code over the weekend, and i
> don't think i can attribute this to a miscoding:
>
> when a user logs in, i create a session with
>
> session_start();
> $valid_user=$_POST['username'];
> session_register("valid_user");
>
> i have the following code at the top of each page to check to see if the
session
> is valid:
>
> session_start();
> $valid_user=$_SESSION['valid_user'];
> global $valid_user;
> if (session_is_registered("valid_user")
> {...function to spit out an error message if the session is not valid...;}
>
> i have a logout page that destroys the session
>
> session_start();
> session_destroy();
>
> i also have a javascript timer in the header of every page that redirects
to the
> logout page if the user has been inactive for 20 minutes.
>
> i have played around with session.gc_probability, setting it to 100, but
that
> doesn't seem to have fixed the problem.
>
> this is a huge problem.
> if anyone can give some advice, i'd really appreciate it.
>
> thanks
>


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


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



RE: [PHP] sessions terminating randomly please help

2003-03-10 Thread Dennis Cole
Make sure that the url is always the same. For example if a user is at a
page http://mysite.com/phpscript.php and you link to
http://www.mysite.com/phpscript.php (notice the www) the session might not
follow because the url is different.

-Original Message-
From: freaky deaky [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 3:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] sessions terminating randomly please help
Importance: Low


hi

i am experiencing a major problem with sessions expiring randomly in some of
my
apps. i will log in and start clicking around and then i will eventually
arrive at a page that tells me that i'm not logged in anymore. this happens
apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc,
and mozilla

the apps are hosted on

freebsd 4.7-release p2
apache 1.3.27
php version 4.2.3
compiled with --enable-trans-sid

i can't go into production if there's the possibility that users will be
randomly logged off. i went through all of my code over the weekend, and i
don't think i can attribute this to a miscoding:

when a user logs in, i create a session with

session_start();
$valid_user=$_POST['username'];
session_register("valid_user");

i have the following code at the top of each page to check to see if the
session
is valid:

session_start();
$valid_user=$_SESSION['valid_user'];
global $valid_user;
if (session_is_registered("valid_user")
{...function to spit out an error message if the session is not valid...;}

i have a logout page that destroys the session

session_start();
session_destroy();

i also have a javascript timer in the header of every page that redirects to
the
logout page if the user has been inactive for 20 minutes.

i have played around with session.gc_probability, setting it to 100, but
that
doesn't seem to have fixed the problem.

this is a huge problem.
if anyone can give some advice, i'd really appreciate it.

thanks

--
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

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



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



[PHP] Re: sessions terminating randomly please help

2003-03-10 Thread David Chamberlin
It's possible you're being afflicted with the same problem I am.  See 
the message just one or two above this about "Sessions problem".  What I 
found in my debugging is that it had to do with how I was 
mix-and-matching the way I specified links.

Short version of the problem is that http://mysite.org/ has one session 
and http://www.mysite.org/ has another.  In my code, I sometimes have 
the links as  and sometimes it's explicit, as http://www.mysite.org/";>.  So if a user went to the site as 
http://mysite.org - the pages that used the explicit www.mysite.org 
would fail.

So if there's anything in your pages/links that may change how the link 
is referred, you may be have different sessions occuring.

I would imagine it should be pretty easy for you to debug whether or not 
this is the problem.  Have each of your pages echo out the current 
session id (echo 'session is '.session_id().'';) and see if it 
changes at any point, and especially on the pages that fail.

-Dave

Freaky Deaky wrote:
hi 

i am experiencing a major problem with sessions expiring randomly in some of my 
apps. i will log in and start clicking around and then i will eventually 
arrive at a page that tells me that i'm not logged in anymore. this happens 
apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc, 
and mozilla 

the apps are hosted on 

freebsd 4.7-release p2 
apache 1.3.27 
php version 4.2.3 
compiled with --enable-trans-sid 

i can't go into production if there's the possibility that users will be 
randomly logged off. i went through all of my code over the weekend, and i 
don't think i can attribute this to a miscoding: 

when a user logs in, i create a session with 

session_start(); 
$valid_user=$_POST['username']; 
session_register("valid_user"); 

i have the following code at the top of each page to check to see if the session 
is valid: 

session_start(); 
$valid_user=$_SESSION['valid_user']; 
global $valid_user; 
if (session_is_registered("valid_user") 
{...function to spit out an error message if the session is not valid...;} 

i have a logout page that destroys the session 

session_start(); 
session_destroy(); 

i also have a javascript timer in the header of every page that redirects to the 
logout page if the user has been inactive for 20 minutes. 

i have played around with session.gc_probability, setting it to 100, but that 
doesn't seem to have fixed the problem. 

this is a huge problem. 
if anyone can give some advice, i'd really appreciate it. 

thanks



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


Re: [PHP] Question

2003-03-10 Thread Hugh Danaher
something like:
print "";
while ( statement )
{
$i++;
if ($i==1) print "";
print "";
your image code;
print "";
if ($i==4) 
{
print "";
unset($i);
}
}
if ($i==1) print "";
if ($i==2) print "";
if ($i==3) print "";
print "";

might work better.
hugh
- Original Message - 
From: "Clint Tredway" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 11:53 AM
Subject: [PHP] Question


> I have a display of images that every fourth image I want to start a new
> column. In ColdFusion I would use the MOD operator like this:
> 
> if query.recordcount MOD 4 eq 0
> 
> 
> /if
> 
> I am just having a brain lapse today, can someone help me do this same
> functionality in PHP?
> 
> Thanks!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



[PHP] Re: Sessions problem

2003-03-10 Thread Dan Phiffer
I believe there's a domain limitation inherent to the way cookies work
(assuming a cookies-based sessions setup), but there may be some way of
circumventing that (can't some ad banner companies track visitors from site
to site?). Seems like a multi-file search and replace should do the trick.
If you're using UltraEdit/BBEdit/Emacs you should be able to update your
links without too much effort.

HTH,
-Dan


"David Chamberlin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey all,
>
> Some of my users have reported a problem with my site and it's taken a
> while to debug it, but I think I've finally tracked it down.
>
> If they go to the site as:
>
> http://www.mysite.org/
>
> Then it works
>
> But if they go as:
>
> http://mysite.org/
>
> It doesn't.
>
> I believe it has to do with my use of session variables.  Apparently (I
> didn't know this, but it's obvious from the debugging) that there are
> different session ID's and thus different session variables for the two.
>And the problem is (due to sloppy programming on my part ... sigh
> ...) that sometimes I set up the links as  and
> sometimes I do the explicit http://www.mysite.org/">.  So
> when it goes to the link as www.mysite.org, it registers the variables,
> but then later when it tries to access and it's just mysite.org, the
> variables aren't set.  Lots of confusion ensues.
>
> Is there any way to unify this, or do I have to go through and fix all
> of the absolute links to be relative?
>
> Thanks,
> Dave
>



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



RE: [PHP] HTTP_REFERER security implications?

2003-03-10 Thread Don Read

On 10-Mar-2003 Tom Woody wrote:
> I am working on a simple authentication script, where the user submits a
> login and password, the credentials are checked and the user is
> redirected to another script.  The new script checks the HTTP_REFERER
> and if its the original script it continues, otherwise it stops with a
> message about being unauthorized.
> 
> What kind of security implications may I be backing myself into?  I want
> to try and stay away from cookies, and as small as this is I think
> Session management is a little overkill.  The average user isn't going
> to spend much more than 1 or 2 minutes on the site (not much for them to
> see or do).  I have seen this method used on other sites, but I prefer
> to check with the experts first.
> 

If they use a proxy that doesn't send HTTP_REFERER, It'll break things. 
My numbers say it happens about about 15% of the time:

mysql> select count(*) from hit where urlid=0;
+--+
| count(*) |
+--+
|83082 |
+--+
1 row in set (0.53 sec)

mysql> select count(*) from hit;
+--+
| count(*) |
+--+
|   541557 |
+--+
1 row in set (0.00 sec)


Since you don't want to use sessions, maybe 401 WWW-authenticate method
would work better for your application.

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



[PHP] sessions terminating randomly please help

2003-03-10 Thread freaky deaky
hi 

i am experiencing a major problem with sessions expiring randomly in some of my 
apps. i will log in and start clicking around and then i will eventually 
arrive at a page that tells me that i'm not logged in anymore. this happens 
apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc, 
and mozilla 

the apps are hosted on 

freebsd 4.7-release p2 
apache 1.3.27 
php version 4.2.3 
compiled with --enable-trans-sid 

i can't go into production if there's the possibility that users will be 
randomly logged off. i went through all of my code over the weekend, and i 
don't think i can attribute this to a miscoding: 

when a user logs in, i create a session with 

session_start(); 
$valid_user=$_POST['username']; 
session_register("valid_user"); 

i have the following code at the top of each page to check to see if the session 
is valid: 

session_start(); 
$valid_user=$_SESSION['valid_user']; 
global $valid_user; 
if (session_is_registered("valid_user") 
{...function to spit out an error message if the session is not valid...;} 

i have a logout page that destroys the session 

session_start(); 
session_destroy(); 

i also have a javascript timer in the header of every page that redirects to the 
logout page if the user has been inactive for 20 minutes. 

i have played around with session.gc_probability, setting it to 100, but that 
doesn't seem to have fixed the problem. 

this is a huge problem. 
if anyone can give some advice, i'd really appreciate it. 

thanks

-- 
__
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

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



Re: [PHP] Multi-select inputs and naming

2003-03-10 Thread CPT John W. Holmes
> To others on the list:  how do perl, jsp, asp, etc.
> handle the passing of multiple selects?  What is their equivalent of php's
> "var[]" syntax for handling form values?

>From what I've picked up, if there are multiple variables in the query
string / post data with the same name, the scripting language will
automatically make it into an array.

---John Holmes...


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



RE: [PHP] Re: Question

2003-03-10 Thread Clint Tredway
thanks, I knew it was simple.. just can't think today!

-Original Message-
From: Dan Phiffer [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 2:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Question


Perhaps something like:

\n";
}

?>

HTH,
-Dan

"Clint Tredway" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a display of images that every fourth image I want to start a new
> column. In ColdFusion I would use the MOD operator like this:
>
> if query.recordcount MOD 4 eq 0
> 
> 
> /if
>
> I am just having a brain lapse today, can someone help me do this same
> functionality in PHP?
>
> Thanks!



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

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



[PHP] Re: Question

2003-03-10 Thread Dan Phiffer
Perhaps something like:

\n";
}

?>

HTH,
-Dan

"Clint Tredway" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a display of images that every fourth image I want to start a new
> column. In ColdFusion I would use the MOD operator like this:
>
> if query.recordcount MOD 4 eq 0
> 
> 
> /if
>
> I am just having a brain lapse today, can someone help me do this same
> functionality in PHP?
>
> Thanks!



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



Re: [PHP] Question

2003-03-10 Thread Mark Heintz PHP Mailing Lists

if($recordcount % 4 == 0)
{
  echo '';
}

mh.

On Mon, 10 Mar 2003, Clint Tredway wrote:

> I have a display of images that every fourth image I want to start a new
> column. In ColdFusion I would use the MOD operator like this:
>
> if query.recordcount MOD 4 eq 0
>   
>   
> /if
>
> I am just having a brain lapse today, can someone help me do this same
> functionality in PHP?
>
> Thanks!


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



Re: [PHP] Multi-select inputs and naming

2003-03-10 Thread Mark Heintz PHP Mailing Lists
On Mon, 10 Mar 2003, Dan Phiffer wrote:

> I guess this question was coming from a "couldn't they have designed in a
> cleaner way?" perspective. Don't get me wrong, I think the way PHP does an
> outstanding job of handling these particular kinds of form submissions, I
> just figured there might be an alternative syntax.

That is a good question...  I've had the (privelege?) of working with php
almost exclusively for the past 3-4 years, to the point where I've rarely
had to deal with other web-targeted languages (something I'm in the
process of changing).  To others on the list:  how do perl, jsp, asp, etc.
handle the passing of multiple selects?  What is their equivalent of php's
"var[]" syntax for handling form values?

mh.


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



[PHP] Sessions problem

2003-03-10 Thread David Chamberlin
Hey all,

Some of my users have reported a problem with my site and it's taken a 
while to debug it, but I think I've finally tracked it down.

If they go to the site as:

http://www.mysite.org/

Then it works

But if they go as:

http://mysite.org/

It doesn't.

I believe it has to do with my use of session variables.  Apparently (I 
didn't know this, but it's obvious from the debugging) that there are 
different session ID's and thus different session variables for the two. 
  And the problem is (due to sloppy programming on my part ... sigh 
...) that sometimes I set up the links as  and 
sometimes I do the explicit http://www.mysite.org/">.  So 
when it goes to the link as www.mysite.org, it registers the variables, 
but then later when it tries to access and it's just mysite.org, the 
variables aren't set.  Lots of confusion ensues.

Is there any way to unify this, or do I have to go through and fix all 
of the absolute links to be relative?

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


[PHP] Question

2003-03-10 Thread Clint Tredway
I have a display of images that every fourth image I want to start a new
column. In ColdFusion I would use the MOD operator like this:

if query.recordcount MOD 4 eq 0


/if

I am just having a brain lapse today, can someone help me do this same
functionality in PHP?

Thanks!

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



Re: [PHP] A question of time...

2003-03-10 Thread Mark Heintz PHP Mailing Lists
On Mon, 10 Mar 2003, Robert Cummings wrote:

> All in all I spent 20 hours total for the client at a rate of $40 USD/hr
> which I believe is on the low end of freelance. I myself have 3 years
> experience devloping PHP web applications. So the question I ask is whther
> this time frame is reasonable, or am I just a slow crappy programmer that is
> ripping these people off? They seem to think I should have had this done in
> just a few hours, but my experience thus far indicates to me that they got
> just service. Additionally it seems before I took the job, they had went
> through several other PHP developers would said they couldn't do it (and I
> don't really blame them considering the VNC connection and lack of comments or
> error feedback).
>
> If it turns out that I am incompetent, then I will happily send them a
> bill for zero hours, otherwise I would like to take comfort that I am not
> ripping them off.

It sounds very fair to me.  My time would have been similar if not more
(esp. not knowing the state of the existing code), and my hourly rate
2-3 times yours.

mh.



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



Re: [PHP] A question of time...

2003-03-10 Thread CPT John W. Holmes
[snip]
> Thanks, I did estimate 20 to 30 hours for them after I had set up the
mirror
> server and before the actual work began. At the same time I asked if they
wanted
> me to stop to which they replied that I should continue.

Offer them some cheese with their whine and tell them to pay up!

---John Holmes...


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



Re: [PHP] Multi-select inputs and naming

2003-03-10 Thread Dan Phiffer
> Unless you're ashamed to be running php, or don't intend to be spending as
> much time on security as you should, why would this be an issue?  If your
> app is well-written, the knowledge that it's implemented with php
> shouldn't benefit a potential attacker.  You know what they say about
> security through obscurity...

Hehe, yeah I am being somewhat anal here. I was hoping that with
search-friendly URLS (i.e. /issues/2003/mar/ rather than
/issues.php?year=2003&month=mar), I could have the added security benefit of
obscuring the back-end technology. This is more from the theoretical than
practical line of thinking, so I'm not too worried.

While I agree that if the app is well-written it shouldn't matter, but I
figure it couldn't hurt as an added security net. I have another question
reguarding the security implications of "source readable" PHP projects, but
I'll save that for another thread.

> > I'm hoping there's some alternative technique I've missed...
>
> I guess you could use javascript to create/set individual hidden form
> fields for the items selected, but if the user has javascript disabled
> your form ceases to function.

I guess this question was coming from a "couldn't they have designed in a
cleaner way?" perspective. Don't get me wrong, I think the way PHP does an
outstanding job of handling these particular kinds of form submissions, I
just figured there might be an alternative syntax.

Thanks for the responses,
-Dan



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



Re: [PHP] A question of time...

2003-03-10 Thread Robert Cummings
"CPT John W. Holmes" wrote:
> 
> [snip]
> > If it turns out that I am incompetent, then I will happily send them a
> > bill for zero hours, otherwise I would like to take comfort that I am not
> > ripping them off.
> 
> Just my humble opinion, of course, but I think you did the job quickly
> considering what you were given to start with. $40/hour is pretty cheap,
> too.
> 
> No one likes paying and it always seems like a "little change" to those on
> the outside.
> 
> It would of been hard to nail down a contract given the circumstances, but
> that's what you should have done. Always get it in writing. If you agreed on
> $40/hour before hand without a "maximum" number of hours where you had to
> get back to them, then they have to pay.

Thanks, I did estimate 20 to 30 hours for them after I had set up the mirror
server and before the actual work began. At the same time I asked if they wanted
me to stop to which they replied that I should continue.

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] Re: HTTP_REFERER security implications?

2003-03-10 Thread Joseph Szobody
Tom,

This will completely break in AOL. An AOL user's referer changes all the time. 

Joseph

"Tom Woody" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I am working on a simple authentication script, where the user submits a
> login and password, the credentials are checked and the user is
> redirected to another script.  The new script checks the HTTP_REFERER
> and if its the original script it continues, otherwise it stops with a
> message about being unauthorized.
> 
> What kind of security implications may I be backing myself into?  I want
> to try and stay away from cookies, and as small as this is I think
> Session management is a little overkill.  The average user isn't going
> to spend much more than 1 or 2 minutes on the site (not much for them to
> see or do).  I have seen this method used on other sites, but I prefer
> to check with the experts first.
> 
> thanks,
> 
> -- 
> Tom


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



Re: [PHP] A question of time...

2003-03-10 Thread CPT John W. Holmes
[snip]
> If it turns out that I am incompetent, then I will happily send them a
> bill for zero hours, otherwise I would like to take comfort that I am not
> ripping them off.

Just my humble opinion, of course, but I think you did the job quickly
considering what you were given to start with. $40/hour is pretty cheap,
too.

No one likes paying and it always seems like a "little change" to those on
the outside.

It would of been hard to nail down a contract given the circumstances, but
that's what you should have done. Always get it in writing. If you agreed on
$40/hour before hand without a "maximum" number of hours where you had to
get back to them, then they have to pay.

---John Holmes...


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



Re: [PHP] quick question

2003-03-10 Thread Doug Parker
Right - but the problem is, the form is submitting to another site, so i 
don't have a way to store the variables.   I could put them in session 
variables, but I would have to create another script and then forward 
the form submission to the outside side.  This isn't working because the 
 outside site requires the variables to be submitted via a form, or 
POST i guess.  I don't even know if I'm going about this the right way - 
I just need to somehow store variables on my site that are submitted for 
processing to another site, so that when the user is sent back from that 
other site, i can put the values in the form fields of a new page.

Cpt John W. Holmes wrote:

I'm sending credit card info to a 3rd party credit card processing site.
 I would like to keep the inputted values and, after the approval, have
them appear in the value part of the form so that they don't have to
re-input the same values they had just put in for the credit card.  how
can i do this?
So put the value in the "value" attribute of your text box.



substitute $_POST['cc_number'] with whatever you send to the processing
site.
---John Holmes...




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


Re: [PHP] PHP static module on Apache 2.0 HPUX 11

2003-03-10 Thread Harring Figueiredo

 Rasmus,
 Thanks for the reply.

 Then, what am I doing wrong on the DSO installation ?

 Any docs I could get my hands on ?

 Thanks again.

Harring.


--- Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> >   (All the help on php.net about HP has does not address this issue. Also,
> > there is not docs on how to install PHP/APACHE2.0 as static.)
> 
> That's because we do not support a static build for Apache2.
> 
> -Rasmus
> 


=
"We should do smart things with stupid technology before we do stupid 
things with smart technology."
  --Bill Buxton, Alias Research


Harring Figueiredo

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



[PHP] A question of time...

2003-03-10 Thread Robert Cummings
Hi all,

I recently had a freelancing experience that has left me somewhat sour and
questioning myself. Unfortunately I don't feel I can fairly evaluate myself
and so I owuld like to put the question to my peers who populate the PHP
forum as to whether I have performed competently.

Last week I took upon myself the task of fixing a clients shopping cart
system by way of adding session support and proper user registration
validation. To give you some idea of the parameters of the job...

- VNC development connection
- live server with no error output
- no session support whatsoever
- cart had no input validation, except basic javascript
- user registration permitted clobbering of other users
  and had no validation either
- PHP code was ad-hoc sprinkled through the pages
- comments were almost non-existent

The first day I decided it would be best to mirror the server so that
development time would be minimized (VNC is terrible for devlopment). This was
done without charge to the client despite it's time saving effect.

The second day I spent 13 hours familiarizing myself with their code and
pages, and on this day I also implemented a session management library for
easily accessing and setting session data (this included hooks for permanent
cookie data storage). I also fixed the user registration process and add
security validation to ensure user information could not accidentally (or
deliberately via form hacking) be accessed by someone other than the
registrant. Previously re-registration of an existing email address regardless
of password would clobber existing customer. At this time I also fixed the
cart and ensured prepopulation of forms for updating registration information.

The third day I first wasted an hour making my changes work on their
server because they decided to rename all the files I had changed thus
breaking all of the include() paths. After that I spent another 3 hours adding
support for returning to previous page before entering any of the cart
checkout or customer registration pages. At this time a response page was also
added to thank the customer for their purchase. Of course all of this was
tested to be functional and where necessary broken pre-existing code was
replaced or fixed to provide the correct functionality.

On the fourth day I spent 3 hours adding support for input validation
feedback to the registration validation so that customer's would know exactly
why they could not continue. I also added support for a password reminder to
inform the user of their password when forgotten. This included adding the
page, adding the form, validating that the user id existed and outputting
appropriate feedback if the user did not exist - and of course testing.

All in all I spent 20 hours total for the client at a rate of $40 USD/hr
which I believe is on the low end of freelance. I myself have 3 years
experience devloping PHP web applications. So the question I ask is whther
this time frame is reasonable, or am I just a slow crappy programmer that is
ripping these people off? They seem to think I should have had this done in
just a few hours, but my experience thus far indicates to me that they got
just service. Additionally it seems before I took the job, they had went
through several other PHP developers would said they couldn't do it (and I
don't really blame them considering the VNC connection and lack of comments or
error feedback).

If it turns out that I am incompetent, then I will happily send them a
bill for zero hours, otherwise I would like to take comfort that I am not
ripping them off.

Sincerely,
Robert Cummings
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] image question

2003-03-10 Thread Hugh Danaher
Tony,
You might want to try the online php manual, I hear it's very good.
You should be able to do all of the tasks you desire.  Look for "image" in
your search.
Hope this helps.
Hugh
- Original Message -
From: "Anthony Ritter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 10:23 AM
Subject: [PHP] image question


> I'm looking for a php tutorial or script which can open and read an
existing
> .jpg or .png from another URL.
>
> Next, the script then modifies that image by - say - cropping off the
bottom
> by 20px or resizing it by 50%.
>
> Lastly, could this modified file then be renamed on ones server?
>
> Many thanks,
> Tony Ritter
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
Thanks for the reply Mark,

allow_url_fopen is set to on
i did not see anything about --disable-url-fopen-wrapper

Here is the info file:
http://www.afgaonline.com/phpinfo.php




"Mark Heintz Php Mailing Lists" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
It sounds like either allow_url_fopen is set to false or php was compiled
with --disable-url-fopen-wrapper.  Either way, checking the output of
phpinfo() should give you your answer.

mh.

On Mon, 10 Mar 2003, Chad Henderson wrote:

> Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
> did, are there changes to the new PHP that would prevent the script from
> working?  Or is it a matter of them not setting up the upgrade the same as
> the previous installation?
>
>
>
> "Ray Hunter" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> You should contact the web hosting system administrator and verify that
> they upgraded php.  From what i can tell it seems that they did upgrade
> php.
>
> --
> Ray
>
> On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
> > I have a number of websites that are on a hosting company, that I have
> been
> > using for a year or so. Suddenly, this morning, all of the websites
began
> to
> > have PHP script errors on scripts that have run without fail for a long
> > period of time. I think the server setup must have been altered this
> weekend
> > but do not know how to look for or prove this. Any ideas would be
greatly
> > appreciated.
> >
> > Here is the error you get when you try to load http://www.afgaonline.com
> >
> > --paste--
> >
> > Warning: file(http://www.afgaonline.com/templates/tem4.tem)
> [function.file]:
> > failed to create stream: HTTP request failed! ¿¯wT in
> > /home/afgaonli/public_html/includes/Template.php on line 15
> >
> >  --end paste --
> >
> > The text that follows failed! above always changes.
> >
> > Here is the code that is failing:
> >
> > 12function Template ($template)
> > 13 {
> > 14   $this->template = $template;
> > 15   $this->html = implode ("",(file($this->template)));
> > 16 }
> >
> > What should I look for?
> > thanks!
> >
> > Chad



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



Re: [PHP] PHP static module on Apache 2.0 HPUX 11

2003-03-10 Thread Rasmus Lerdorf
>   (All the help on php.net about HP has does not address this issue. Also,
> there is not docs on how to install PHP/APACHE2.0 as static.)

That's because we do not support a static build for Apache2.

-Rasmus


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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
I did not see the

"Mark Heintz Php Mailing Lists" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
It sounds like either allow_url_fopen is set to false or php was compiled
with --disable-url-fopen-wrapper.  Either way, checking the output of
phpinfo() should give you your answer.

mh.

On Mon, 10 Mar 2003, Chad Henderson wrote:

> Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
> did, are there changes to the new PHP that would prevent the script from
> working?  Or is it a matter of them not setting up the upgrade the same as
> the previous installation?
>
>
>
> "Ray Hunter" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> You should contact the web hosting system administrator and verify that
> they upgraded php.  From what i can tell it seems that they did upgrade
> php.
>
> --
> Ray
>
> On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
> > I have a number of websites that are on a hosting company, that I have
> been
> > using for a year or so. Suddenly, this morning, all of the websites
began
> to
> > have PHP script errors on scripts that have run without fail for a long
> > period of time. I think the server setup must have been altered this
> weekend
> > but do not know how to look for or prove this. Any ideas would be
greatly
> > appreciated.
> >
> > Here is the error you get when you try to load http://www.afgaonline.com
> >
> > --paste--
> >
> > Warning: file(http://www.afgaonline.com/templates/tem4.tem)
> [function.file]:
> > failed to create stream: HTTP request failed! ¿¯wT in
> > /home/afgaonli/public_html/includes/Template.php on line 15
> >
> >  --end paste --
> >
> > The text that follows failed! above always changes.
> >
> > Here is the code that is failing:
> >
> > 12function Template ($template)
> > 13 {
> > 14   $this->template = $template;
> > 15   $this->html = implode ("",(file($this->template)));
> > 16 }
> >
> > What should I look for?
> > thanks!
> >
> > Chad



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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Mark Heintz PHP Mailing Lists
It sounds like either allow_url_fopen is set to false or php was compiled
with --disable-url-fopen-wrapper.  Either way, checking the output of
phpinfo() should give you your answer.

mh.

On Mon, 10 Mar 2003, Chad Henderson wrote:

> Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
> did, are there changes to the new PHP that would prevent the script from
> working?  Or is it a matter of them not setting up the upgrade the same as
> the previous installation?
>
>
>
> "Ray Hunter" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> You should contact the web hosting system administrator and verify that
> they upgraded php.  From what i can tell it seems that they did upgrade
> php.
>
> --
> Ray
>
> On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
> > I have a number of websites that are on a hosting company, that I have
> been
> > using for a year or so. Suddenly, this morning, all of the websites began
> to
> > have PHP script errors on scripts that have run without fail for a long
> > period of time. I think the server setup must have been altered this
> weekend
> > but do not know how to look for or prove this. Any ideas would be greatly
> > appreciated.
> >
> > Here is the error you get when you try to load http://www.afgaonline.com
> >
> > --paste--
> >
> > Warning: file(http://www.afgaonline.com/templates/tem4.tem)
> [function.file]:
> > failed to create stream: HTTP request failed! ¿¯wT in
> > /home/afgaonli/public_html/includes/Template.php on line 15
> >
> >  --end paste --
> >
> > The text that follows failed! above always changes.
> >
> > Here is the code that is failing:
> >
> > 12function Template ($template)
> > 13 {
> > 14   $this->template = $template;
> > 15   $this->html = implode ("",(file($this->template)));
> > 16 }
> >
> > What should I look for?
> > thanks!
> >
> > Chad


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



Re: [PHP] delete from array

2003-03-10 Thread CPT John W. Holmes
> Not sure if there is a function that I missed when I did a search on this
> at php.net, but here is the situation:
>
> I have an array that looks something like this:
> 12:00:00
> 12:05:00
> 12:10:00
> 12:15:00
>
> Bascially, it just has all times in it for a day in 5 minute
> increments.  This is more of a template array for other things that I am
> doing.  How do I delete a specific time out of the array or how do I
delete
> a range of times out of the array?  I would like to be able to delete
> 12:05:00 but if I want, delete a range like 12:05:00 to 12:10:00.  I have
> other arrays that do NOT have numbers (times) in them and would like to be
> able to delete a specific item out of them too.

You can only delete elements from an array if you know the key of that
element. To delete it, you just use the unset() function.

unset($array['key']);

For your problem, though, I assume those are the "values" of the array,
right? You can either run a loop and go through every value of the array and
deleting it if it matches what you want, or use array_search() to find the
key of the value you're looking for and deleting it.

---John Holmes...


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



Re: [PHP] Is the problem a server setting?

2003-03-10 Thread Chad Henderson
Thanks for the reply. If they did upgrade PHP, which I am fairly sure they
did, are there changes to the new PHP that would prevent the script from
working?  Or is it a matter of them not setting up the upgrade the same as
the previous installation?



"Ray Hunter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
You should contact the web hosting system administrator and verify that
they upgraded php.  From what i can tell it seems that they did upgrade
php.

--
Ray

On Mon, 2003-03-10 at 10:58, Chad Henderson wrote:
> I have a number of websites that are on a hosting company, that I have
been
> using for a year or so. Suddenly, this morning, all of the websites began
to
> have PHP script errors on scripts that have run without fail for a long
> period of time. I think the server setup must have been altered this
weekend
> but do not know how to look for or prove this. Any ideas would be greatly
> appreciated.
>
> Here is the error you get when you try to load http://www.afgaonline.com
>
> --paste--
>
> Warning: file(http://www.afgaonline.com/templates/tem4.tem)
[function.file]:
> failed to create stream: HTTP request failed! ¿¯wT in
> /home/afgaonli/public_html/includes/Template.php on line 15
>
>  --end paste --
>
> The text that follows failed! above always changes.
>
> Here is the code that is failing:
>
> 12function Template ($template)
> 13 {
> 14   $this->template = $template;
> 15   $this->html = implode ("",(file($this->template)));
> 16 }
>
> What should I look for?
> thanks!
>
> Chad
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php





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



  1   2   >