Re: [PHP] Form Problem

2002-01-24 Thread Mike Frazer

Here's a sidenote to the whole script: save your server a little load by
removing the print statements.  PHP is an embedded language; if you need to
print something just break from PHP processing with a ? tag and use
standard HTML.  You can embed ?= $variable ? to print individual
variables.  If you are using the script to print chunks of code based on a
condition, use:

? if ($var == value) { ?
html code here
? } else { ?
other code here
? }; ?

Something to that effect, at least.  You get the idea.  It makes code
considerably more readable, and in the off-chance that someone who isn't a
PHP programmer needs to make some aesthetic changes to the document, they
can skip over the PHP input and just change HTML.  Dropping the print
statement means the server does less work, too.

Mike Frazer


Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Thursday 24 January 2002 10:47, Michael P. Carel wrote:
  Hi there,
 
  I have a problem here regarding the form table name variable (i.e input
  name=Process type text), when i used Href tags to send the variable in
the
  next  script it does'nt recognized the $Process variable. I've tried the
  the submit type but but im having problem with other $variable in the
table
  which is not part of the form.
  Here's the script:

 Correct me if I'm wrong, it seems like you're trying to set some values in
a
 form AND trying to pass values through the URL. You cannot do both at the
 same time. Well actually you can if you use javascript.

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 Recursion is the root of computation since it trades description for time.
 */



-- 
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] Form Problem

2002-01-23 Thread Martin Towell

somewhere in the form put:
input type=\hidden\ name=\Dno\ value=\$Dno\

-Original Message-
From: Michael P. Carel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 24, 2002 1:48 PM
To: php
Subject: [PHP] Form Problem




Hi there,

I have a problem here regarding the form table name variable (i.e input
name=Process type text), when i used Href tags to send the variable in the
next  script it does'nt recognized the $Process variable. I've tried the the
submit type but but im having problem with other $variable in the table
which is not part of the form.
Here's the script:

Option1: Using Submit

?FORM ACTION=addlist.php method=get?
print(BR);
print(TABLE WIDTH= 90%);
print(/TABLEHR WIDTH= 90%BR);
print(tableTRTD ALIGN=RIGHT bgcolor=grayB8D #: /TDTD $Dno
/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBMODE OF FAILURE: /TDTDTEXTAREA
NAME=Mode ROWS= 5 COLS=40 WRAP/TEXTAREA/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBPACKAGE:/TDTDinput name=Package
type=text/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBPROCESS:/TDTDinput name=Process
type=text/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBROOT CAUSE:/TDTDTEXTAREA NAME=Root
ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBCORRECTIVE ACTION:/TDTDTEXTAREA
NAME=Corrective ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBRESPONDENCE:/TDTDinput
name=Respondence type=text/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBCOMMITMENT:/TDTDinput
name=Commitment type=text/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBSTATUS:/TDTDTEXTAREA NAME=Status
ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBREMARKS:/TDTDTEXTAREA NAME=Remarks
ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR
/table);

?centerinput type = submit name= submit value=UPDATE?

Im having problem with the $Dno. Submit would not recognize this in sending
the form. I'd like submit to add a Dno=$Dno in submitting the form but how?



Option 2: Using HREF

print(BR);
print(TABLE WIDTH= 90%);
print(/TABLEHR WIDTH= 90%BR);
print(tableTRTD ALIGN=RIGHT bgcolor=grayB8D #: /TD$Dno/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBMODE OF FAILURE: /TDTDTEXTAREA
NAME=Mode ROWS= 5 COLS=40 WRAP/TEXTAREA/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBPACKAGE:/TDTDinput name=Package
type=text/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBPROCESS:/TDTDinput name=Process
type=text/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBROOT CAUSE:/TDTDTEXTAREA NAME=Root
ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBCORRECTIVE ACTION:/TDTDTEXTAREA
NAME=Corrective ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBRESPONDENCE:/TDTDinput
name=Respondence type=text/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBCOMMITMENT:/TDTDinput
name=Commitment type=text/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBSTATUS:/TDTDTEXTAREA NAME=Status
ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR
TRTD ALIGN=RIGHT bgcolor=grayBREMARKS:/TDTDTEXTAREA NAME=Remarks
ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR
/table);

print(A
HREF=completelist.php?action=UpdateDno=$DnoMode=$ModePackage=$PackagePro
cess=$ProcessRoot=$RootCorrective=$CorrectiveRespondence=$RespondenceCom
mitment=$CommitmentStatus=$StatusRemarks=$Remarks[UPDATE]/A);


Im having problem here in all the name string variable(ie. $Package, $Mode
...etc) except the $Dno. How could i make the Href tag recognize the name
string variable in the table form?



Any idea? Please help me regarding this im just a PHP newbie.

Thanks in advance




Regards,

Mike



-- 
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] Form Problem

2002-01-23 Thread Jason Wong

On Thursday 24 January 2002 10:47, Michael P. Carel wrote:
 Hi there,

 I have a problem here regarding the form table name variable (i.e input
 name=Process type text), when i used Href tags to send the variable in the
 next  script it does'nt recognized the $Process variable. I've tried the
 the submit type but but im having problem with other $variable in the table
 which is not part of the form.
 Here's the script:

Correct me if I'm wrong, it seems like you're trying to set some values in a 
form AND trying to pass values through the URL. You cannot do both at the 
same time. Well actually you can if you use javascript.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Recursion is the root of computation since it trades description for time.
*/

