[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 08-08-2005, 10:08 PM   #1 (permalink)
NamePros Regular
 
Join Date: Jul 2005
Location: U.S.A.
Posts: 655
0.00 NP$ (Donate)

Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about


Awful PHP Help Please....

I need some PHP help.I need to know how to submit forms.cause i know how to make forms.But for some reason it willnot let me submit forms. So really nee someones help on this.I need to have a form because it will make my site a lot better.Thank you very very very very much
-Coolprogram
P.S I am using a webhosting server for the php stuff i know for a fact it works :P
if that makes a difference.
Thanks Again
Coolprogram is offline  
Old 08-08-2005, 10:44 PM   #2 (permalink)
NamePros Member
 
Join Date: Jan 2005
Location: Texas USA
Posts: 71
203.00 NP$ (Donate)

Outer is an unknown quantity at this point


It's very simple

form:
Code:
<form method="post" action="scriptname.php">
<input type="text" name="variable1"><br />
<input type="text" name="variable2"><br />
<input type="Submit" name="Submit" value="Submit">
</form>
ok, so you got your form, you know that already :P

when the form is submitted via the submit button, the values from the fields in the form will be translated in PHP to this:
PHP Code:
$_POST['variable1']
$_POST['variable2']
$_POST['Submit']
The submit button also submits a value to PHP. This will be an easy method for checking if a user hit the submit button.

heres a small script that just shows the data the user submitted
PHP Code:
<?php

// This checks if the user submitted.
// The word in parentheses must equal the value that you assigned the Submit button
if ($_POST['Submit'] == "Submit")
{
    
// anything in here you do if the user submitted the form
    
echo "Variable 1 is: ".$_POST['variable1']."<br />";
    echo
"Variable 2 is: ".$_POST['variable2']."<br />";
}
else
{
    
// This area is for if the user didn't submit. The else statement IS optional. It isn't needed.
    // You could just as easily leave it out and just have the form show no matter what.
}
?>

Hope this helps

Also, one more thing. the words inside the $_POST are the names that you assign the fields in the form. So if you had this:
Code:
<input type="text" name="trees">
then the PHP code would be
PHP Code:
$_POST['trees']
__________________
I wonder...
Outer is offline  
Old 08-09-2005, 04:46 AM   #3 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
You forgot to put semicolons at the end of the lines in your $_POST code!!
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 08-09-2005, 09:14 AM   #4 (permalink)
NamePros Member
 
Join Date: Jan 2005
Location: Texas USA
Posts: 71
203.00 NP$ (Donate)

Outer is an unknown quantity at this point


I know, they were just to show the format (when there were only the $_POST[] variables inside the PHP tags...)
__________________
I wonder...
Outer is offline  
Old 08-09-2005, 06:03 PM   #5 (permalink)
NamePros Regular
 
Join Date: Jul 2005
Location: U.S.A.
Posts: 655
0.00 NP$ (Donate)

Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about


Okay that helps.But i dont think it works on webhosting things because i havew a web hosting thing i use it for but it doesnt work when i put the codes there it gives a cannot find thing.So what does that mean .Thanks for the help.
Coolprogram
Coolprogram is offline  
Old 08-09-2005, 06:29 PM   #6 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Cannot find what?
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 08-09-2005, 06:52 PM   #7 (permalink)
NamePros Regular
 
Join Date: Jul 2005
Location: U.S.A.
Posts: 655
0.00 NP$ (Donate)

Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about


Cannot find the Page it's on even though it's on the same page and everything or it cant find the PHP files.........What does it mean
Thanks again for the help coolprogram
Coolprogram is offline  
Old 08-09-2005, 07:01 PM   #8 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Would help if you could copy+paste the error Make sure your form action is the same as the PHP script filename.
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 08-09-2005, 07:11 PM   #9 (permalink)
NamePros Regular
 
Join Date: Jul 2005
Location: U.S.A.
Posts: 655
0.00 NP$ (Donate)

Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about


been there tryed that it is ecactly right
Coolprogram is offline  
Old 08-09-2005, 07:13 PM   #10 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
You mean that was the problem? *lol* okay
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 08-09-2005, 07:42 PM   #11 (permalink)
NamePros Regular
 
Join Date: Jul 2005
Location: U.S.A.
Posts: 655
0.00 NP$ (Donate)

Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about


heh lol but what is my problem is what i am trying to figure out!!!!!!!!!
Coolprogram is offline  
Old 08-09-2005, 07:46 PM   #12 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Oh, you didn't solve it? :P um.... please! Do the following:

When the error appears, highlight it. Press Ctrl+C. When you come to reply, press Ctrl+V to paste the error.

Then we can help you more!
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 08-20-2005, 03:20 AM   #13 (permalink)
NamePros Regular
 
Zubair1's Avatar
 
Join Date: Mar 2005
Posts: 874
159.45 NP$ (Donate)

Zubair1 is just really niceZubair1 is just really niceZubair1 is just really niceZubair1 is just really nice

AIDS/HIV
Hi ppl,

I just wanted to know it's not necessary to put the $_POST['submit'];
on the receiveing end is it?

coolprogram, I think you might be using an earlier version of php which takes
in commands like HTTP_POST_VARS['name']; or you might be looking in the
wrong directory.these are just guesses sorry If Im wrong I kinda new to php
programming but have experience In other languages.
__________________
Live Support : Zubair11 [at] hotmail.com
Free SEO Directory! || Free Games and Songs || eBloggy.net
Zubair.info || Mixcat Interactive
Zubair1 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Getting started with PHP (The Basics) deadserious Webmaster Tutorials 60 11-17-2007 11:35 AM
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 09:09 AM
Beware of PHP! PolurNET The Break Room 25 03-29-2005 03:04 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:09 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85