[PHP] Multiple page form

2002-11-26 Thread Shane McBride
Hi there.

It's been a while since I have done any PHP work. I am creating an online
employment application using multiple forms for a client. I was going to use
PHP. I don't remember if I need to pass variables along with the form for
each page, or can I just call them on the last page.

The application form is very long. Any ideas? There may be a script that
exists already?

Anyway, it's nice to be back.

- Shane



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




RE: [PHP] Multiple page form

2002-11-26 Thread Shane McBride
So, you are using a database to store the records?

-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 10:45 AM
To: Shane McBride; [EMAIL PROTECTED]
Subject: Re: [PHP] Multiple page form


> It's been a while since I have done any PHP work. I am creating an online
> employment application using multiple forms for a client. I was going to
use
> PHP. I don't remember if I need to pass variables along with the form for
> each page, or can I just call them on the last page.
> The application form is very long. Any ideas? There may be a script that
> exists already?

What I usually do for my multi-page form is INSERT the data to a table on
the first page then UPDATE that record on subsequent pages.  The only
thing I need to pass on is the primary key value for the record.

Chris



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




[PHP] Parse out text

2002-12-13 Thread Shane McBride
I have a form that is submitting a Javascript to validate fields before the
form casn be submitted. The problem is that the field name has to be
prefixed with "required". So, if I have a field called email, it has to be
called requiredemail in order for the javascript to work.

How can I remove the "required" before the form is submitted? All I need is
a hint...

Thanks,
Shane



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




Re: [PHP] Session Errors, do you recognize?

2001-01-10 Thread Shane McBride

Make sure that the 
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 9:04 AM
Subject: [PHP] Session Errors, do you recognize?


Hey, I keep getting the same error messages when trying to fire up sessions
in this code i wrote. i've written some test scripts to test sessions on my
machine, and they are working, so the problem must lie within my code. Here'
what I'm getting, anyone know how to resolve this?

Warning: Cannot send session cookie - headers already sent by (output
started at C:\Program Files\Apache
Group\Apache\htdocs/store/index.php:2) in ../../wpdbcon.php on line 14

Warning: Cannot send session cache limiter - headers already sent (output
started at C:\Program Files\Apache
Group\Apache\htdocs/store/index.php:2) in ../../wpdbcon.php on line 14


wpdbcon.php --



i also tried doing

if (!session_is_registered('cart') {
$cart = array();
session_register('cart');
}
else {
session_start();
}

i thought it was sending conflicting data when it was trying to initialize,
didn't work either.

thanks in advance.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session Errors, do you recognize?

2001-01-10 Thread Shane McBride

One more thing after looking at the code. Try this:



- Original Message -
From: "JB" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 9:04 AM
Subject: [PHP] Session Errors, do you recognize?


Hey, I keep getting the same error messages when trying to fire up sessions
in this code i wrote. i've written some test scripts to test sessions on my
machine, and they are working, so the problem must lie within my code. Here'
what I'm getting, anyone know how to resolve this?

Warning: Cannot send session cookie - headers already sent by (output
started at C:\Program Files\Apache
Group\Apache\htdocs/store/index.php:2) in ../../wpdbcon.php on line 14

Warning: Cannot send session cache limiter - headers already sent (output
started at C:\Program Files\Apache
Group\Apache\htdocs/store/index.php:2) in ../../wpdbcon.php on line 14


wpdbcon.php --



i also tried doing

if (!session_is_registered('cart') {
$cart = array();
session_register('cart');
}
else {
session_start();
}

i thought it was sending conflicting data when it was trying to initialize,
didn't work either.

thanks in advance.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can I get a random number

2001-01-10 Thread Shane McBride

This is what I have used:

$token = md5(uniqid(rand()));


- Original Message - 
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Monday, January 10, 2000 5:13 PM
Subject: [PHP] How can I get a random number


> How can I get a random number
> 
> Thank you,
> 
> 
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
>  
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] pause

2001-01-10 Thread Shane McBride

If you find something other than client side validation, let me know please.
I had to resort to VBScript and I hate it!

- Original Message -
From: "jeremy brand" <[EMAIL PROTECTED]>
To: "DanO" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 4:42 PM
Subject: RE: [PHP] pause


> Funny, I would say forget javascript; I don't trust client side
> validation.
>
> :)  Just my two cents.
>
> Jeremy
>
> Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 ::
[EMAIL PROTECTED]
> http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more
> Get your own Free, Private email at http://www.smackdown.com/
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>""   -- Quoted from Yahoo! homepage, http://www.yahoo.com
>
>
> > don't forget javascript!
> >
> > you could validate the form before posting to php.
> >
> > DanO
> >
> >
> > -Original Message-
> > From: jeremy brand [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 10, 2001 1:18 PM
> > To: Robert Ludvik
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] pause
> >
> >
> > You could use custom HTML meta content refresh tags.  This is not a
> > PHP think, but an HTML thing.
> >
> > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 ::
[EMAIL PROTECTED]
> > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more
> > Get your own Free, Private email at http://www.smackdown.com/
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> >""   -- Quoted from Yahoo! homepage, http://www.yahoo.com
> >
> > On Wed, 10 Jan 2001, Robert Ludvik wrote:
> >
> > > Date: Wed, 10 Jan 2001 21:18:38 +0100
> > > From: Robert Ludvik <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] pause
> > >
> > > hi
> > > i know i've noticed somewhere something about how to implement a Pause
in
> > PHP -
> > > I mean, if ie.a user inputs a wrong number, the script says "Oh no,
it's
> > > wrong", waits a few seconds and redirects her back to input form. i
know i
> > could
> > > say to him "hit a Back button...", just wondering if something lika
Pause
> > > exists. i've searched php.net and zend.com but found nothing useful.
> > > thanks
> > > Bobe
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How do I store a pic?

2001-01-12 Thread Shane McBride

Kenneth,

I store the path to the image in the table. I am unsure if you can actually
write an image to a table.
When the item is deleted, I run an "exec" command to remove the actual file.

Here's some snippets:

The actual html to create the upload file text box within a :



This is the code for the page that is called using the form action. I added
a timestamp to the filename to avoid anyone accidentially overwriting a
file. (and hacking - you know a picture of a naked lady where a picture of a
garden rack is supposed to be):

// Creates the image file with a timestamp
$timestamp = time();
$image= $timestamp.$picture_name;
exec("mv $picture /path/to/your/directory/$image");

