Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Steve Marquez
I am on Mac OS 10.6
I found the logs using the console. It was pretty easy and displays nicely.

I am reviewing the entries now.

Thanks for your help.

-- 
Steve Marquez
Marquez Design
e-mail: smarq...@marquez-design.com
web: http://www.marquez-design.com
phone: 479-648-0325 

On Jun 3, 2010, at 1:55 PM, Shreyas wrote:

> Steve,
> 
> Do you know where Apache is installed? If yes, you have something like 
> error.log and access.log. Find them and nail them them down. 
> 
> I am a novice, too and the best way to learn is to answer here and getting 
> corrected by other PHP gurus! So, all in the name of learning! :)
> 
> --Shreyas
> 
> On Thu, Jun 3, 2010 at 11:28 PM, Steve Marquez  
> wrote:
> Strangest thing... it just started working again. Odd.
> 
> Is there an easy way to view the error logs? As you can tell, I am still a 
> novice at this.
> I am on Apache2
> 
> Thanks for your help.
> 
> --
> Steve Marquez
> Marquez Design
> e-mail: smarq...@marquez-design.com
> web: http://www.marquez-design.com
> phone: 479-648-0325
> 
> 
> On Jun 3, 2010, at 9:53 AM, Jim Lucas wrote:
> 
> > Steve Marquez wrote:
> >> Good morning,
> >>
> >> I have a PHP form that I have been using for some time now on a Macbook 
> >> Pro running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But 
> >> this morning, when I submitted (it is a journaling application) it came up 
> >> with the following error:
> >>
> >> No such file or directory
> >>
> >> Can anyone point me in the right direction to fix this? Have you ever seen 
> >> this before?
> >>
> >> Thanks,
> >>
> >> Steve Marquez
> >
> > Where exactly did you see this error?
> >
> > 1) In your browser when you tried loading the form?
> > 2) In your browser when you submitted the form?
> > 3) In the error logs of your web server?
> >
> > Other questions:
> >
> > What type of web server are you running?
> >
> > Did your cat stomp on your keyboard?
> >
> > Are the files stored locally or are they on a network/remote drive?
> >
> > Children doing things they should not be doing? (Happened to me once...)
> >
> > Are you accessing the files via http://localhost/... ?? or as a local file?
> >
> > --
> > Jim Lucas
> >
> > A: Maybe because some people are too annoyed by top-posting.
> > Q: Why do I not get an answer to my question(s)?
> > A: Because it messes up the order in which people normally read text.
> > Q: Why is top-posting such a bad thing?
> 
> 
> 
> 
> -- 
> Regards,
> Shreyas



Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Shreyas
True. Since I am a Windows user, I find it here :

*C:\Program Files\EasyPHP 3.0\apache\logs*

--Shreyas

On Fri, Jun 4, 2010 at 12:27 AM, Ashley Sheridan
wrote:

>  On Fri, 2010-06-04 at 00:25 +0530, Shreyas wrote:
>
> Steve,
>
> Do you know where Apache is installed? If yes, you have something like
> error.log and access.log. Find them and nail them them down.
>
> I am a novice, too and the best way to learn is to answer here and getting
> corrected by other PHP gurus! So, all in the name of learning! :)
>
> --Shreyas
>
> On Thu, Jun 3, 2010 at 11:28 PM, Steve Marquez
> wrote:
>
> > Strangest thing... it just started working again. Odd.
> >
> > Is there an easy way to view the error logs? As you can tell, I am still a
> > novice at this.
> > I am on Apache2
> >
> > Thanks for your help.
> >
> > --
> > Steve Marquez
> > Marquez Design
> > e-mail: smarq...@marquez-design.com
> > web: http://www.marquez-design.com
> > phone: 479-648-0325
> >
> >
> > On Jun 3, 2010, at 9:53 AM, Jim Lucas wrote:
> >
> > > Steve Marquez wrote:
> > >> Good morning,
> > >>
> > >> I have a PHP form that I have been using for some time now on a Macbook
> > Pro running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But
> > this morning, when I submitted (it is a journaling application) it came up
> > with the following error:
> > >>
> > >> No such file or directory
> > >>
> > >> Can anyone point me in the right direction to fix this? Have you ever
> > seen this before?
> > >>
> > >> Thanks,
> > >>
> > >> Steve Marquez
> > >
> > > Where exactly did you see this error?
> > >
> > > 1) In your browser when you tried loading the form?
> > > 2) In your browser when you submitted the form?
> > > 3) In the error logs of your web server?
> > >
> > > Other questions:
> > >
> > > What type of web server are you running?
> > >
> > > Did your cat stomp on your keyboard?
> > >
> > > Are the files stored locally or are they on a network/remote drive?
> > >
> > > Children doing things they should not be doing? (Happened to me once...)
> > >
> > > Are you accessing the files via http://localhost/... ?? or as a local
> > file?
> > >
> > > --
> > > Jim Lucas
> > >
> > > A: Maybe because some people are too annoyed by top-posting.
> > > Q: Why do I not get an answer to my question(s)?
> > > A: Because it messes up the order in which people normally read text.
> > > Q: Why is top-posting such a bad thing?
> >
> >
>
>
>
>
> You haven't said what sort of operating system you're using. In Linux, most
> of the logs are kept in sub-directories of /var/log I believe. Windows, well
> they could be scattered anywhere. MacOS, not too sure about that.
>
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


-- 
Regards,
Shreyas


Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Ashley Sheridan
On Fri, 2010-06-04 at 00:25 +0530, Shreyas wrote:

> Steve,
> 
> Do you know where Apache is installed? If yes, you have something like
> error.log and access.log. Find them and nail them them down.
> 
> I am a novice, too and the best way to learn is to answer here and getting
> corrected by other PHP gurus! So, all in the name of learning! :)
> 
> --Shreyas
> 
> On Thu, Jun 3, 2010 at 11:28 PM, Steve Marquez
> wrote:
> 
> > Strangest thing... it just started working again. Odd.
> >
> > Is there an easy way to view the error logs? As you can tell, I am still a
> > novice at this.
> > I am on Apache2
> >
> > Thanks for your help.
> >
> > --
> > Steve Marquez
> > Marquez Design
> > e-mail: smarq...@marquez-design.com
> > web: http://www.marquez-design.com
> > phone: 479-648-0325
> >
> >
> > On Jun 3, 2010, at 9:53 AM, Jim Lucas wrote:
> >
> > > Steve Marquez wrote:
> > >> Good morning,
> > >>
> > >> I have a PHP form that I have been using for some time now on a Macbook
> > Pro running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But
> > this morning, when I submitted (it is a journaling application) it came up
> > with the following error:
> > >>
> > >> No such file or directory
> > >>
> > >> Can anyone point me in the right direction to fix this? Have you ever
> > seen this before?
> > >>
> > >> Thanks,
> > >>
> > >> Steve Marquez
> > >
> > > Where exactly did you see this error?
> > >
> > > 1) In your browser when you tried loading the form?
> > > 2) In your browser when you submitted the form?
> > > 3) In the error logs of your web server?
> > >
> > > Other questions:
> > >
> > > What type of web server are you running?
> > >
> > > Did your cat stomp on your keyboard?
> > >
> > > Are the files stored locally or are they on a network/remote drive?
> > >
> > > Children doing things they should not be doing? (Happened to me once...)
> > >
> > > Are you accessing the files via http://localhost/... ?? or as a local
> > file?
> > >
> > > --
> > > Jim Lucas
> > >
> > > A: Maybe because some people are too annoyed by top-posting.
> > > Q: Why do I not get an answer to my question(s)?
> > > A: Because it messes up the order in which people normally read text.
> > > Q: Why is top-posting such a bad thing?
> >
> >
> 
> 


You haven't said what sort of operating system you're using. In Linux,
most of the logs are kept in sub-directories of /var/log I believe.
Windows, well they could be scattered anywhere. MacOS, not too sure
about that.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Shreyas
Steve,

Do you know where Apache is installed? If yes, you have something like
error.log and access.log. Find them and nail them them down.

I am a novice, too and the best way to learn is to answer here and getting
corrected by other PHP gurus! So, all in the name of learning! :)

--Shreyas

On Thu, Jun 3, 2010 at 11:28 PM, Steve Marquez
wrote:

> Strangest thing... it just started working again. Odd.
>
> Is there an easy way to view the error logs? As you can tell, I am still a
> novice at this.
> I am on Apache2
>
> Thanks for your help.
>
> --
> Steve Marquez
> Marquez Design
> e-mail: smarq...@marquez-design.com
> web: http://www.marquez-design.com
> phone: 479-648-0325
>
>
> On Jun 3, 2010, at 9:53 AM, Jim Lucas wrote:
>
> > Steve Marquez wrote:
> >> Good morning,
> >>
> >> I have a PHP form that I have been using for some time now on a Macbook
> Pro running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But
> this morning, when I submitted (it is a journaling application) it came up
> with the following error:
> >>
> >> No such file or directory
> >>
> >> Can anyone point me in the right direction to fix this? Have you ever
> seen this before?
> >>
> >> Thanks,
> >>
> >> Steve Marquez
> >
> > Where exactly did you see this error?
> >
> > 1) In your browser when you tried loading the form?
> > 2) In your browser when you submitted the form?
> > 3) In the error logs of your web server?
> >
> > Other questions:
> >
> > What type of web server are you running?
> >
> > Did your cat stomp on your keyboard?
> >
> > Are the files stored locally or are they on a network/remote drive?
> >
> > Children doing things they should not be doing? (Happened to me once...)
> >
> > Are you accessing the files via http://localhost/... ?? or as a local
> file?
> >
> > --
> > Jim Lucas
> >
> > A: Maybe because some people are too annoyed by top-posting.
> > Q: Why do I not get an answer to my question(s)?
> > A: Because it messes up the order in which people normally read text.
> > Q: Why is top-posting such a bad thing?
>
>