-- 
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] Form Problem

2002-01-09 Thread Pavel Kharitonov

I had the same problem happen to me a couple of days ago.
A form that has been working has stopped working all of a sudden - all
fields would be submitting as blank (undefined).

Unfortunately, I was not able figure out what the problem was :-(

I got it down to the line that was causing my form to stop submitting - a
BASE tag. I still do not understand why.

I ended up deleting the entire directory, re-uploading the files and they
started working all of a sudden.

I know it's not much help, just my 2 cents.

Sincerely,

Pavel Kharitonov
Project Manager
Intechnic Corporation
http://www.intechnic.com
Phone: (847) 816-1231



-Original Message-
From: Chris Kwasneski [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 1:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Form Problem


I'm having a problem with a HTML form.  When it gets submitted, I keep
getting an undefined variable error message.  And a blank page (aside from
a 'Hi' written on it...).  I don't think its a problem with my install of
PHP as other PHP code is running fine, but can't get it to print out this
name.  I'm probably missing something simple, but I just can't figure it
out.

Any help would be appreciated.

the form:

html
  head
  titleMy Form/title
  /head
  body
  form action=test2.php method=GET

  My name is:
  br input type=text name=YourName

  input type=submit name=submit value=Submit /
  /form
  /body
  /html


Test2.php file:
html
head
titleForm test.../title
/head
body
Hi ?php echo $YourName; ?
/body
/html

The url that is getting passed to the file:

http://localhost/test2.php?YourName=Chrissubmit=Submit

The error message I'm getting:


[Wed Jan 09 14:24:47 2002] [error] [client 127.0.0.1] PHP
Warning:  Undefined variable:  YourName in c:\program files\apache
group\apache\htdocs\test2.php on line 10





--
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] Form Problem

2002-01-09 Thread Richard Crawford

The presence of the final / in the line makes the page XHTML compliant. 
  It should be left in, and it has no effect whatsoever on the 
functionality of the input tag.  In fact, it should be included in the  
input type=text  tag as well.

I can't find a darn thing wrong with your script.  You might wish to 
double-check your Apache configuration settings; something there might 
be screwy.

Good luck.


Intruder wrote:

 I don't like this line:
 input type=submit name=submit value=Submit /
 change it:
 input type=submit name=submit value=Submit
 
 to my mind it could help ;
 
 
 
 
 PK html
 PK   head
 PK   titleMy Form/title
 PK   /head
 PK   body
 PK   form action=test2.php method=GET
 
 PK   My name is:
 PK   br input type=text name=YourName
 
 PK   input type=submit name=submit value=Submit /
 PK   /form
 PK   /body
 PK   /html
 
 
 



-- 
Sliante,
Richard S. Crawford

mailto:[EMAIL PROTECTED] 
http://www.mossroot.com
AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
MSN:  [EMAIL PROTECTED]

When you have lost the ability to laugh at yourself, you have lost the 
ability to think straight. --Clarence Darrow

Push the button, Max!



-- 
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] Form Problem

2002-01-09 Thread Jason Wong

On Thursday 10 January 2002 03:30, Chris Kwasneski wrote:

 I'm having a problem with a HTML form.  When it gets submitted, I keep
 getting an undefined variable error message.  And a blank page (aside from
 a 'Hi' written on it...).  I don't think its a problem with my install of
 PHP as other PHP code is running fine, but can't get it to print out this
 name.  I'm probably missing something simple, but I just can't figure it
 out.

 Any help would be appreciated.

 the form:

 html
   head
   titleMy Form/title
   /head
   body
   form action=test2.php method=GET

   My name is:
   br input type=text name=YourName

   input type=submit name=submit value=Submit /
   /form
   /body
   /html


 Test2.php file:
 html
 head
 titleForm test.../title
 /head
 body
 Hi ?php echo $YourName; ?
 /body
 /html

 The url that is getting passed to the file:

 http://localhost/test2.php?YourName=Chrissubmit=Submit

 The error message I'm getting:


 [Wed Jan 09 14:24:47 2002] [error] [client 127.0.0.1] PHP
 Warning:  Undefined variable:  YourName in c:\program files\apache
 group\apache\htdocs\test2.php on line 10

You don't say what version of PHP you're using. If you're using the latest 
(4.1.1) and are using the recommended php.ini settings then things like GET, 
POST etc. are not automatically initialised into the variables space. So you 
would have to use something like:

  Hi ?php echo $_GET[YourName]; ?

If you're not using php-4.1.1 then check php.ini and see whether 

  register_globals = On


hth
-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Gee, Toto, I don't think we're in Kansas anymore.
*/

-- 
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] FORM problem

2001-01-10 Thread Joe Stump

Have you tried looking at addslashes() ??? Or am I not understanding the problem
here. Just remember to deliminate the "'s and ''s before entering them into the
db.


--Joe

On Wed, Jan 10, 2001 at 08:19:24PM -0500, Romulo Roberto Pereira wrote:
 Hello!
 
 I am having a problem when people copy and paste text inside a TEXTAREA in a form 
that contains double quotes ' " ' . 
 
 The first file is a simple form. The second one is a php script that treats the data 
from the user and stores in a MySQL table. Onyone has any ideas? I need to use 
javascript to treat the variables before I execute submit?
 
 Thank you,
 
 Rom

-- 

Joe Stump, PHP Hacker
[EMAIL PROTECTED]
http://www.miester.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]