The "exec" command is what you really want to pay attenetion to. Also, this
example is assuming you are running Linux and MySQL. This is the delete
routine that removes the file and the record from the table:

   //Remove File from server
  $sol_1 = "SELECT * FROM featured WHERE image = '$sell_record'";
  $sol_result = myself_query($sol_1, $connection) or die ("SQL_RESULT");
  $row = myself_fetch_array($sol_result) or die ("Couldn't execute $sol_1");
  $image = $row["image"];
  exec("rm $picture /path/to/your/directory/'$image'");

Please note that you must use the actual path to the directory, not the
httpd path. I hope this helps you. Let me know.

Shane

- Original Message -
From: "Kenneth R Zink II" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, January 12, 2001 4:35 PM
Subject: [PHP] How do I store a pic?


> How do I store a jpg within a table?
>
> I want for a user to be able to pull a jpg from either their HD and store
it
> in a table with some other information for a classifieds section.  That
way
> when the ad is deleted, the picture goes with it instead of remaining on
my
> HD.
>
> Kenneth R Zink II [EMAIL PROTECTED]ICQ# 5095094
> '87 2.8L TBI GMC S-15 Ext. Cab (Hurricane) ...524 in the works !!!
> http://www.s-series.org/htm/windstorm/project-windstorm.htm
> '85 3.4L Carbed Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI DIS
!!!
> http://www.s-series.org/htm/firestorm/firestorm.htm
> Racing by the Grace of God!!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Search Engine submittal and PHP

2001-01-17 Thread Shane McBride

I have a site that uses PHP extensively. Each page has PHP, so of course each page 
ends in the .php extension.

Does anyone know if this affects the way a search engine crawls a site? I have several 
sites that are very successful, but this site does not even show up on the search 
engines. All design criteria and submission techniques were the same, except I used 
PHP on this particular site on every page.

Thanks for your help...
Shane



[PHP] Ethics question...

2001-01-17 Thread Shane McBride

I have spent a lot of time working on a specific E-Commerce (shopping-cart) to fill a 
need for a customer. Now that the project is complete, I would like to market the 
product, which is entirely PHP and MySQL.

My question is: Is it ethical to sell a product ( at a relatively low-cost) written in 
PHP, especially since this group made it possible?

If that's ok to do, does anyone have any ideas how I can put a time limit on a demo 
that isn't easily defeated?


TIA,
Shane



Re: [PHP] Ethics question...

2001-01-17 Thread Shane McBride

Wow, I caused quite a debate. And I thought I would get slammed :)

BTW - PHP / Apache is going to be up to the client at this point. :)

- Shane

- Original Message -
From: "Maxim Maletsky" <[EMAIL PROTECTED]>
To: "'jeremy brand'" <[EMAIL PROTECTED]>; "Kath" <[EMAIL PROTECTED]>
Cc: "'Rasmus Lerdorf'" <[EMAIL PROTECTED]>; "Shane McBride"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 10:03 PM
Subject: RE: [PHP] Ethics question...


> hey, hey ... I wrote "Microsoft" just to tell you how _big_ a customer
could
> be...
> a simple comparison... no politics here ... :-))
>
> Cheers,
> Maxim Maletsky
>
>
>
> -Original Message-----
> From: jeremy brand [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 18, 2001 12:02 PM
> To: Kath
> Cc: Maxim Maletsky; 'Rasmus Lerdorf'; Shane McBride;
> [EMAIL PROTECTED]
> Subject: Re: [PHP] Ethics question...
>
>
> > Soo true.
> >
> > But why would Microsoft be using PHP? =D
>
> Why would Microsoft be using Solaris, or Linux even?  (hint, the same
> reason -- their stuff works less good).
>
> :)
>
> Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 ::
[EMAIL PROTECTED]
> http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more
> Get your own Free, Private email at http://www.smackdown.com/
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>http://www.JEEP-FOR-SALE.com/ -- I need a buyer
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Help w/ quotes/html and data from MySQL

2001-01-23 Thread Shane McBride

I have a field in MySQL that holds data that may look like this:

Rose Painting"Looks really nice, blah, blah"25.00

Now, I want to pull that data back into a form  to edit. Here's how I have 
unsuccessfully been doing it:

?>
 beginning code
Description:

...ending code
?>

I looks like that the embedded html in the MySQL data is actually being "rendered" 
(for the lack of a better term).
How can I get the whole chunk of data back into the form?

TIA,
-Shane



Re: [PHP] Help w/ quotes/html and data from MySQL

2001-01-23 Thread Shane McBride

After I sent this message I looked at the code again. I saw the error as
obvious as daylight. It's working great now.

Thanks.


- Original Message -
From: "Steve Edberg" <[EMAIL PROTECTED]>
To: "Shane McBride" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 23, 2001 5:50 PM
Subject: Re: [PHP] Help w/ quotes/html and data from MySQL


> At 4:47 PM -0500 1/23/01, Shane McBride wrote:
> >I have a field in MySQL that holds data that may look like this:
> >
> >Rose Painting"Looks really nice, blah, blah"25.00
> >
> >Now, I want to pull that data back into a form  to edit.
> >Here's how I have unsuccessfully been doing it:
> >
> >?>
> > beginning code
> >Description:
> > >rows=\"5\">
> >...ending code
> >?>
> >
> >I looks like that the embedded html in the MySQL data is actually
> >being "rendered" (for the lack of a better term).
> >How can I get the whole chunk of data back into the form?
> >
>
>
> Well, if you're using PHP:
>
> echo
> 'Description:',
> '',
> htmlentities($description),
> ''
> ;
>
> Presumably, other web development languages have an equivalent
> construct to PHP's htmlentities().
>
> Also, the value of a textarea tag is not put in a 'value' attribute
> within the tag as with the INPUT tag; it is put in the textarea
> 'container' - that is, between the  and  tags.
>
> - steve
>
>
> --
> +--- "They've got a cherry pie there, that'll kill ya" --+
> | Steve Edberg   University of California, Davis |
> | [EMAIL PROTECTED]   Computer Consultant |
> | http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
> +-- FBI Special Agent Dale Cooper ---+
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Help: Google like page functions

2001-01-23 Thread Shane McBride

I thought this had been addressed earlier, but I could not find the thread.

If I have a MySQL DB that has 50 records in it and I want to display 5 per page. How 
do I do this. Also, 50 was just a nice round number, the number will change constantly.