-- 
Regards,
Shreyas


Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Ashley Sheridan
On Thu, 2010-06-03 at 12:58 -0500, Steve Marquez wrote:

> Strangest thing... it just started working again. Odd.
> 
> Is there an easy way to view the error logs? As you can tell, I am still a 
> novice at this. 
> I am on Apache2
> 
> Thanks for your help.
> 


It depends. On most Linux distros there are log viewers that let you
look at all the different logs from one drop-down menu.

Otherwise, the logs are all just text files, so you can view them in any
text editor from kate to notepad to vim.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Steve Marquez
Strangest thing... it just started working again. Odd.

Is there an easy way to view the error logs? As you can tell, I am still a 
novice at this. 
I am on Apache2

Thanks for your help.

-- 
Steve Marquez
Marquez Design
e-mail: smarq...@marquez-design.com
web: http://www.marquez-design.com
phone: 479-648-0325 


On Jun 3, 2010, at 9:53 AM, Jim Lucas wrote:

> Steve Marquez wrote:
>> Good morning,
>> 
>> I have a PHP form that I have been using for some time now on a Macbook Pro 
>> running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But this 
>> morning, when I submitted (it is a journaling application) it came up with 
>> the following error: 
>> 
>> No such file or directory 
>> 
>> Can anyone point me in the right direction to fix this? Have you ever seen 
>> this before?
>> 
>> Thanks,
>> 
>> Steve Marquez
> 
> Where exactly did you see this error?
> 
> 1) In your browser when you tried loading the form?
> 2) In your browser when you submitted the form?
> 3) In the error logs of your web server?
> 
> Other questions:
> 
> What type of web server are you running?
> 
> Did your cat stomp on your keyboard?
> 
> Are the files stored locally or are they on a network/remote drive?
> 
> Children doing things they should not be doing? (Happened to me once...)
> 
> Are you accessing the files via http://localhost/... ?? or as a local file?
> 
> -- 
> Jim Lucas
> 
> A: Maybe because some people are too annoyed by top-posting.
> Q: Why do I not get an answer to my question(s)?
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?



RE: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread HallMarc Websites


-Original Message-
From: Jim Lucas [mailto:li...@cmsws.com] 
Sent: Thursday, June 03, 2010 11:38 AM
To: php General List
Cc: Steve Marquez
Subject: Re: [PHP] PHP Form submitting to MySQL not working...

Steve Marquez wrote:
> I am running Apache (not sure which version, where do I find that?) it is
running on a Macbook Pro. 
> The error happened when I submitted the form.

Sorry, should have been more specific.  Where did you see the error?  In
your
browser, error logs of your web server, etc... ?

If this error was displayed in your browser, you should look in your apache
error log file at that corresponding time to see if it has any more
information.

> 
> The MySQL DB is hosted locally on my machine.
> 
> No cat here at the office, no children either, they are all at home.
> 
> :)
> 


-- 
Jim Lucas

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

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


On a side note; yes, as you can see I am still alive and well. Business has
slowed down enough that I had time to actually read a few posts! 

Marc Hall
HallMarc Websites
www.hallmarcwebsites.com

 

__ Information from ESET Smart Security, version of virus signature
database 5169 (20100603) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Shreyas
Steve,

SERVER_SOFTWARE is a variable that will give you which apache version you
are actually using. Just drop a one - liner in a test.php as this :
*
*
*


*
You can look for the above variable. Any other ideas others may have, please
share.


On Thu, Jun 3, 2010 at 9:31 PM, HallMarc Websites <
sa...@hallmarcwebsites.com> wrote:

>
>
> -Original Message-
> From: Jim Lucas [mailto:li...@cmsws.com]
> Sent: Thursday, June 03, 2010 11:38 AM
> To: php General List
> Cc: Steve Marquez
> Subject: Re: [PHP] PHP Form submitting to MySQL not working...
>
> Steve Marquez wrote:
> > I am running Apache (not sure which version, where do I find that?) it is
> running on a Macbook Pro.
> > The error happened when I submitted the form.
>
> Sorry, should have been more specific.  Where did you see the error?  In
> your
> browser, error logs of your web server, etc... ?
>
> If this error was displayed in your browser, you should look in your apache
> error log file at that corresponding time to see if it has any more
> information.
>
> >
> > The MySQL DB is hosted locally on my machine.
> >
> > No cat here at the office, no children either, they are all at home.
> >
> > :)
> >
>
>
> --
> Jim Lucas
>
> A: Maybe because some people are too annoyed by top-posting.
> Q: Why do I not get an answer to my question(s)?
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> On a side note; yes, as you can see I am still alive and well. Business has
> slowed down enough that I had time to actually read a few posts!
>
> Marc Hall
> HallMarc Websites
> www.hallmarcwebsites.com
>
>
>
> __ Information from ESET Smart Security, version of virus signature
> database 5169 (20100603) __
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Regards,
Shreyas


RE: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread HallMarc Websites


-Original Message-
From: Jim Lucas [mailto:li...@cmsws.com] 
Sent: Thursday, June 03, 2010 11:38 AM
To: php General List
Cc: Steve Marquez
Subject: Re: [PHP] PHP Form submitting to MySQL not working...

Steve Marquez wrote:
> I am running Apache (not sure which version, where do I find that?) it is
running on a Macbook Pro. 
> The error happened when I submitted the form.

Sorry, should have been more specific.  Where did you see the error?  In
your
browser, error logs of your web server, etc... ?

If this error was displayed in your browser, you should look in your apache
error log file at that corresponding time to see if it has any more
information.

> 
> The MySQL DB is hosted locally on my machine.
> 
> No cat here at the office, no children either, they are all at home.
> 
> :)
> 


-- 
Jim Lucas

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

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


What did your error log file say? it should tell you the path and the name
of the file that was being called; then go and look to see if the file
exists. 


 

__ Information from ESET Smart Security, version of virus signature
database 5169 (20100603) __

The message was checked by ESET Smart Security.

http://www.eset.com
 


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



Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Jim Lucas
Steve Marquez wrote:
> I am running Apache (not sure which version, where do I find that?) it is 
> running on a Macbook Pro. 
> The error happened when I submitted the form.

Sorry, should have been more specific.  Where did you see the error?  In your
browser, error logs of your web server, etc... ?

If this error was displayed in your browser, you should look in your apache
error log file at that corresponding time to see if it has any more information.

> 
> The MySQL DB is hosted locally on my machine.
> 
> No cat here at the office, no children either, they are all at home.
> 
> :)
> 


-- 
Jim Lucas

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

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



Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Jim Lucas
Steve Marquez wrote:
> Good morning,
> 
> I have a PHP form that I have been using for some time now on a Macbook Pro 
> running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But this 
> morning, when I submitted (it is a journaling application) it came up with 
> the following error: 
> 
> No such file or directory 
> 
> Can anyone point me in the right direction to fix this? Have you ever seen 
> this before?
> 
> Thanks,
> 
> Steve Marquez

Where exactly did you see this error?

1) In your browser when you tried loading the form?
2) In your browser when you submitted the form?
3) In the error logs of your web server?

Other questions:

What type of web server are you running?

Did your cat stomp on your keyboard?

Are the files stored locally or are they on a network/remote drive?

Children doing things they should not be doing? (Happened to me once...)

Are you accessing the files via http://localhost/... ?? or as a local file?

-- 
Jim Lucas

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

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



Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Steve Marquez
Sorry I wasn't specific enough. I'll include the files.http://www.w3.org/TR/html4/loose.dtd";>


Prayer Form






// specify the name of your form
var thisForm = "form1";

// load field names and default values into list
var defaultVals = new Array();
defaultVals[0] = new Array("date", "(Date here)");

