Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
need real help with PHP
Old 02-08-2010, 05:29 AM need real help with PHP
Junior Talker

Posts: 3
Trades: 0
Hi guys, nice meeting u all, i just started with PHP and believe me i dont have a clue at the moment therefore im so interested from learning from you guys.

Im a suppose to create a form with an input and on submit it displays a page with a new form that have many inputs as the value of the input of the first form.and now this is what i've tried so far so good for me but ooops i dnt knw if im on the right track!!!

<html>
<head>
<title></title>
</head>
<body>
<form name="form" method="Post" onSubmit="return valForm()" action="exercise3.php">
<input type ="text" name="text1" value="value1">
<input type ="submit" name="submit1" value="submit">
<?php>
function $valForm()
{
//now wat comes here
}
?>
</body>
</html>
JuliaNell is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-08-2010, 06:56 AM Re: need real help with PHP
xela1966's Avatar
Super Talker

Posts: 135
Name: Baptista
Location: Alvor, Algarve Portugal
Trades: 0
Quote:
Originally Posted by JuliaNell View Post
Hi guys, nice meeting u all, i just started with PHP and believe me i dont have a clue at the moment therefore im so interested from learning from you guys.

Im a suppose to create a form with an input and on submit it displays a page with a new form that have many inputs as the value of the input of the first form.and now this is what i've tried so far so good for me but ooops i dnt knw if im on the right track!!!

<html>
<head>
<title></title>
</head>
<body>
<form name="form" method="Post" onSubmit="return valForm()" action="exercise3.php">
<input type ="text" name="text1" value="value1">
<input type ="submit" name="submit1" value="submit">
<?php>
function valForm()
{
//now wat comes here
}
?>
</body>
</html>
Change:
<form name="form" method="Post" onSubmit="return valForm(this)"

Add this to the <head>
<script type="text/javascript" src="validation.js"></script>

Creat a named validation.js file in the directorie where you gona add the next function:

/* <![CDATA[ */
function valForm(theForm){
if(theForm.text1.value == ''){
alert('Please enter your text');
theForm.text1.focus();
return false;
}
return true;
}
/* ]]> */

Any way if your search for what you need you will find!!!!
__________________
Algarve Holidays
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
xela1966 is offline
Reply With Quote
View Public Profile Visit xela1966's homepage!
 
Old 02-08-2010, 07:04 AM Re: need real help with PHP
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
You need first to understand how PHP works.

As it is a server side language, it can only do something before displaying the form (fetch datas from a db, for example) or after the submission (process the form data, and then redirect the user to a result page).

Without knowing what you want to do, not much more to say.
Except that you should look for a couple of tutorials, and try to implement a basic form display/form process/result display workflow, to practice.

You can find a lot of good tutorials there:
http://www.google.com/search?hl=en&l...=Google+Search

and more specifically:
http://www.w3schools.com/php/php_forms.asp
http://www.tizag.com/phpT/forms.php
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-08-2010, 07:06 AM Re: need real help with PHP
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
@xela If I am right, this being the PHP forum and the op stating
Quote:
i just started with PHP
, he probably wants a php solution.
Beside, he doesn't talk about validation at all.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-08-2010, 07:36 AM Re: need real help with PHP
Junior Talker

Posts: 3
Trades: 0
Oook, thanks, im actualy starting with coding now and im doing a lot of reseacrh now and then, i knw i'll get there, thnks for the reply. Well ja, i know the server side and the setting up a database server and things, bt coding oops i never tried but im trying now
JuliaNell is offline
Reply With Quote
View Public Profile
 
Old 02-08-2010, 08:17 AM Re: need real help with PHP
Junior Talker

Posts: 3
Trades: 0
And guys its not funny ok, we are here to help each other, not everybody is here for playing around ok, thanks for the HELP , its highgly appreciated!!!!!!
JuliaNell is offline
Reply With Quote
View Public Profile
 
Old 02-08-2010, 10:49 AM Re: need real help with PHP
xela1966's Avatar
Super Talker

Posts: 135
Name: Baptista
Location: Alvor, Algarve Portugal
Trades: 0
Hi Tripy,

She doesn't talk sbout validation, but validation is the only thing she can do on that form she presents, and is the best to add before a form be submit.
Any way, we can find a lot of form around without validation functions and it make the form very bad.
I'm not a deep php espert, when I need something I find it seaching for examples and I can deal with the basic of the PHP.
If you study php you can learn all the potencial of this lenguage, if not you can learn something with examples.
From what I know that's what she needs to do at this time, to see and copy examples and change things and meke it work as I did.
I think she will understand what connection she needs to do to make things work.
Any way thanks for your coment about this, I gona follow your post about php, because I like very mutch this lenguage and it looks that I can learn a lot with you .
__________________
Algarve Holidays
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by xela1966; 02-08-2010 at 10:57 AM..
xela1966 is offline
Reply With Quote
View Public Profile Visit xela1966's homepage!
 
Old 02-09-2010, 08:57 AM Re: need real help with PHP
Experienced Talker

Posts: 41
Name: Adam B
Trades: 0
From what it sounds like you just want to return back to the same (or an identical) form with the values pre-populated. This is probably a lot easier than you think. As you're submitting the form via the "post" method (check your <form> tag) the values are stored within the $_POST array. If you don't know about arrays now's the time to learn.

From the $_POST array you can populate the "value" attribute of the <input>, using the input's name as the array key. For example your input is named "text1", so you can access the input's value with $_POST['text1']. All you need to do then is "echo" out the value.

..Sooo the code to populate the input with the submitted value would be:

Code:
<input type="text" name="text1" value="<?php echo $_POST['text1']; ?>" />
Hopefully this makes some sense?
adam89 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to need real help with PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27668 seconds with 12 queries