All the search engines are doing this type of thing. I just can't seem to figure out 
what I should search for.

- Shane



Re: [PHP] Help: Google like page functions

2001-01-23 Thread Shane McBride

I found a great little snippet by accident that does the "Previous 123 Next"
links. If anyone is interested, here's the link to it:

http://www.phpbuilder.net/snippet/detail.php?type=snippet&id=21


- Original Message -
From: "Shane McBride" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 23, 2001 6:35 PM
Subject: [PHP] Help: Google like page functions


I thought this had been addressed earlier, but I could not find the thread.

If I have a MySQL DB that has 50 records in it and I want to display 5 per
page. How do I do this. Also, 50 was just a nice round number, the number
will change constantly.

All the search engines are doing this type of thing. I just can't seem to
figure out what I should search for.

- Shane



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] include_path in windows

2001-01-26 Thread Shane McBride

I am trying to get my php.ini file configured correctly.

I have a script that calls the require function/command( I'm not sure which it is..)

Here's what the .ini file is:
include_path=d:\sites;d:\sites\merchantpower\setup

According to the notation in the .ini file I have the correct syntax, but it never 
seems to look in the second path.

Can someone explain this to me better. Remember I'm dealing with Windows to do 
development.

I would think that the script would start to look in the d:\sites directory and then 
go to any sub directory from there...

TIA,
-Shane



[PHP] include_path again

2001-01-26 Thread Shane McBride

OK, I figured out that I had forgotten the quotes around the path(s), but I still 
don't understand the path itself. Will it look in sub directories.For example:

include_path=".;d:\sites"

Will PHP look in any subs under sites?


- Shane



[PHP] common.inc probs.

2001-01-26 Thread Shane McBride

I have a script that pulls in the following file via: require 'common.inc'

The problem occurs when it hits the $UNIX_PATH variable. At least I think that's where 
it creates a problem. If I comment it out it works fine, but I of course need that 
variable. 

First of all I created a script that creates this file and I don't understand why it 
doubled the backslashes in the $UNIX_PATH variable. Secondly, why it is crapping out 
on the double backslashes? I thought PHP would use the first one as an escape 
character.

As a side note: I know the example shown here shows a windows path for the unix path 
variable, I'm trying to port this over to winders..  :-0

http://localhost/mp/images/$image";
$DOC_ROOT="mp";
$ADMINROOT="admin";
?>

TIA-

-Shane




[PHP] Use of exec() in windows

2001-01-26 Thread Shane McBride

All,

I'm trying to port a wonderful application over to miserable windows. I can not find 
documentation of how to invoke exec on windows. Here's what I tried:

// Creates the image file with a timestamp
$timestamp = time();
$image= $timestamp.$picture_name;
if ($PLATFORM == "windows") {
$new_path = str_replace('^', '\\', $WINDOWS_PATH);
exec("copy c:\temp\$picture $new_path.$image");
echo $new_path.$image;
} else {
exec("mv $picture 
/services/webpages/t/h/thebackcarecenter.com/public/RDI_Shop/images/$image"); 
}

The previous step uploads the file. It does get to the temp directory, but never 
copies to the permanent directory. All the varaibles are defined. I think it lies in 
how I'm trying to execute a command.








Re: [PHP] Help Please, MySQL is driving me insane

2001-01-26 Thread Shane McBride

Have you started the server? If not go to the command prompt and:
1. cd c:\mysql\bin (assuming this is where it was installed.
2. type mqsqld-opt (optimized for pentium class PC)

That should start the server.
If you need more help let me know.

- Shane

- Original Message -
From: "Chris" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:20 PM
Subject: [PHP] Help Please, MySQL is driving me insane


I've installed PHP using the 4.04 win32 installer. I recently downloaded the
mysql(latest version) win32 installer and used that. But STILL mysql doesnt
work. Can someone give a code snipet i can use to see if it is working?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Help Please, MySQL is driving me insane

2001-01-26 Thread Shane McBride

The username that it defaults to is root, with no password. There is a
command you need to run to set a password.

- Original Message -
From: "Chris" <[EMAIL PROTECTED]>
To: "Jason Bouwmeester" <[EMAIL PROTECTED]>; "PHP"
<[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:29 PM
Subject: Re: [PHP] Help Please, MySQL is driving me insane


> But i installed it to the default c:\mysql.
> How can I set a username and such to allow me to use it on my cpu?
> - Original Message -
> From: "Jason Bouwmeester" <[EMAIL PROTECTED]>
> To: "PHP" <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 4:12 PM
> Subject: RE: [PHP] Help Please, MySQL is driving me insane
>
>
> > I just installed mySQL yesterday from mysql.com (or .net or whatever it
> > was). It installed fine, there was a note about what to do if you didn't
> > install it to c:\mysql properly - I installed mine to a different
> directory,
> > followed the instructions and all went fine. Might be one place to
start.
> >
> > HTH,
> > jb
> >
> > -Original Message-
> > From: Chris [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, January 26, 2001 8:21 PM
> > To: PHP
> > Subject: [PHP] Help Please, MySQL is driving me insane
> >
> >
> > I've installed PHP using the 4.04 win32 installer. I recently downloaded
> the
> > mysql(latest version) win32 installer and used that. But STILL mysql
> doesnt
> > work. Can someone give a code snipet i can use to see if it is working?
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] phpinfo ?

2001-01-26 Thread Shane McBride

Try this:









-Shane
- Original Message -
From: "kaab kaoutar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 10:23 AM
Subject: [PHP] phpinfo ?


> Hi there!
>
> I'm sure it's a stupid problem but the phpinfo does work while trying the
> following html code:
>
> PHP Test
> 
> 
>
> 
>
> the result is a blank page!
>
> And when i create an php file with only: 
> i have a dos window where a list of information is listed quickly then
> shut!(i can hardly see it)
> by the way is it the same to put php code between 
> and  and   ?
>
> thanks
> _
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] move_uploaded_file - getting furthur ..still need help

2001-01-26 Thread Shane McBride

Here's what I get:

Warning: Unable to create 'd:\sites\merchantpower\mp\images\': Permission denied in 
d:/sites/MerchantPower/mp/admin/add_record2.php on line 47




[PHP] really need help...

2001-01-26 Thread Shane McBride

I am getting this error and I don't understand. I am running PHP 4.0.4 and Xitami web 
server on Windows 98SE. I know this is not the most ideal setup, but I just use it for 
developing.

Warning: Unable to create 'd:\sites\merchantpower\mp\images\': Permission denied in 
d:/sites/MerchantPower/mp/admin/add_record2.php on line 49

Do I need to set permissions somewhere? I have no idea where...maybe the web server? 
It's like the file never gets to the temp directory.

I'm lost.
Here's the code:
if (is_uploaded_file($picture)) {
copy($picture, $new_path);
//move_uploaded_file($picture, $new_path);
} else {
echo "Possible file upload attack: filename '$picture'.";
}
}

Any help would be greatly appreciated...

-Shane



[PHP] writing a time to mysql????

2001-04-26 Thread Shane McBride

Here's some code that I am using to get the time that is inout from a form into mysql. 
It looks like I may have the format backwartds. Any ideas?

"INSERT into events (e_title, e_details, start, end, s_time, e_time) values ('$title', 
'$details', '$s_year-$s_month-$s_day','$e_year-$e_month-$e_day', 
'$stime_hour.$stime_minute', '$etime_hour.$etime_minute')";

s_time and e_time are thr start and end time of the event.

$stime_hour $stime_minute are the hour and minute fileds from the form.

Any ideas

- Shane
DISCLAIMER: I am by no means an expert on this, or any other, topic...



[PHP] Add FTP user via PHP?

2002-04-23 Thread Shane McBride

Is there a way to add an ftp user and assign them to a directory when the
host server does not and will not load the ftp module?

Shane McBride
RDI Technologies
www.rditech.net
Office: 410-575-6326
Fax:410-575-6327


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




[PHP] MAC file upload

2002-04-06 Thread Shane McBride

Hello,

I am able to upload and download Macintosh files but they seem to lose their
MIME type or extensions. I'm not sure what it is. I'm not a Mac dude.

When you download the file It loses the file association. It's for a company
I do work for that uses a lot of .ai and .psd files.


Any ideas on this?


Shane McBride
RDI Technologies
www.rditech.net
Office: 410-575-6326
Fax:410-575-6327


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




[PHP] Simple: Whats wrong with this?

2004-03-17 Thread Shane McBride
I have a form variable I want to increment by a value of 1 each time the
page loads. Here's what I have so far:

if(!isset($correct)) {
$correct = 0;
} else {
$correct = $correct++;
}

Seems like it should work?

Thanks!
Shane

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



RE: [PHP] Simple: Whats wrong with this?

2004-03-17 Thread Shane McBride
It doesn't seem to work either way for me.

Shane

-Original Message-
From: Jake McHenry [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 12:01 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Simple: Whats wrong with this?


> No.
>
> $correct++;
>
> Is all you need for the second condition, it automatically sets itself
> back.
>


Does this always work? In my timesheet app, I have to do $counter = $counter
+ 1, because for some reason the $counter++; doesn't work. It just doesn't
work, no incrementation of the variable. Is there something in php.ini that
can prohibit this from working?

Thanks,
Jake

--
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] Simple: Whats wrong with this?

2004-03-17 Thread Shane McBride
I am just trying to get the variable to increment, than I will be working on
a session. It's basically being used to keep track of correct/incorrect
answers for an online quiz.

Here's what I am trying:

if(!isset($correct)) {
$correct = 0;
} else {
$correct++
}

Shane

-Original Message-
From: Adam Voigt [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 12:06 PM
To: Shane McBride
Cc: PHP
Subject: RE: [PHP] Simple: Whats wrong with this?


Well I accidentally deleted your original email, but I didn't see where
you were getting the counter variable from. Where is the variable being
stored? You do know that setting $counter++ for one visitor, doesn't
translate the value of $counter to another, right?



On Wed, 2004-03-17 at 12:05, Shane McBride wrote:
> It doesn't seem to work either way for me.
>
> Shane
>
> -Original Message-
> From: Jake McHenry [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 17, 2004 12:01 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Simple: Whats wrong with this?
>
>
> > No.
> >
> > $correct++;
> >
> > Is all you need for the second condition, it automatically sets itself
> > back.
> >
>
>
> Does this always work? In my timesheet app, I have to do $counter =
$counter
> + 1, because for some reason the $counter++; doesn't work. It just doesn't
> work, no incrementation of the variable. Is there something in php.ini
that
> can prohibit this from working?
>
> Thanks,
> Jake
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--

Adam Voigt
[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



RE: [PHP] Simple: Whats wrong with this?

2004-03-17 Thread Shane McBride
No, the value still is not incrementing. 

-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 12:25 PM
To: Shane McBride; PHP; [EMAIL PROTECTED]
Subject: RE: [PHP] Simple: Whats wrong with this?


Shane McBride <mailto:[EMAIL PROTECTED]>
on Wednesday, March 17, 2004 9:16 AM said:

> I am just trying to get the variable to increment, than I will be
> working on a session. It's basically being used to keep track of
> correct/incorrect answers for an online quiz.

and so now that you've corrected your code what are the results you are
getting? are they not what you expect/want?


chris.

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



RE: [PHP] Retain form values...

2004-03-18 Thread Shane McBride
How about passing the form variables to a hidden field on the next page? I
used this for several page forms before. Also, sessions work well.

Shane

-Original Message-
From: Firman Wandayandi [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 3:43 PM
To: [EMAIL PROTECTED]
Cc: PHP-GEN
Subject: Re: [PHP] Retain form values...


Hi Jonathan,

You can do this, with one file, display a form, proceed the fields, and fill
the field form objects with the value. If you use separate page in my mind
is impossible.

Regards,
Firman

- Original Message -
From: "Jonathan Villa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 3:01 AM
Subject: [PHP] Retain form values...


> I want to be able to submit the page to another page vs PHP_SELF.  On
> that page I want to be able to validate the form, and if it fails,
> return the user to the previous page.  Now that's easy, but the catch is
> that I want to retain/repopulate their field values.
>
> I was thinking of forcing a history.back if possible, but would rather
> use some server side code.  I tried researching what can be done with
> sending headers, but I don't want to use a GET method.  I want to use
> POST.
>
> thoughts?
>
> --
> 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



RE: [PHP] Retain form values...

2004-03-18 Thread Shane McBride
Gotcha. I typically use javascript to validate before the form is posted to
validate.

shane

-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 6:23 PM
To: Shane McBride; PHP
Subject: RE: [PHP] Retain form values...


Shane McBride <mailto:[EMAIL PROTECTED]>
on Thursday, March 18, 2004 2:50 PM said:

> How about passing the form variables to a hidden field on the next
> page? I used this for several page forms before.

that won't work because he's not doing a multi-page form. he just wants
to send the form data back *if* the form fails his validation.



chris.

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



RE: [PHP] Retain form values...

2004-03-18 Thread Shane McBride
Actually all form validation is done before the form action takes place, so
that way we do not loose input.

shane

-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 6:38 PM
To: Shane McBride; PHP
Subject: RE: [PHP] Retain form values...


Shane McBride <mailto:[EMAIL PROTECTED]>
on Thursday, March 18, 2004 3:37 PM said:

> Gotcha. I typically use javascript to validate before the form is
> posted to validate.

ok.. but i don't see how that helps. you're still validating on the
server side right? in which case you could still have a failed
validation, thus the need to send the users data back to the original
page.



chris.

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



[PHP] IIS and PHP authorization

2001-01-27 Thread Shane McBride

I finally got PHP, MySQL and Win2k installed after a long hard battle with a Promise 
Ultra/66 controller card. Now, PHP seems to work fine exceot when I have a script that 
requires authorization, I never get the popup box to input the login and password. 
Here's the script:



Any ideas?

TIA- Shane



Re: [PHP] IIS and PHP authorization

2001-01-27 Thread Shane McBride

I thought PHP would only run as CGI on IIS? Right now I'm trying to config
Apache.

- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Shane McBride" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, January 27, 2001 9:44 PM
Subject: Re: [PHP] IIS and PHP authorization


> If you are using the CGI version of PHP then this won't work.  You can't
> do HTTP auth from the CGI version.
>
> -Rasmus
>
> On Sun, 28 Jan 2001, Shane McBride wrote:
>
> > I finally got PHP, MySQL and Win2k installed after a long hard battle
with a Promise Ultra/66 controller card. Now, PHP seems to work fine exceot
when I have a script that requires authorization, I never get the popup box
to input the login and password. Here's the script:
> >
> >  >   // Include the setup password file
> >   require 'setup.inc';
> >
> >   // Check to see if $PHP_AUTH_USER already contains info
> >   if (!isset($PHP_AUTH_USER)) {
> > // If empty, send header causing dialog box to appear
> >  header('WWW-Authenticate: Basic realm="The Merchant Power Setup
Area"');
> >  header('HTTP/1.0 401 Unauthorized');
> >  echo 'Authorization Required!';
> >  exit;
> >   } else if (isset($PHP_AUTH_USER)) {
> >  if (($PHP_AUTH_USER !=$SETUP_USER) || ($PHP_AUTH_PW !=$SETUP_PASS)) {
> >header('WWW-Authenticate: Basic realm="The Merchant Power Setup
Area"');
> >header('HTTP/1.0 401 Unauthorized');
> >echo 'Authorization Required!';
> >exit;
> > }
> >  }
> > ?>
> >
> > Any ideas?
> >
> > TIA- Shane
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] IIS and $PHP_AUTH_USER

2001-01-29 Thread Shane McBride

I am getting a whole lot closer to getting IIS to work with PHP loading as ISAPI.

Now, when I try to get authorized, it never works. It's probably a varialbe in the 
.ini file I have not set. I keep getting the user prompt box, and the realm changes 
after the first login failure

NT5
PHP 4.0.4pl1

Here's the code:

?>  
  // Check to see if $PHP_AUTH_USER already contains info
  if (!isset($PHP_AUTH_USER)) {
// If empty, send header causing dialog box to appear
 header('WWW-Authenticate: Basic realm="TBCC"');
 header('HTTP/1.0 401 Unauthorized');
 echo 'Authorization Required!';
 exit;
  } else if (isset($PHP_AUTH_USER)) {
 if (($PHP_AUTH_USER !="admin") || ($PHP_AUTH_PW !="admin")) {
   header('WWW-Authenticate: Basic realm="TBCC"');
   header('HTTP/1.0 401 Unauthorized');
   echo 'Authorization Required!';
   exit;
}
 }
?>



It worked!





[PHP] Real prob w/ NT5 and $PHP_AUTH_USER

2001-01-30 Thread Shane McBride

I have PHP loaded as ISAPI, not CGI. I originally had PHP installed as cgi.

When I have a script that authenticates a user, it never authorizes them. I have set 
the permissions in IIS to only allow Anonymous access. The other two options are 
disabled. I have tried all the different security option I can think of. The script 
works fine on Win98, Xitami, and PHP.

Any ideas?

Shane



Re: [PHP] How can I make PHP to work on Win98 ?

2001-01-30 Thread Shane McBride




 Here's my input:

Get Xitami for Windows. You can not do any version of IIS on win98. Xitami
 is VERY easy to configure. Then you of course will need PHP.

 First, install Xitami, then PHP. The PHP installer will ask you what type
of
 web server you run and configure PHP and the web server for you.

 Here are the links:
 http://www.xitami.com/download.htm - Get the bw3224d7.exe file
 http://www.php.net/downloads.php - Get the Win32 Binary named PHP 4.0.3pl1
 or any off the other ones there.

 than is you you want to get fancy, add MySQL support

Have fun.
It works pretty well, except when you get into some of the more advanced PHP
functions like move_uploaded_file, etc...

> - Original Message -
> From: "nastaran kashani" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 30, 2001 10:14 AM
> Subject: [PHP] How can I make PHP to work on Win98 ?
>
>
> >
> >
> >Hi,
> >  I work with Winows98  , and I want to make my system
> > a really server.I have two questions :
> >
> > 1}What component  I should install on my system to
> >   make it a really server ? IIS3 ? or IIS4 ?
> > 2)Where can I get this component (IIS3 or IIS4
> >   for Windows98) ?
> >
> >
> > Thanks a lot
> >  Atieh Kashani
> >
> > __
> > Get personalized email addresses from Yahoo! Mail - only $35
> > a year!  http://personal.mail.yahoo.com/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Pricing for PHP programming???

2001-01-31 Thread Shane McBride

I know this is not really a PHP question, but it should make for a good thread. :)

I was wondering what other PHP people charge to write PHP? I have just been given a 
project for a fairly large customer, much larger than I normally do work for. So I am 
VERY confused.concerned about how to price it. Most of my other PHP projects have been 
done for small single owners businesses, and the PHP has been pretty basic.

Now that I can actually do what I am being asked without have to learn it, I am stuck. 
I did a shopping cart for someone, but I didn't charge them a REAL price because I 
didn't know how to do it with PHP. So, I of course didn't charge the client for my 
learning curve.

I know the price is very dependant upon the task. What I am doing is creating a 
web-based front-end for a MySQL database. I'll need to create the database tables, 
etc. The front-end is going to be rather dynamic since the data content depends 
largely on the previous choices of the end-user. One or two tables with 20-30 fields. 
5-6 pages of html and PHP.

I'm just scouting this out, and am VERY confident with the contributors to this list 
and their opinions. 

TIA,
Shane



Re: [PHP] Cant get this one

2001-02-01 Thread Shane McBride

It looks like your not assigning the arrays correctly. Here's a long piece
of code I use: (it has alot of extra code that you don't need.)

Couldn't get list!");
 } else {
  while ($row = mysql_fetch_array($sql_result)) {
   $title = addslashes($row["title"]);
   $price = $row["price"];
   $image = $row["image"];
   $description = addslashes($row["description"]);
   $fmt_price = sprintf("%0.2f", $price);
   $fmt_title = stripslashes($title);
   $fmt_desc = stripslashes($description);
   echo "

 
  Title:
  $fmt_title
 
 
  Description:
  $fmt_desc
 
 
  Price:
  


";
   }
  }
?>

"Mike" <[EMAIL PROTECTED]> wrote in message
news:<95c33h$5a3$[EMAIL PROTECTED]>...
> Im trying to create  an edit page for database records on the fly.I get
all
> the fieldnames and all the textboxes but only the first textbox has
data.the
> rest are always empty.any suggestions?
>
> for ($i =0;$i {
>
>  $row = mysql_fetch_row($result);
>  $name=mysql_field_name($result,$i);
>   echo "$name size='20'>";
> }
>
>
> Thanks
> Mike P
> [EMAIL PROTECTED]
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] IIS & ISAPI

2001-02-03 Thread Shane McBride

I have loaded PHP according to the install file but I can not see any .php file in a 
browser.

When I look under the ISAPI properties in IIS is appears that the dll is not loading. 
It has a red arrow pointing down.

Any ideas?

shane



Re: [PHP] IIS & ISAPI

2001-02-03 Thread Shane McBride

Yea I had to move the php4ts.dll dile to the winnt directory. Thanks.

Have you every tried to get authentication to work using PHP as isapi?

- Original Message -
From: "Chris Fry" <[EMAIL PROTECTED]>
To: "Shane McBride" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, February 03, 2001 11:24 PM
Subject: Re: [PHP] IIS & ISAPI


> Shane,
>
> Had the same problem - move the dll into the php directory - doesn't seem
to work in the sapi dir.
>
> Also you need to set the root dir in php.ini
>
> Chris
>
> Shane McBride wrote:
>
> > I have loaded PHP according to the install file but I can not see any
.php file in a browser.
> >
> > When I look under the ISAPI properties in IIS is appears that the dll is
not loading. It has a red arrow pointing down.
> >
> > Any ideas?
> >
> > shane
>
> --
> Chris Fry
> Quillsoft Pty Ltd
> Specialists in Secure Internet Services and E-Commerce Solutions
> 10 Gray Street
> Kogarah
> NSW  2217
> Australia
>
> Phone: +61 2 9553 1691
> Fax: +61 2 9553 1692
> Mobile: 0419 414 323
> eMail: [EMAIL PROTECTED]
> http://www.quillsoft.com.au
>
> You can download our Public CA Certificate from:-
> https://ca.secureanywhere.com/htdocs/cacert.crt
>
> **
>
> This information contains confidential information intended only for
> the use of the authorised recipient.  If you are not an authorised
> recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> e-mail.
> In this case, you should not read, print, re-transmit, store or act
> in reliance on this e-mail or any attachments, and should destroy all
> copies of them.
> This e-mail and any attachments may also contain copyright material
> belonging to Quillsoft Pty Ltd.
> The views expressed in this e-mail or attachments are the views of
> the author and not the views of Quillsoft Pty Ltd.
> You should only deal with the material contained in this e-mail if
> you are authorised to do so.
>
> This notice should not be removed.
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTTP Authentication w/IIS

2001-02-03 Thread Shane McBride

OK, I loaded PHP with the ISAPI filter, but still no luck with authentication..

Here's the basic script that works on Apache/Linux:




Re: [PHP] Session With Cookies

2001-02-03 Thread Shane McBride

Try this:

// Set Cookie if not already set
 if (!isset($user_id)) {
  $token = md5(uniqid(rand()));
  setcookie("user_id", $token, time()+3600,"/",".yourdomain.com");
 }

look at the setcookie function on php.net to figure out all the parameters:
http://www.php.net/manual/en/function.setcookie.php

-Shane

- Original Message - 
From: "phpLover" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 03, 2001 11:25 PM
Subject: [PHP] Session With Cookies


> How can I maintain a user session using cookies?
> 
> Thanks
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] uploading file

2001-02-05 Thread Shane McBride

OK, I'm not sure if the file is getting uploaded or not, and it certainly is not 
getting copied to the permanent directory.

Here's what I have:

This creates the upload form:



This is the action from that form:

// Creates the image file with a timestamp
$timestamp = time();
$image= $timestamp.$picture_name;

if ($PLATFORM == "windows") {
$new_path = str_replace('^', '\\', $WINDOWS_PATH);   
echo $picture;
if (is_uploaded_file($picture)) {
copy($picture, $new_path);
//move_uploaded_file($picture, $new_path);
} else {
echo "Possible file upload attack: filename '$picture'.";
}
}




[PHP] PHPSESSID location?

2001-02-05 Thread Shane McBride

Where is the temp session file held at? I have a script that uses sessions but I can't 
find the session file.

My php.ini file indicates that the session.save_path = c:\php\sessiondata but there is 
not any files there when there should be. It does look like the session is working 
though. 

Any ideas?

Apache
win2k
php 4.0.4pl1

- Shane



Re: [PHP] simple config. question

2001-02-05 Thread Shane McBride

Unless I am mistaken, I am pretty sure you need to have sometype of .php
extension. Unless you could put a line in the httpd.conf file like:
AddType application/x-httpd-php .html

BUT, I HAVE NEVER DONE THIS SO PLEASE WAIT FOR A MORE EDUCATED
ANSWER.

- Shane

- Original Message -
From: "Don" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 05, 2001 2:03 PM
Subject: [PHP] simple config. question


> Hi,
>
> I'm a newbie with PHP and have successfully written some simple
> scripts.  I am using Apache on Redhat Linux 6.2 with PHP 3.
>
> At the moment, I have to give .php3 extensions ot my web files in order
> for PHP to run.  If I insert PHP code into an .html file, it does not
> execute.
>
> Is their a way to configure PHP to execute from .html files?
>
> P.S.  As I write this, I don't discount the possibility of this being an
>
> Apache config.  If so, I apologize for posting to this list.
>
> Thanks,
> Don
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] I wish: IIS and ISAPI $PHP_AUTH_USER

2001-02-05 Thread Shane McBride

I tried for days to get IIS to authorize a user with $PHP_AUTH_USER and never got 
anywhere, so I used apache and it works fine.

I wish I just knew why. I loaded PHP as ISAPI, like the manual indicated, but no luck.

I would like to use some of the functionality of IIS/NT5.0

Any ideas



Re: [PHP] I wish: IIS and ISAPI $PHP_AUTH_USER

2001-02-06 Thread Shane McBride

Yes, I have the filter loaded. PHP file in general work excellent. It's just
any file that uses the following code:

What happens is that the prompt window comes up, but no matter what
username/password is used it always fails. I tried to set the permissions in
IIS several different ways but no luck...


To: "Shane McBride" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 06, 2001 4:49 AM
Subject: Re: [PHP] I wish: IIS and ISAPI $PHP_AUTH_USER


> >I tried for days to get IIS to authorize a user with $PHP_AUTH_USER and
> never got anywhere, so I used apache and it works fine.
>
> >I wish I just knew why. I loaded PHP as ISAPI, like the manual indicated,
> but no luck.
>
> As well as mapping the .php file extension onto the php4isapi.dll, have
you
> also installed PHP as an ISAPI filter?
> I'm pretty sure that it is the filter bit that enables php to pick up the
> authentication details.
>
> Cheers
> --
> Phil Driscoll
> Dial Solutions
> +44 (0)113 294 5112
> http://www.dialsolutions.com
> http://www.dtonline.org
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] I wish: IIS and ISAPI $PHP_AUTH_USER