// populate fields with default values on page load
function MPLoadDefaults() {
with (document.forms[thisForm]) {
for (var n=0; n





  

  

  
  

  

  
		   
		  


  


  



  


  


'. mysql_error());
?>


  view' WHERE id_num = \"$id_num\"";
		
		$response = mysql_query( $update_data, $dbh );
	if(mysql_error()) die ('database error'. mysql_error());
		
   // and read it back for printing purposes.
   $get_table_data = "SELECT * FROM prayer  where id_num=\"$id_num\";";
   
   $response = mysql_query( $get_table_data, $dbh );

   // now print it out for the user.
   if ( $one_line_of_data = mysql_fetch_array( $response ) ) {
   extract ( $one_line_of_data );
   }
	
?>



Prayer for 










$date";
echo "$prayer";

$query = "SELECT view,date,prayer FROM prayer ORDER BY id_num DESC LIMIT 30";
$result = mysql_query($query) or die("Query failed");

echo "";

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
	extract ( $line );
			$LimitChars = substr("$prayer", 0, 65);

echo "$view - $date";

}
echo "";

?>


I downloaded and installed the iPhone SDK to develop some iPhone apps.This form has worked forever. Perhaps the SDK install did something?Thanks,
-- Steve MarquezMarquez Designe-mail: smarq...@marquez-design.comweb: http://www.marquez-design.comphone: 479-648-0325 

On Jun 3, 2010, at 8:59 AM, Ashley Sheridan wrote:

On Thu, 2010-06-03 at 08:56 -0500, Steve Marquez wrote:

Good morning,

I have a PHP form that I have been using for some time now on a Macbook Pro running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But this morning, when I submitted (it is a journaling application) it came up with the following error: 

No such file or directory 

Can anyone point me in the right direction to fix this? Have you ever seen this before?

Thanks,

Steve Marquez



Do you have any examples of code at all? It sounds like a file it's requiring is missing, but you haven't given the full error there either.




Thanks,
Ash
http://www.ashleysheridan.co.uk









Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Nilesh Govindarajan
On Thu, Jun 3, 2010 at 7:26 PM, Steve Marquez
 wrote:
> Good morning,
>
> I have a PHP form that I have been using for some time now on a Macbook Pro 
> running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But this 
> morning, when I submitted (it is a journaling application) it came up with 
> the following error:
>
> No such file or directory
>
> Can anyone point me in the right direction to fix this? Have you ever seen 
> this before?
>
> Thanks,
>
> Steve Marquez
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

1. Did you do any upgrades recently ?
2. What is your code ?

-- 
Nilesh Govindarajan
Facebook: nilesh.gr
Twitter: nileshgr
Website: www.itech7.com
Cheap and Reliable VPS Hosting: http://j.mp/arHk5e

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



Re: [PHP] PHP Form submitting to MySQL not working...

2010-06-03 Thread Ashley Sheridan
On Thu, 2010-06-03 at 08:56 -0500, Steve Marquez wrote:

> Good morning,
> 
> I have a PHP form that I have been using for some time now on a Macbook Pro 
> running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But this 
> morning, when I submitted (it is a journaling application) it came up with 
> the following error: 
> 
> No such file or directory 
> 
> Can anyone point me in the right direction to fix this? Have you ever seen 
> this before?
> 
> Thanks,
> 
> Steve Marquez


Do you have any examples of code at all? It sounds like a file it's
requiring is missing, but you haven't given the full error there either.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP Form email w/attachment

2008-12-18 Thread Richard Heyes
> thank god that some guys make it
> simple for us ;)

You're welcome. :-)

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 5th)

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



Re: [PHP] PHP Form email w/attachment

2008-12-18 Thread Per Jessen
jeffery harris wrote:

> I need to create a php form and mail it to a recipient (that I can
> do). My question is how do I create an area for a file (.doc, or .pdf)
> to be attached emailed along with other form data as well?
> 

Take a look at an email you've received with an attachment. That's how
you need to format your email-text. 


/Per Jessen, Zürich


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



Re: [PHP] PHP Form email w/attachment

2008-12-17 Thread jeffery harris
Thanks for the info! sweet!!


"Kastner Mario"  wrote in message 
news:200812180603.34938.off...@unite-it.at...
> use a mailer class, for example phpmailer, to handle this. man i say 
> emailing
> could be a very crazy job for an coder. thank god that some guys make it
> simple for us ;)
>
> http://sourceforge.net/projects/phpmailer
>
>
>> I need to create a php form and mail it to a recipient (that I can do). 
>> My
>> question is how do I create an area for a file (.doc, or .pdf) to be
>> attached emailed along with other form data as well?
>>
>> -Jeff
>
> 



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



Re: [PHP] PHP Form email w/attachment

2008-12-17 Thread Kastner Mario
use a mailer class, for example phpmailer, to handle this. man i say emailing 
could be a very crazy job for an coder. thank god that some guys make it 
simple for us ;)

http://sourceforge.net/projects/phpmailer


> I need to create a php form and mail it to a recipient (that I can do). My
> question is how do I create an area for a file (.doc, or .pdf) to be
> attached emailed along with other form data as well?
>
> -Jeff



Re: [PHP] PHP Form email w/attachment

2008-12-17 Thread Bastien Koert
On Wed, Dec 17, 2008 at 11:02 PM, jeffery harris <
jhar...@harris4interactive.com> wrote:

> I need to create a php form and mail it to a recipient (that I can do). My
> question is how do I create an area for a file (.doc, or .pdf) to be
> attached emailed along with other form data as well?
>
> -Jeff
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> You need to allow the user to upload the file first, using the standard
http file upload. After its on the server, use phpmailer to handle the
mailing...easy peasy


-- 

Bastien

Cat, the other other white meat


Re: [PHP] php form help...

2008-01-08 Thread Daniel Brown
On Jan 8, 2008 5:04 PM, Philip Thompson <[EMAIL PROTECTED]> wrote:
> I guess this ruins my impression of you being this 28 y/o
> programmer... grandpa! ;)
>
> Hehehe

No, they just start raising families at a very young age.  Tedd is
only about seven years older than his children.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



Re: [PHP] php form help...

2008-01-08 Thread tedd

At 4:04 PM -0600 1/8/08, Philip Thompson wrote:

On Jan 8, 2008, at 11:52 AM, tedd wrote:
As I tell my grand-kids, half the people you meet everyday are 
below average intelligence.


Cheers,

tedd


I guess this ruins my impression of you being this 28 y/o 
programmer... grandpa! ;)


Yeah, I'm a little old -- but I'm still very good-looking, extremely 
smart and humble.


I'm old enough to remember gas stations where the attendant would 
hand-pump gas up into a glass container and then would gravity feed 
it into your tank. I actually knew people who were alive during the 
civil war. And as everyone knows on this list, I used to program with 
rocks.


But, I now play xbox (Call of Duty 4 rules) and my gamer tag is "special tedd".

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] php form help...

2008-01-08 Thread Philip Thompson

On Jan 8, 2008, at 11:52 AM, tedd wrote:


At 11:17 AM -0600 1/8/08, Jack Mays wrote:

>

You think someone who didn't even know how to get post data in the
first place knows how to properly sanitize it? :)



One would think that the OP would lookup "sanitize" or some form of  
that search in google to become more familiar with the term and  
what it means, but then again I probably give to much credit to  
most of the population :)


--
Jack Mays


As I tell my grand-kids, half the people you meet everyday are below  
average intelligence.


Cheers,

tedd



I guess this ruins my impression of you being this 28 y/o  
programmer... grandpa! ;)


Hehehe

~Phil

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



Re: [PHP] php form help...

2008-01-08 Thread tedd

At 11:17 AM -0600 1/8/08, Jack Mays wrote:

 >

 You think someone who didn't even know how to get post data in the
 first place knows how to properly sanitize it? :)



One would think that the OP would lookup "sanitize" or some form of 
that search in google to become more familiar with the term and what 
it means, but then again I probably give to much credit to most of 
the population :)


--
Jack Mays


As I tell my grand-kids, half the people you meet everyday are below 
average intelligence.


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] php form help...

2008-01-08 Thread Jack Mays

>
> You think someone who didn't even know how to get post data in the
> first place knows how to properly sanitize it? :)
>

One would think that the OP would lookup "sanitize" or some form of that 
search in google to become more familiar with the term and what it 
means, but then again I probably give to much credit to most of the 
population :)


--
Jack Mays

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



Re: [PHP] php form help...

2008-01-08 Thread Daniel Brown
On Jan 8, 2008 12:12 PM, Eric Butera <[EMAIL PROTECTED]> wrote:
> You think someone who didn't even know how to get post data in the
> first place knows how to properly sanitize it? :)

Maybe, maybe not, but the point is to mention that it should be
done to allow further exploration and study to learn how it's done.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



Re: [PHP] php form help...

2008-01-08 Thread Eric Butera
On Jan 8, 2008 12:00 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Jan 8, 2008 11:56 AM, 2 Logic Studios <[EMAIL PROTECTED]> wrote:
> > Daniel,
> >
> > Thanks...worked like a charm
>
> My pleasure.  Just remember to sanitize the code as I said if
> you're going to do anything other than display it in the text box.
> Otherwise, a malicious user (or possibly even a typographical error)
> could lead to problems.
>
>
> --
> Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

You think someone who didn't even know how to get post data in the
first place knows how to properly sanitize it? :)

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



Re: [PHP] php form help...

2008-01-08 Thread Daniel Brown
On Jan 8, 2008 11:56 AM, 2 Logic Studios <[EMAIL PROTECTED]> wrote:
> Daniel,
>
> Thanks...worked like a charm

My pleasure.  Just remember to sanitize the code as I said if
you're going to do anything other than display it in the text box.
Otherwise, a malicious user (or possibly even a typographical error)
could lead to problems.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



Re: [PHP] php form help...

2008-01-08 Thread Daniel Brown
On Jan 8, 2008 11:19 AM, 2 Logic Studios <[EMAIL PROTECTED]> wrote:
> I am trying to create this kind of form 
> http://www.12monthinternetmillionaire.com/affiliate.php
>
> a user inserts their clickbank id and its generated in the field
> belowany pointers ?

Yes.  Hire a programmer.  ;-P

In actuality, it could be done with JavaScript.  However, because
JS won't modify the server settings, if you want to store the
ClickBank ID in a database, have it emailed, or whatever else, here's
the snippet of PHP code to generate the URL as they have it:

http://".$_POST['clickbank_id'].".12monthmil.hop.clickbank.net";
// Perform whatever other actions you want here, but remember to
SANITIZE the $_POST data!
}
?>

ClickBank ID:






-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



Re: [PHP] PHP Form isnt emailing me

2007-06-10 Thread Richard Lynch
if (preg_match("|\r\n|", $_POST['email'])){
  die("Spammer.");
}
if (preg_match("|\r\n|", $_POST['subject'])){
  die("Spammer.");
}
//and so on for anything you put into headers.
//body can contain newlines, of course.

On Sat, June 9, 2007 8:22 pm, Austin C wrote:
> how can I tell them not to include new lines?
>
> On 6/9/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>>
>> The return value of http://php.net/mail only says whether or not PHP
>> managed to queue up the email to go out.
>>
>> It does *NOT* imply that the email actually went anywhere.
>>
>> If your server isn't running through the queues and sending the
>> emails, they don't go out.
>>
>> If your server is rejecting the emails as it runs through the queue,
>> they don't go out.
>>
>> If your mail reader is marking them as spam and trashing them before
>> you see them, they went out, but you never got them.
>>
>> *ALSO*, and this is aboslutely crucial, if you DO get email to go
>> out,
>> you've just built an OPEN RELAY that will cheerfully send out
>> MILLIONS
>> of spam mail!  DON'T DO THAT!!!
>>
>> The problem is that a Bad Guy can put something like this in
>> POST['contact']:
>>
>> "[EMAIL PROTECTED]>
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> [EMAIL PROTECTED]
>> .
>> .
>> .
>> [EMAIL PROTECTED]
>> <[EMAIL PROTECTED]"
>>
>> YOUR email script will then spew the same message to 1000 users!
>>
>> You need to sanitize user input -- Emails and names, for example,
>> should NOT contain newlines.
>>
>> On Fri, June 8, 2007 8:48 pm, Austin C wrote:
>> > Hello, I just finished making a PHP contact form for my webite,
>> and I
>> > can
>> > run through the whole thing, and get no errors, but it doesnt
>> email me
>> > the
>> > form contents.
>> >
>> > *Here is th actual form page:*
>> > 
>> >Contact
>> > Me
>> >   
>> >  
>> >  
>> > 
>> > 
>> > 
>> >  
>> >  
>> > Please use this form to contact me:
>> > 
>> > 
>> > Name: 
>> > Email Address/Method of Contact: > name="contact"
>> > size="30">
>> > Reason for Contact: 
>> > Question
>> > Suggestion
>> > General Comment
>> > Fan Mail
>> > Other
>> > 
>> > Message: > > cols="30">
>> > 
>> > 
>> > 
>> >
>> > *Here is the form page processor:*
>> > 
>> >  
>> >  
>> >  Processing your information . .
>> > .
>> >
>> >   
>> >   
>> >  
>> >  
>> >  > bgcolor="#BFC4CB">
>> >   
>> >   > color="#33">
>> >  > >  $name = $_POST['name'];
>> >  $email = $_POST['contact'];
>> >  $reason = $_POST['reasonforcontact'];
>> >  $message = $_POST['message1'];
>> >
>> >  $to = "[EMAIL PROTECTED]";
>> >
>> >  $subject = "Contact Form Submitted at GWD-Dev";
>> >
>> >  $body = "Hello Austin,
>> >
>> >  ".$name." has sent in a contact form at GWD-Dev. The reason
>> he/she
>> > contacted you was for ".$reason.". Here is the message they
>> submitted
>> > with
>> > their form:
>> >
>> >
>> >
>> >  ".$message."
>> >
>> >  The contact field of the form contained the following
>> information:
>> > ".$email."
>> >  Please remember to get back to them ASAP!!";
>> >
>> >  $headers = "From: ".$name." <".$email.">\n";
>> >
>> >
>> >
>> >  echo "Collecting information . . . . . . . . . . DONE!";
>> >
>> >  $mail_sent = @mail($to, $subject, $body, $headers);
>> >
>> >  echo $mail_sent ? "Sending contact form to webmaster . . . .
>> . .
>> > . .
>> > DONE!" : "alert('The mail did not go
>> through')";
>> >
>> >
>> >  echo ". . . . . . . . . . . . . . . . . . . . . . . . . . . .
>> . .
>> > . . .
>> > . . . .";
>> >
>> >  echo "Thank you for contacting us, please expect a reply in
>> > anywhere
>> > from 1 to 24 hours. Make sure that our email address,
>> > [EMAIL PROTECTED]&
>> > [EMAIL PROTECTED], are not sent to your spam
>> folder.";
>> >
>> >
>> >  include("../footer.php"); ?>
>> >
>> > --
>> > Thanks, the webmaster of Galacticneo
>> >
>>
>>
>> --
>> Some people have a "gift" link here.
>> Know what I want?
>> I want you to buy a CD from some indie artist.
>> http://cdbaby.com/browse/from/lynch
>> Yeah, I get a buck. So?
>>
>>
>
>
> --
> Thanks, the webmaster of Galacticneo
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] PHP Form isnt emailing me

2007-06-09 Thread Richard Lynch
The return value of http://php.net/mail only says whether or not PHP
managed to queue up the email to go out.

It does *NOT* imply that the email actually went anywhere.

If your server isn't running through the queues and sending the
emails, they don't go out.

If your server is rejecting the emails as it runs through the queue,
they don't go out.

If your mail reader is marking them as spam and trashing them before
you see them, they went out, but you never got them.

*ALSO*, and this is aboslutely crucial, if you DO get email to go out,
you've just built an OPEN RELAY that will cheerfully send out MILLIONS
of spam mail!  DON'T DO THAT!!!

The problem is that a Bad Guy can put something like this in
POST['contact']:

"[EMAIL PROTECTED]>
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
.
.
.
[EMAIL PROTECTED]
<[EMAIL PROTECTED]"

YOUR email script will then spew the same message to 1000 users!

You need to sanitize user input -- Emails and names, for example,
should NOT contain newlines.

On Fri, June 8, 2007 8:48 pm, Austin C wrote:
> Hello, I just finished making a PHP contact form for my webite, and I
> can
> run through the whole thing, and get no errors, but it doesnt email me
> the
> form contents.
>
> *Here is th actual form page:*
> 
>Contact
> Me
>   
>  
>  
> 
> 
> 
>  
>  
> Please use this form to contact me:
> 
> 
> Name: 
> Email Address/Method of Contact:  size="30">
> Reason for Contact: 
> Question
> Suggestion
> General Comment
> Fan Mail
> Other
> 
> Message:  cols="30">
> 
> 
> 
>
> *Here is the form page processor:*
> 
>  
>  
>  Processing your information . .
> .
>
>   
>   
>  
>  
>  
>   
>   
>$name = $_POST['name'];
>  $email = $_POST['contact'];
>  $reason = $_POST['reasonforcontact'];
>  $message = $_POST['message1'];
>
>  $to = "[EMAIL PROTECTED]";
>
>  $subject = "Contact Form Submitted at GWD-Dev";
>
>  $body = "Hello Austin,
>
>  ".$name." has sent in a contact form at GWD-Dev. The reason he/she
> contacted you was for ".$reason.". Here is the message they submitted
> with
> their form:
>
>
>
>  ".$message."
>
>  The contact field of the form contained the following information:
> ".$email."
>  Please remember to get back to them ASAP!!";
>
>  $headers = "From: ".$name." <".$email.">\n";
>
>
>
>  echo "Collecting information . . . . . . . . . . DONE!";
>
>  $mail_sent = @mail($to, $subject, $body, $headers);
>
>  echo $mail_sent ? "Sending contact form to webmaster . . . . . .
> . .
> DONE!" : "alert('The mail did not go through')";
>
>
>  echo ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> . . .
> . . . .";
>
>  echo "Thank you for contacting us, please expect a reply in
> anywhere
> from 1 to 24 hours. Make sure that our email address,
> [EMAIL PROTECTED]&
> [EMAIL PROTECTED], are not sent to your spam folder.";
>
>
>  include("../footer.php"); ?>
>
> --
> Thanks, the webmaster of Galacticneo
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] PHP Form Help

2006-04-06 Thread tedd

At 7:01 PM -0700 4/5/06, Jai Rangi wrote:

Greeting,
I hope this is the right place for this. If not please guide me.
I am having problem with my "Form". Code is below. I want to 
generate an error message if the required fields are not filled. If 
they are filled then I want to add them to the database and display 
the form again to make another entry. Database part is working fine. 
But when it exist with an error for blank entry, it wipe out all the 
values the user has entered, how can I save user input in case user 
does not have to enter all the values again.

Thank you for help.



You might want to review:

http://www.weberdev.com/get_example-320.html

http://www.weberdev.com/get_example-4321.html

tedd


--

http://sperling.com

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



Re: [PHP] PHP Form Help

2006-04-05 Thread Chris

Jai Rangi wrote:

Dear Chris,
Thank you for your response. I will make sure to start a new thread for 
future.


I tried this but it did not work

if (isset($_POST['title'])) {
 $title = htmlentities($_POST['title']);
   echo $title;
} else {
 $title = '';
}