2001-02-06 Thread Shane McBride

Phil,

Did you happen to copy the php4ts.dll into the winnt directory? I am not
sure of the error you are getting, but it may help?


- Original Message -
From: "Phil Driscoll" <[EMAIL PROTECTED]>
To: "Shane McBride" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 06, 2001 11:14 AM
Subject: Re: [PHP] I wish: IIS and ISAPI $PHP_AUTH_USER


> Shane
>
> I can't do any testing for you at my end as I just can't get php to work
as
> an ISAPI module on my setup without causing 500 internal server errors.
>
> It would be helpful if you could echo $PHP_AUTH_USER if it is set, just so
> we can see what it is set to, and echo something else (eg 'auth not set')
if
> it is not set, then we'll have a better idea of where it's going wrong.
>
> Cheers
> --
> Phil Driscoll
> Dial Solutions
> +44 (0)113 294 5112
> http://www.dialsolutions.com
> http://www.dtonline.org
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] I wish: IIS and ISAPI $PHP_AUTH_USER

2001-02-06 Thread Shane McBride

Phil,

Hey check out this thread:
http://www.phpbuilder.com/forum/read.php3?num=3&id=100242&thread=100047

- Original Message -
From: "Phil Driscoll" <[EMAIL PROTECTED]>
To: "Shane McBride" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 06, 2001 11:14 AM
Subject: Re: [PHP] I wish: IIS and ISAPI $PHP_AUTH_USER