This part of my code seems to be the problem, Though I dont know why.
if (isset($message))
 {
   echo "{$message} ";
   echo "You are logged in $user";

?>
Cause if change the if statement to
if (!isset($message))
the values are saved. But I need this to display the message..

if (empty($title) || empty($Email) || empty($Phone) || empty($Details) 
|| empty($Keywords) || empty($City))

{
$message = "Please fill all the required fields.";
   // Now, redirect the browser to the current page
  session_start();
header("Location: form.php?message=" . urlencode($message));
   exit;
}
Here is my structure..
//check is there is any message, which I expect to have when the user 
come on this page. Then show the user form

if (isset($message))
 {


If it's in the url, it should be $_GET['message'] - something like this:

if (isset($_GET['message'])) {
  echo htmlentities($_GET['message']);
}

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] PHP Form Help

2006-04-05 Thread Jai Rangi

Dear Chris,
Thank you for your response. I will make sure to start a new thread for 
future.


I tried this but it did not work

if (isset($_POST['title'])) {
 $title = htmlentities($_POST['title']);
   echo $title;
} else {
 $title = '';
}

This part of my code seems to be the problem, Though I dont know why.
if (isset($message))
 {
   echo "{$message} ";
   echo "You are logged in $user";

?>
Cause if change the if statement to
if (!isset($message))
the values are saved. But I need this to display the message..

if (empty($title) || empty($Email) || empty($Phone) || empty($Details) 
|| empty($Keywords) || empty($City))

{
$message = "Please fill all the required fields.";
   // Now, redirect the browser to the current page
  session_start();
header("Location: form.php?message=" . urlencode($message));
   exit;
}
Here is my structure..
//check is there is any message, which I expect to have when the user 
come on this page. Then show the user form

if (isset($message))
 {
   echo "{$message} ";
   echo "You are logged in $user";

?>
HTML CODE FOR FORM..
if (empty($title) || empty($Email) || empty($Phone) || empty($Details) 
|| empty($Keywords) || empty($City) || empty($State) || empty($ZIP) || 
empty($Type))

{
 $message = "Please fill all the required fields.";
// Now, redirect the browser to the current page
   session_start();
 header("Location: form.php?message=" . urlencode($message));
   exit;
}

here is the code to insert the entries into the database..
where it goes back to the same page for each error message
header("Location: form.php?message=" . urlencode($message));
   exit;
Or come back to the same page with a valid message for another entry..


}//end of else...

?> end of php code

I am confused what I am doing wrong..
Again thank for your response.

-Jai



Chris wrote:


Jai Rangi wrote:


Greeting,
I hope this is the right place for this. If not please guide me.
I am having problem with my "Form". Code is below. I want to generate 
an error message if the required fields are not filled. If they are 
filled then I want to add them to the database and display the form 
again to make another entry. Database part is working fine. But when 
it exist with an error for blank entry, it wipe out all the values 
the user has entered, how can I save user input in case user does not 
have to enter all the values again.

Thank you for help.



Start a new thread next time please - don't reply to an existing 
thread. It makes it really hard to follow.


>Main Keywords for this 
search: * size=60>



You're not including the post values.

It should be something like:




or you could check everything before hand:

if (isset($_POST['Keywords'])) {
  $keywords = htmlentities($_POST['Keywords']);
} else {
  $keywords = '';
}

...
size=60>

...



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



Re: [PHP] PHP Form Help

2006-04-05 Thread Chris

Jai Rangi wrote:

Greeting,
I hope this is the right place for this. If not please guide me.
I am having problem with my "Form". Code is below. I want to generate an 
error message if the required fields are not filled. If they are filled 
then I want to add them to the database and display the form again to 
make another entry. Database part is working fine. But when it exist 
with an error for blank entry, it wipe out all the values the user has 
entered, how can I save user input in case user does not have to enter 
all the values again.

Thank you for help.


Start a new thread next time please - don't reply to an existing thread. 
It makes it really hard to follow.


>Main Keywords for this 
search: * size=60>


You're not including the post values.

It should be something like:

..size=60>..


or you could check everything before hand:

if (isset($_POST['Keywords'])) {
  $keywords = htmlentities($_POST['Keywords']);
} else {
  $keywords = '';
}

...

...

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] PHP form not working

2005-08-02 Thread hope


u can also work out like this:


$email_err ="Please enter your email address!/span>/>";


$message_err = "Please enter a message!";



this wil also work perfectly alrite.

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



Re: [PHP] PHP form not working

2005-07-28 Thread Matt Zandstra
Pasting your page onto my server and commenting out your includes the 
following lines stand out:


$email_err ="Please enter your email address!";
$message_err = "Please enter a message!";

You have quotes within quotes here. You should either escape the inner 
quotes or use single quotes to define your string. So this will work:


$email_err ="Please enter your email address!";
$message_err = "Please enter a message!";

or this will work:

$email_err ='Please enter your email address!';
$message_err = 'Please enter a message!';

The latter is slightly more efficient, but you won't notice the difference.

Incidentally, you should consider separating your presentation from your logic 
a little more, but that's a whole other issue.

HTH

Matt





On Thu, 28 Jul 2005, Bruce Gilbert wrote:


Here is the entire code on the page. Now I am getting an error again...


SNIP


$email_err ="Please enter your email 
address!";
$send= "no";
}
//check value of $_POST['message']
if ($POST['message'] =="") {
$message_err = "Please enter a message!";


SNIP




http://inspired-evolution.com/Contact_Form_test.php

error is on line 52


--
getInstance()
http://www.getinstance.com

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



Re: [PHP] PHP form POST question

2005-01-09 Thread James \(IFMS\)
When you access /foo, the server will redirect the client to /foo/ 
(because it is a directory). At the redirected page, the post data will 
not be sent again by the browser thus there are no _POST values.

Try using action="/foo/". That may work.
Yes, /foo/ does work.
The explanation makes sense.
Bugger! All that time spent banging my head against the wall. :-)
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP form POST question

2005-01-09 Thread Tom Rogers
Hi,

Monday, January 10, 2005, 12:04:28 PM, you wrote:
JI> I just narrowed something down about forms and POST and would like 
JI> education. In the following scenarios, all work except #4. $_POST is 
JI> null. Why is that?

JI> Setup:
JI> 1) Running on localhost
JI> 2) /foo/index.php has the following:
JI> 
JI> 3) /index.php contends vary per scenario (below)

JI> Running RHEL 3, all updates (PHP 4.3.2).

JI> SCENARIO 1:
JI> /index.php contains the following:

JI> 
JI> 
JI> 

JI> In this case in /foo/index.php $_GET has the right value, i.e.
array('foobutton' =>> '');

JI> SCENARIO 2:
JI> /index.php contains the following:

JI> 
JI> 
JI> 

JI> In this case in /foo/index.php $_GET has the right value, i.e.
array('foobutton' =>> '');

JI> SCENARIO 3:
JI> /index.php contains the following:

JI> 
JI> 
JI> 

JI> In this case in /foo/index.php $_POST has the right value, i.e.
array('foobutton' =>> '');

JI> SCENARIO 4:
JI> /index.php contains the following:

JI> 
JI> 
JI> 

JI> In this case in /foo/index.php $_POST is NULL.

JI> HUH? Why is $_POST empty? Is Apache doing something to kill the form's 
JI> post information when it has to resolve /foo to /foo/index.php?


If you do a post to just the domain name apache does a redirect to 
/foo/index.php
losing the post info.

-- 
regards,
Tom

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



Re: [PHP] PHP form POST question

2005-01-09 Thread Leon Poon
When you access /foo, the server will redirect the client to /foo/ (because 
it is a directory). At the redirected page, the post data will not be sent 
again by the browser thus there are no _POST values.

Try using action="/foo/". That may work.

- Original Message - 
From: "James (IFMS)" <[EMAIL PROTECTED]>
To: 
Sent: Monday, January 10, 2005 10:04 AM
Subject: [PHP] PHP form POST question


I just narrowed something down about forms and POST and would like 
education. In the following scenarios, all work except #4. $_POST is null. 
Why is that?

Setup:
1) Running on localhost
2) /foo/index.php has the following:
   
3) /index.php contends vary per scenario (below)
Running RHEL 3, all updates (PHP 4.3.2).
SCENARIO 1:
/index.php contains the following:



In this case in /foo/index.php $_GET has the right value, i.e.
array('foobutton' => '');
SCENARIO 2:
/index.php contains the following:



In this case in /foo/index.php $_GET has the right value, i.e.
array('foobutton' => '');
SCENARIO 3:
/index.php contains the following:



In this case in /foo/index.php $_POST has the right value, i.e.
array('foobutton' => '');
SCENARIO 4:
/index.php contains the following:



In this case in /foo/index.php $_POST is NULL.
HUH? Why is $_POST empty? Is Apache doing something to kill the form's 
post information when it has to resolve /foo to /foo/index.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] PHP Form Field Validation

2004-07-19 Thread Marcus Strube
> If (formfieldname = empty())

[snip]
$value = "0";

if(true==empty($value)) {
echo "it's empty";
}
[/snip]

May be good to know.

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



Re: [PHP] PHP Form Field Validation

2004-07-18 Thread Jason Barnett
if (empty($_REQUEST['formfieldname'])) {
  //do something
} else {
  //do something else
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Form Field Validation

2004-07-18 Thread Jason Wong
On Monday 19 July 2004 07:34, Harlequin wrote:
> Simple as that eh...?
>
> If (formfieldname = empty())

The canonical form is:

  if (empty($doo)) { ... }

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The decision doesn't have to be logical; it was unanimous.
*/

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



Re: [PHP] PHP Form Field Validation

2004-07-18 Thread Comex
not enough =s.

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



Re: [PHP] PHP Form Field Validation

2004-07-18 Thread Harlequin
Simple as that eh...?

If (formfieldname = empty())

{

Do something

{

Else

{

do something else

}

??? am I on the right tracks...?


-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Harlequin wrote:
>
> > Just wondering if there's a quick and easy way to validate form fields
using
> > PHP.
> >
> > Not really that concerned with actual content by using REGEX but want to
> > ensure users have at-least bothered to put something in and if not
display
> > an error with the form field's name maybe.
>
> empty()
>
> -- 
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com


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



Re: [PHP] PHP Form Field Validation

2004-07-18 Thread John W. Holmes
Harlequin wrote:
Just wondering if there's a quick and easy way to validate form fields using
PHP.
Not really that concerned with actual content by using REGEX but want to
ensure users have at-least bothered to put something in and if not display
an error with the form field's name maybe.
empty()
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHP form to fax?

2003-12-03 Thread J J
Does anyone use this service with PHP and would it be
possible to see some sample code on how you format the
email/message to their server?

I couldn't find any information on PHP and utilizing
their service, or how the message needs to be
formatted.

Thanks!


--- Jeff McKeon <[EMAIL PROTECTED]> wrote:
> There are plenty of commercial email to fax
> providers out here like
> jfax.  If an email is formatted correctly and sent
> to the your jfax
> address, jfax will parse out the fax number and then
> send the email
> contents as a fax.  It works in reverse as well. 
> Any fax to your jfax
> number (you can get them worldwide) is turned into
> an image and emailed
> to you as an attachment.
> > > 
> > -Original Message-
> > From: J J [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, September 25, 2003 2:49 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] PHP form to fax?
> > 
> > 
> > I know in the past it wasn't possible to do
> something
> > like have a user fill out a web form and that
> > information would then be sent to a fax machine. 
> This
> > would require some sort of dialing abilities on
> the
> > server.
> > 
> > Is there anything available today that could
> perform
> > such a function possibly within PHP?  With all the
> IP
> > telephony abilities, I figured maybe something is
> > available now.
> > 
> > I'd like to have the option to send web form
> > information to email or fax.  Email isn't a
> problem
> > but fax I'm kind of stuck.
> > 
> > Any ideas?
> > 

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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



Re: [PHP] PHP form to fax?

2003-09-27 Thread Becoming Digital
> There are also plenty of subscription type email-fax gateway services that you 
> can integrate with PHP.

Jason touched on the easiest solution: email to fax.  You can use PHP to send the 
email, at which point it will be converted to fax.  Simply add a layer of code such 
that if your user chooses to send via fax, the message is transparently relayed to the 
email/fax gateway.

Edward Dudlik
Becoming Digital
www.becomingdigital.com



- Original Message - 
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, 25 September, 2003 15:16
Subject: Re: [PHP] PHP form to fax?


On Friday 26 September 2003 02:48, J J wrote:
> I know in the past it wasn't possible to do something
> like have a user fill out a web form and that
> information would then be sent to a fax machine.  This
> would require some sort of dialing abilities on the
> server.

Still does.

> Is there anything available today that could perform
> such a function possibly within PHP?  With all the IP
> telephony abilities, I figured maybe something is
> available now.

The closest equivalent to that would be to print via IPP. But I doubt whether 
many people are set up for that.

> I'd like to have the option to send web form
> information to email or fax.  Email isn't a problem
> but fax I'm kind of stuck.

For a free solution that has reasonable world-wide coverage, check 
www.tpc.int.

There are also plenty of subscription type email-fax gateway services that you 
can integrate with PHP.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
QOTD:
"He's on the same bus, but he's sure as hell got a different
ticket."
*/

-- 
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] PHP form to fax?

2003-09-25 Thread Jason Wong
On Friday 26 September 2003 02:48, J J wrote:
> I know in the past it wasn't possible to do something
> like have a user fill out a web form and that
> information would then be sent to a fax machine.  This
> would require some sort of dialing abilities on the
> server.

Still does.

> Is there anything available today that could perform
> such a function possibly within PHP?  With all the IP
> telephony abilities, I figured maybe something is
> available now.

The closest equivalent to that would be to print via IPP. But I doubt whether 
many people are set up for that.

> I'd like to have the option to send web form
> information to email or fax.  Email isn't a problem
> but fax I'm kind of stuck.

For a free solution that has reasonable world-wide coverage, check 
www.tpc.int.

There are also plenty of subscription type email-fax gateway services that you 
can integrate with PHP.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
QOTD:
"He's on the same bus, but he's sure as hell got a different
ticket."
*/

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



Re: [PHP] PHP form help

2003-02-19 Thread Steven M
Thanks Ray but i've found the problem and sorted it.  :-)

Steven M



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




Re: [PHP] PHP form help

2003-02-19 Thread Steven M
Hi Johnathan

Thanks I've got it now, hidden fields did the trick. :-)

Steven M
"Jonathan Villa" <[EMAIL PROTECTED]> wrote in message
004301c2d851$24ac2fd0$8600a8c0@inhocvince">news:004301c2d851$24ac2fd0$8600a8c0@inhocvince...
> How is the information being kept?  Sessions?  You'll either want to
> store them in a session or create hidden fields on the confirmation
> page, then when they click on confirm, you'll have access to the fields
> on the new page, (the page where your processing script is)
>
>
> ---> Jonathan
>
>
>
>
> -Original Message-
> From: Steven M [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 19, 2003 2:15 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP form help
>
> Hi,
>
> I have created a form that passes details to the next page so the user
> can
> see the details they have submitted before clicking confirm to submit to
> the
> database.  The problem is that the details dont seem to get passed to
> the
> script after they have appeared on the confirmation page.  I know the
> script
> works because i submitted info to is successfully before i changed the
> form
> action to point at the confirmation page.
>
> I think it has something to do with PHP sessions but am not sure how to
> make
> it work.  Thanks for any help.
>
> Steven M
>
>
>
>
>
> --
> 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] PHP form help

2003-02-19 Thread Ray Hunter
Please provide more information...ie source code so we can find the
problem.

Ray


On Wed, 2003-02-19 at 13:14, Steven M wrote:
> Hi,
> 
> I have created a form that passes details to the next page so the user can
> see the details they have submitted before clicking confirm to submit to the
> database.  The problem is that the details dont seem to get passed to the
> script after they have appeared on the confirmation page.  I know the script
> works because i submitted info to is successfully before i changed the form
> action to point at the confirmation page.
> 
> I think it has something to do with PHP sessions but am not sure how to make
> it work.  Thanks for any help.
> 
> Steven M
> 
> 
> 
> 
> 
> -- 
> 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] PHP form help

2003-02-19 Thread Jonathan Villa
How is the information being kept?  Sessions?  You'll either want to
store them in a session or create hidden fields on the confirmation
page, then when they click on confirm, you'll have access to the fields
on the new page, (the page where your processing script is)

 
---> Jonathan
 
 
 

-Original Message-
From: Steven M [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 19, 2003 2:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP form help

Hi,

I have created a form that passes details to the next page so the user
can
see the details they have submitted before clicking confirm to submit to
the
database.  The problem is that the details dont seem to get passed to
the
script after they have appeared on the confirmation page.  I know the
script
works because i submitted info to is successfully before i changed the
form
action to point at the confirmation page.

I think it has something to do with PHP sessions but am not sure how to
make
it work.  Thanks for any help.

Steven M





-- 
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] Php Form Issue

2002-11-16 Thread Justin French
Hi,

on 17/11/02 7:58 AM, Keith Spiller ([EMAIL PROTECTED]) wrote:

> Does anyone have an idea how I can make the php script gather all the multiple
> &browser=lynx&browser=mosaic&browser=explorer
> instead of only the last entry?

That URL is like writing:



And expecting that $foo contains both betty AND bob.  It's just not the way
the GET variables work.

Post your JS to a JS list/forum, and tell them you need to have the
checkboxes names something[] -- hopefully someone will be abel to spot the
glitch with ease.


Justin French

http://Indent.com.au
Web Developent & 
Graphic Design



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




Re: [PHP] Php Form Issue

2002-11-16 Thread John Nichel
Put the brackets for php...



Now, to loop through the elements in JavaScript, you're going to have to 
do something like this

var test = false;
for ( i = 0; i < document.forms[0].elements['myname[]'].length; i++ )
	//code for whatever you want to do here
	//if you want to check if at least one of the boxes are checked
	if ( document.forms[0].elements['myname[]'][i].checked ) {
		test = true;
	}
}

then you can just check to see if "test" is true or false...true if at 
least on box has been checked, false if none of the boxes have been checked.

HTH

Keith Spiller wrote:
Hello,

I've managed to get a series of javascripts to work exactly as I wanted.
They check all and uncheck all checkboxes with a single click of a control checkbox.

Unfortunately, the information has to be sent to php.  As soon as I add the [] brackets to
an input name, the javascript no longer functions.  I'll look up a javascript mailing list next,
but I figured there must be some other way to get php to recieve the data and convert it
to an array.