> Shane
>
> I can't do any testing for you at my end as I just can't get php to work
as
> an ISAPI module on my setup without causing 500 internal server errors.
>
> It would be helpful if you could echo $PHP_AUTH_USER if it is set, just so
> we can see what it is set to, and echo something else (eg 'auth not set')
if
> it is not set, then we'll have a better idea of where it's going wrong.
>
> Cheers
> --
> Phil Driscoll
> Dial Solutions
> +44 (0)113 294 5112
> http://www.dialsolutions.com
> http://www.dtonline.org
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] File upload - ascii format

2001-02-06 Thread Shane McBride

How can I ensure that a file is transferred in ascii mode using the following:


File to Upload:

emplresults.txt 
applresults.txt




I think it may be how you specify the enctype?

- Shane




Re: [PHP] HTTP Authentication

2001-02-07 Thread Shane McBride

Nick,

I'm not sure were you are getting the value of $PHP_AUTH_USER from, so you
might want to try this snippet. This causes a dialog box to open and ask for
a username/password.

Also, in your code: you do not need to escape the quotes in the header.



- Original Message -
From: "Nick Kostirya" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 10:27 AM
Subject: [PHP] HTTP Authentication


> Hi, all.
> HTTP Authentication in PHP 4 - Apache don't work!!!
> Help me.
> Best.
> __
>if(!isset($PHP_AUTH_USER)) {
> Header("WWW-Authenticate: Basic realm=\"My Realm\"");
> Header("HTTP/1.0 401 Unauthorized");
> echo "Text to send if user hits Cancel button\n";
> exit;
>   } else {
> echo "Hello $PHP_AUTH_USER.";
> echo "You entered $PHP_AUTH_PW as your password.";
>   }
> ?>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP as Scripting Language