Does anyone have an idea how I can make the php script gather all the multiple
&browser=lynx&browser=mosaic&browser=explorer
instead of only the last entry?

Thanks for any help,


Keith




--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


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




Re: [PHP] Php Form Issue

2002-11-16 Thread David Rice
Hi Keith:


Unfortunately, the information has to be sent to php.  As soon as I 
add the [] brackets to
an input name, the javascript no longer functions.  I'll look up a 
javascript mailing list next,
but I figured there must be some other way to get php to recieve the 
data and convert it
to an array.

If your checkboxes all have the same name i.e. group, then for php to 
see them, you have to name them group[].
Then you can use something like this to get them out of the array:

if (count($group) > 0){
	for($i=0; $i < count($group); $i++) {
		$sql  = "INSERT INTO groupImage VALUES ";
		$sql .= "(0, '$imageID', '$group[$i]')";
		mysql_query($sql) or die(mysql_error());
		//echo "linked \"$imageName\" to groupID=".$group[$i]."  in gi 
table";
	}
}
you might have to change the js.
If you are accessing form elements in js then you can use something 
like:
forms.elements['group[]']
to access the js checkbox array by name.

Does anyone have an idea how I can make the php script gather all the 
multiple
&browser=lynx&browser=mosaic&browser=explorer
instead of only the last entry?

AFAIK varName[] is the only way to go if you want the checkboxes in an 
array.

I suppose you could just give a unique name to each checkbox.
I believe that PHP will have a value for those checkboxes that are 
checked.
Then you could loop through your set of checkbox vars and see which 
have a value.

HTH

David


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



Re: [PHP] php form mail - checkbox problem

2002-10-30 Thread Marek Kilimajer


Tine wrote:


Greetings,

Forgive my newbism here, but I am having a hard time recieving check(box)ed
items from a form sent to e-mail using PHP.

The code is as follows:

//Routine for checkboxes

$MailBody .="Type medlemskap : ";

$items = 2;  //initiate possible # of items

for ($i = 1; $i <= $items; $i++) {  //loop on # of items

$MailBody .= "$medlemskap[$i], ";  //put results in variable MailBody


where is $medlemskap set? is it comming from the form? you might then 
need to use
$_REQUEST[medlemskap][$i] instead. It might be also simpler to use
foreach($_REQUEST['medlemskap'] as $v) {
   $MailBody .= "$v, ";
}

}

..and the html code put in the form is:


hovedmedlemskap [200 kr.]

2 eller flere i samme husholdning [100 kr.]
 

why are you using two different names for variables (item_1 and item_2)? 
should not it be
name="medlemskap[]"

The problem is, when I recieve the form as email, it just shows the checked
item(s) as:  ",,"
(without the quotemarks)

What am I doing wrong? I am using the script found here:
http://www.grenadine.net/php/NadForm/NadForm_en.html

Website where my form is located is here:
http://komposlo.inmono.net/m_skap.html

Help is very much appreciated!

Thanks in advance,
Tine




 



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




Re: [PHP] php form mail - checkbox problem

2002-10-29 Thread Tine

> Please don't answer with "Tried that" without showing us your new HTML and
code
> Show us the new code.

Sorry - found my mistake. I had forgotten to include a hidden input field
:oO




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




Re: [PHP] php form mail - checkbox problem

2002-10-29 Thread Tine

"Rick Emery" <[EMAIL PROTECTED]> wrote in message
news:03f901c27f5a$2bab0e50$0500a8c0@;honeybee...
> What is $medlemskap[]???

? I just modified it from the default code:

//Routine for checkboxes

 $MailBody .="Question 8 : ";

$items = 3;  //initiate possible # of items

for ($i = 1; $i <= $items; $i++) {  //loop on # of items

 $MailBody .= "$champ8[$i], ";  //put results in variable MailBody
}


---


> You MUST refer to item_1[].

> Also, I believe you REALLY meant that all values be accessed through an
array; therefore
> the "name=" parameter in your HTML must all be the SAME name:
>
> 
>  hovedmedlemskap [200 kr.]
> 
> 2 eller flere i samme husholdning [100 kr.]

Tried that, same same. Still not working :oO


> - Original Message -
> From: "Tine" <[EMAIL PROTECTED]>
> To: <>
> Sent: Tuesday, October 29, 2002 8:34 AM
> Subject: [PHP] php form mail - checkbox problem
>
>
> Greetings,
>
> Forgive my newbism here, but I am having a hard time recieving
check(box)ed
> items from a form sent to e-mail using PHP.
>
> The code is as follows:
>
> //Routine for checkboxes
>
>  $MailBody .="Type medlemskap : ";
>
> $items = 2;  //initiate possible # of items
>
> for ($i = 1; $i <= $items; $i++) {  //loop on # of items
>
>  $MailBody .= "$medlemskap[$i], ";  //put results in variable MailBody
> }
>
> ..and the html code put in the form is:
>
>  
>  hovedmedlemskap [200 kr.]
> 
> 2 eller flere i samme husholdning [100 kr.]
>
> The problem is, when I recieve the form as email, it just shows the
checked
> item(s) as:  ",,"
> (without the quotemarks)
>
> What am I doing wrong? I am using the script found here:
> http://www.grenadine.net/php/NadForm/NadForm_en.html
>
> Website where my form is located is here:
> http://komposlo.inmono.net/m_skap.html
>
> Help is very much appreciated!
>
> Thanks in advance,
> Tine
>
>
>
>
> --
> 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] PHP Form and Arrays help

2002-09-24 Thread Geoff

If I remember correctly checkboxes literally do not exist on the posted
pages if they don't get checked on the form page. So maybe you can use
isset or something like that to see if the checkbox exists if so make it
checked if not show it unchecked.

Hope that helps.

On Tue, 2002-09-24 at 11:24, Tom Ray wrote:
> I'm having a small problem with a form I'm designing and I hope someone can
> point me in the right direction here. The form's function is rather simple
> actaully. It's supposed to take the information, run through it to make sure
> all the required fields have data in them, if there is a blank required field
> it is supposed to redraw the form showing the field missed but also store the
> data that was already submitted so you don't have to fill the form out all over
> again. Now I have it so it stores the values of text boxes, drop down menus and
> radio buttons but I'm having a real tough time with the check box values.
> Example of what I'm doing: (Gender Selection with Radio Buttons). 
> 
> I declare an array in my PHP by doing 
> $genderarray=array();
> 
> Then I store the value of the form for the redraw like so:
> $mygender=$HTTP_POST_VARS[gender];
> $genderarray[$mygender]="checked";
> 
> In the actaul form I decalre a global:
> global genderarray();
> 
> And under the gender selection I have:
> " >
> (works the same for the Female)
> 
> Now my question is how can I do this with check boxes. I thought I could
> through them all into a single array, then pull out the ones who have values to
> them, but that's not working the way I thought.
> 
> Any thoughts or suggestions?
> 
> -- 
> 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] PHP Form and Arrays help

2002-09-24 Thread Marek Kilimajer

Use either session to "remember" the checkboxes' name/value pairs or 
hidden fields.

Tom Ray wrote:

>I'm having a small problem with a form I'm designing and I hope someone can
>point me in the right direction here. The form's function is rather simple
>actaully. It's supposed to take the information, run through it to make sure
>all the required fields have data in them, if there is a blank required field
>it is supposed to redraw the form showing the field missed but also store the
>data that was already submitted so you don't have to fill the form out all over
>again. Now I have it so it stores the values of text boxes, drop down menus and
>radio buttons but I'm having a real tough time with the check box values.
>Example of what I'm doing: (Gender Selection with Radio Buttons). 
>
>I declare an array in my PHP by doing 
>$genderarray=array();
>
>Then I store the value of the form for the redraw like so:
>$mygender=$HTTP_POST_VARS[gender];
>$genderarray[$mygender]="checked";
>
>In the actaul form I decalre a global:
>global genderarray();
>
>And under the gender selection I have:
>" >
>(works the same for the Female)
>
>
>Now my question is how can I do this with check boxes. I thought I could
>through them all into a single array, then pull out the ones who have values to
>them, but that's not working the way I thought.
>
>Any thoughts or suggestions?
>
>
>  
>


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




Re: [PHP] PHP form port

2002-08-10 Thread Analysis & Solutions

On Sat, Aug 10, 2002 at 09:14:03AM -0700, Daniel Guerrier wrote:
> How do i execute a form post with php?
> I want to validate CCard info etc.. then perform the
> post with no furtheraction from the user.
> 
> Basically If not valid stay here and show whats wrong
> ELSE post form to process.php

Don't.  Put the whole procedure into one script.  In the first step, do 
the validation, if it's bad, tell the people so and exit.  If it's okay, 
continue the processing.

This will make things easier to control and work reliably.  Forwarding
post information can lead to a variety of difficulties such as strange
behavior when people hit the back button, odd timeouts, let alone, people 
could play games and go directly to process.php without doing the 
validation step... among other things.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] PHP form port

2002-08-10 Thread Matt

>From: "Daniel Guerrier" <[EMAIL PROTECTED]>
>Sent: Saturday, August 10, 2002 12:14 PM
>Subject: [PHP] PHP form port


> How do i execute a form post with php?
> I want to validate CCard info etc.. then perform the
> post with no furtheraction from the user.
>
> Basically If not valid stay here and show whats wrong
> ELSE post form to process.php

Sorry, I mis-understood your question.  PHP is server-side, so you have to
post the form to validate.  The way I handle the situation you have is to
have the same script process the form for both the initial request
(method=get) and the form post (method=post).

If 'POST' == $_SERVER['REQUEST_METHOD'], then validate.
  If validation passes, process the transaction, and redirect with header()
to a new page.
  if it fails, make use the prior supplied data in input values so you
retain the input from the person using your form.

Example:







HTH




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




Re: [PHP] PHP form port

2002-08-10 Thread John Wards

either do this

$your vars = value
include process.php;

or

header "process.php?your_var=value&your other stuff";

or

$url = http://www.yourserver.com/process.php?your_var=value&etc;
$contents = file($send);
This will execute your php file and return into $contents the html that is
outputed. You don't need to use the html if you don't want to.

John Wards
SportNetwork.net
- Original Message -
From: "Daniel Guerrier" <[EMAIL PROTECTED]>
To: "php user group" <[EMAIL PROTECTED]>
Sent: Saturday, August 10, 2002 5:14 PM
Subject: [PHP] PHP form port


> How do i execute a form post with php?
> I want to validate CCard info etc.. then perform the
> post with no furtheraction from the user.
>
> Basically If not valid stay here and show whats wrong
> ELSE post form to process.php
>
> __
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.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] PHP form port

2002-08-10 Thread Matt

>From: "Daniel Guerrier" <[EMAIL PROTECTED]>
>Sent: Saturday, August 10, 2002 12:14 PM
>Subject: [PHP] PHP form port


> How do i execute a form post with php?

http://www.php-faq.com/postToHost.html



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




Re: [PHP] PHP & form data

2002-05-21 Thread Stavros Patiniotis

 
> I am experiencing problems with receiving form data into my
> scripts.  The phpinfo() function shows me:
> 
> PHP_SELF
> _POST["Action"]   checkEmail 
> _POST["emailAddress"] st 
> _POST["submit"]   Next >> 
> _COOKIE["uid"]
> _COOKIE["emailAddress"]
> _COOKIE["testCookie"] Success 
> 

Further to my last email, I'd just like to point out that the scripts that
I am using used to work with an older php4 version (not sure of the
version number).

I'd also like to point out how the script works:

(1) joinup.php
   -set test cookie
   -delete emailAddress cookie
   -redirect to joinup1.php

(2) joinup1.php
   -if test cookie
   -ask for email/passwd ->submit
   -sumbits to self with Action=checkEmail
   -checkemail is failing due to this "problem".

So basically the $emailAddress variable is being overwritten by the
emailAddress cookie in (1).  How can I prevent this?  Remember that I need
to delete the emailAddress cookie as the user will not be able to sign in
in (2) when they to use a different email address (which is required).


Thanks.


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




Re: [PHP] php form

2002-01-05 Thread M.E. Suliman

Hi Brian

I would need to email it as an attachment.

Thanks

Mohamed

- Original Message -
From: Brian Clark <[EMAIL PROTECTED]>
To: PHP is not a drug. <[EMAIL PROTECTED]>
Sent: Saturday, January 05, 2002 8:23 AM
Subject: Re: [PHP] php form


> * M.E. Suliman ([EMAIL PROTECTED]) [Jan 05. 2002 00:22]:
>
> > Hi
>
> Hello
>
> > I'm pretty new to this PHP thing so this might sound a bit stupid, or
easy
> > for the pros out there.  I need a basic php form that when submit is
clicked
> > all the information filled in that form is either generated into an html
> > template or text file so it can be emailed. I would be looking at the
>
> As an attachment, or do you want to just email the information
> submitted?
>
> > option later where it would give you the option to print or email the
> > genrated file.
>
> If you're completely new to PHP, this is a good introduction:
>
> <http://www.zend.com/zend/art/intro.php>
>
> --
> Brian Clark | Avoiding the general public since 1805!
> Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
> Overflow on /dev/null, please empty the bit bucket.
>
>
> --
> 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 form

2002-01-04 Thread Brian Clark

* M.E. Suliman ([EMAIL PROTECTED]) [Jan 05. 2002 00:22]:

> Hi

Hello

> I'm pretty new to this PHP thing so this might sound a bit stupid, or easy
> for the pros out there.  I need a basic php form that when submit is clicked
> all the information filled in that form is either generated into an html
> template or text file so it can be emailed. I would be looking at the 

As an attachment, or do you want to just email the information
submitted?

> option later where it would give you the option to print or email the
> genrated file.

If you're completely new to PHP, this is a good introduction:



-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Overflow on /dev/null, please empty the bit bucket.


-- 
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 Form (aka:Re: [PHP] Can any one spot the Parse error Here)

2001-07-02 Thread Andrew Halliday

> It's more of a pain if I have to remember what order the parameters go

Yeah, good point.  I can see that.  What i have been doing is componentising
the page into functions which are responsible for rendering a discrete
section of that page...ie if a page consists of a title bar and a form and
the form gets processed by that same page, which can print a response in
place of the form upon submission...


function renderTitle()
{
  echo "";
  echo "...";
  echo "";
}

function renderForm()
{
  echo "";
  echo "...";
  echo "";
}

function renderFormSubmitResponse()
{
  echo "Thankyou!";
}

Then all you have to do is put logic at the front of your code to determine
what 'page components' get rendered.  Also, this way you start to build up a
set of common functions, like ones to display query results in a table,
populate a form by creating dynamic Java Script etc etc

Just a thought on the way to do things, thassal, interesting to compare
techniques. It scares me as to how few people seem to worry about form these
days ...

AndrewH



-- 
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 Form (aka:Re: [PHP] Can any one spot the Parse error Here)

2001-07-02 Thread Michael Kimsal

Andrew Halliday wrote:

>
>
>Ive coded in both PHP and ASP and in both OO and function oriented.
>Ultimately, i find functionally oriented PHP to be the best ... what do
>other people think?
>

As much classes/objects as possible, imo.  'functions' by themselves are 
OK for smaller stuff,
but when you start getting larger projects, and need to make changes - 
heaven help you, unless
you're smart enough to have made most/all of your parameters passed into 
the functions into one
big array.


having multiple function calls in various places like

$x = calculateFreight($sku,$state)

when you then need to add 'weight' as a parameter is a pain.

It's more of a pain if I have to remember what order the parameters go 
in - I have to do

$x = calculateFreight($sku,$state,$weight);

not
$x = calculateFreight($sku,$weight,$state);

else my function will be problematic.  Being able to do something like

$x = new item();
$x->weight= 1;
$x->state = 2;
$x->sku = 3;
$x->calculateFreight();

without worrying about the order of the parameters helps a lot, imo.

To each his own tho.

--
Michael Kimsal
PHP training courses
http://www.tapinternet.com/php
734-480-9961


-- 
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] OO v. Functions Was: Re: [PHP] PHP Form (aka:Re: [PHP] Can any one spot the Parse error Here)

2001-07-02 Thread Aral Balkan

>> Ive coded in both PHP and ASP and in both OO and function oriented.
Ultimately, i find functionally oriented PHP to be the best ... what do
other people think?

Having learnt how to program using Basic when I was 8, I had to unlearn a
lot of things as I moved from Basic to Pascal (what? I can't just Goto
wherever I want to?) then to C (a point-what?) and then a self-imposed exile
from programming only to rediscover it with Actionscripting (Flash) and
Lingo (Director) before trying out Python and finally loving PHP!

Why all this? Well it kinda charts my move from unplanned-write-as-you
top-down programming to function-based programming to object-oriented (which
is something I thought I had missed the boat on during the time I stopped
programming). Although it took a while for me to get my head around it my
favorite has to be Object Oriented. It's shocking to see my own
transformation from someone who would rather write hours of code then adapt
someone else's code to someone who'd rather scour the net looking for a
ready-made class that can then be extended.

Although PHP is not a real object oriented language, I still prefer using
the oo logic whenever possible. Although I guess there are times when you
can't use classes in PHP (has anyone been able to create a custom session
handler *class*, for example?.. how would you set up the
session_set_save_handler that takes strings to point to the various handler
functions from within a class?) I try to whenever I can. I think the words I
love most lately are abstract, modular, and portable and though it usually
takes lots more planning and perhaps a little bit more time spent conding at
first for those adjectives to apply to your code, I believe it's definitely
worth it!

OK, ok, I won't write to the list again first thing after I get up... I sure
can ramble!

__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
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 Form (aka:Re: [PHP] Can any one spot the Parse error Here)

2001-07-02 Thread ReDucTor

Many of my other scripts i use functions, and classes, first time i used
cases and switchs..was fun but i still like to use loops and functions more
:) hehehee
- Original Message -
From: Andrew Halliday <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 02, 2001 6:29 PM
Subject: [PHP] PHP Form (aka:Re: [PHP] Can any one spot the Parse error
Here)


> > Only typed it up in like 20 min, i normaly do that [code tidying] after
:)
>
> hehe tisk tisk...the merits of design havent been hammered through you
yet?
> you are lucky!!!
>
> But, this does raise an interesting issuegood PHP code structure/form.
> What do people consider good PHP form?
>
> Ive coded in both PHP and ASP and in both OO and function oriented.
> Ultimately, i find functionally oriented PHP to be the best ... what do
> other people think?
>
> AndrewH
>
>
> --
> 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]