2001-02-07 Thread Shane McBride

This is just a guess, but remove the path (#!/usr/local/bin/php)

If you have the php.ini and (I'm assuming Apache) the httpd.conf file
configured you shouldn't need it.

I never have used it. It looks like the Perl way to script... :)

DISCLAIMER: I am by no means well-versed in this, or any other, topic

- Shane

- Original Message -
From: "John Huggins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 12:10 PM
Subject: [PHP] PHP as Scripting Language


>
> Well, I have compiled a php binary for use as yet another scripting
language
> to work along side AWK, Perl, Sh, etc.
>
> It works too.  I have this file...
>
>
> #!/usr/local/bin/php
>  print("Hello World\n");
> ?>
>
>
> I run it and get..
>
>
>
>
> host:~/projects/PHPScripts # ./test.php
> Content-type: text/html
>
> Hello World
>
>
>
> Great.  Now how do I get rid of the Content-type line?  I have searched
the
> docs with little clues.
>
> Thanks for your help.
>
>
>
> ***
> John Huggins
>
> Transmitter Location Systems, LLC
> 14120 Parke Long Court, 103
> Chantilly, Virginia 20151
> 703-227-8435
> 703-968-8808 fax
> [EMAIL PROTECTED]
> http://www.tls2000.com/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sum from Arrays ?

2001-02-07 Thread Shane McBride

Hum, maybe the count() function. Works with mysql_fetch_array() too. Here's
a sample:
$a[0] = 1;
$a[1] = 3;
$a[2] = 5;
$result = count ($a);
//$result == 3

Here's a link:
http://php.net/manual/en/function.count.php
DISCLAIMER: I am by no means well-versed in this, or any other, topic
- Shane

- Original Message -
From: "Keith Whyman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 12:15 PM
Subject: [PHP] Sum from Arrays ?


> It's probably a stupid question but...
> I've got the following ;
>
> SELECT t_category_name COUNT(*) AS count
> FROM t_city,t_zipcodecity,t_location,t_category , t_locationcategory
> WHERE (t_category_id_category = t_locationcategory_id_category)
> AND (t_location_id_location = t_locationcategory_id_location)
> AND (t_zipcodecity_zipcode = t_location_zipcode)
> AND (t_city_id_city = t_zipcodecity_id_city)
> AND (t_city_id_city = 1)
> AND ((t_location_sex = 4) OR  (t_location_sex = 0))
> GROUP BY t_category_name";
>
> $result1 = mysql_db_query(DBWEB, $query);
> print mysql_error();
> echo "
> 
> ";
> if ($result1) {
>
>
> while ($r = mysql_fetch_array($result1)) {
> $numbers = $r["count"];
> $names =$r["$t_category_name"];
>
> And what I want is a total for my count - I think it something to do with
> the mySQL sum funktion but I've got a bit stuck !
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] uploading file

2001-02-08 Thread Shane McBride

Yea, I guess I should have stripped out some of the special code before I
posted. The ^ replaces \ when the user inserts the windows path, than I
replace the ^ with \\ so the path works correctly.

I did get this to work. I was sure fighting it though...

- Shane
DISCLAIMER: I am by no means an expert on this, or any other, topic...

- Original Message -
From: "Richard Lynch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 08, 2001 3:40 AM
Subject: Re: [PHP] uploading file


> // Creates the image file with a timestamp
> $timestamp = time();
> $image= $timestamp.$picture_name;
>
> if ($PLATFORM == "windows") {
> $new_path = str_replace('^', '\\', $WINDOWS_PATH);
>
> What's with the "^"?...
> And, since \ is special in PHP, you are changing ^ to \?  Why?
>
> echo $picture;
> if (is_uploaded_file($picture)) {
> copy($picture, $new_path);
> file://move_uploaded_file($picture, $new_path);
> } else {
> echo "Possible file upload attack: filename '$picture'.";
> }
>
> #add this:
> echo "is_uploaded_file() failed.";
>
> }
>
>
>
> --
> Visit the Zend Store at http://www.zend.com/store/
> Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP File Uplaod Path

2001-02-08 Thread Shane McBride

Dhaval,

You really do not nee to be concerned about the temp directory, but if you
are, you can wite a little script (if your not the sysadmin) to find this
out. Actually it tells you a ton of useful info. Here it is:



Name it phpinfo.php or whatever you like, upload it to the server and view
it. I believe that PHP knows where to look to find the temp file.

As far as moving the file once its uploaded, here you go:

File to create the upload: (show_upload.php)


Upload a File


Upload a File

File to Upload:






File to do the work: (do_upload.php)



Successful File Upload!

Success!
You sent: , a 
byte file with a mime type of .



This is taken from Julie Meloni's website. She writes GREAT books. "PHP
Essentials" is essential.
http://www.thickbook.com/extra/php_fileupload.phtml

Thanks Julie!!!

- Shane
DISCLAIMER: I am by no means an expert on this, or any other, topic...
- Original Message -
From: "Dhaval Desai" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 3:42 AM
Subject: [PHP] PHP File Uplaod Path


> Hi!
>
> I need help with uploading files with php.
> What is the default directory where the files are
> uploaded..?
> I want to specify a particular directory where the
> files have to come after they are uploaded.
>
> Is it possible to specify a path in the script where
> the files will automatically be copied after uploading
> to the temporary directory.
>
> Please help me out ...
>
> Thank You
> Dhaval Desai
>
>
>
>
> __
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] my bugaboo.

2001-02-10 Thread Shane McBride

Look into addslashes() and stripslashes()
Are you getting $text from a database query?


- Shane
DISCLAIMER: I am by no means an expert on this, or any other, topic...
- Original Message -
From: "Floyd Baker" <[EMAIL PROTECTED]>
To: "Floyd Baker" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, February 10, 2001 1:39 PM
Subject: Re: [PHP] my bugaboo.


>
> Hello and thanks to all for the help on the magic quotes, etc.
> It gives me a better handle on what I'm dealing with.
>
> Except for one more thing.
>
> When I bring back text from a field which contains a ', and try to apply
it as
> the value of an input box, it still truncates in the box.
>
> When I simply print $text, it prints out correctly as *Don't do this* .
> When I make $text the default value of an input box, it shows as *Don*.
>
> If the slash is still in place, it reads *Don\'t* above the box and *Don\*
in
> the box.
>
> My bugaboo continues..  :->
>
> Thanks again for any further advice.
>
> Floyd
>
>
>
>
>
>
>
> On Sat, 03 Feb 2001 19:42:23 -0500, you wrote:
>
> >
> >Hi..
> >
> >I have a routine where we input text to fields. When there is an
apostrophe it
> >handles it correctly.  When the form is brought back for editing, the
field
> >values show up in the input fields, with all apostrophes intact, just as
it
> >should be.
> >
> >When I upload this script to my isp, it doesn't work..  The apostrophes
truncate
> >the rest of the text.   'Don't cry over spilled milk', in a field, turns
into
> >'Don'...
> >
> >I have php4 mod in my win32 devbox.  The isp is php3.  Is this the
problem?
> >What is the best way out of it please?
> >
> >Thanks in advance.
> >
> >Floyd
> >
> >
> >--
>
> --
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]