PDA

View Full Version : Can Anybody Help Me Validating my felds



jabird60
02-08-2006, 12:35 AM
Is there anybody here that can sympel tell me how to make required felds??

jabird60
02-08-2006, 12:42 AM
Help Me with this

quyhurry
02-08-2006, 01:33 AM
Not many people can do that so far in this forum:(
Bird just did it with the help of Navaldesign after many days of struggle. Navaldesign is out of town actually and will be back tomorrow. I believe that the forum moderators can help but they must consider it's beyond BlueVoda terms of service. It involves script writing, custom-made service and very time-consuming.
I am very close to figure it out though. Just need some information but unfortunately there is nobody to help( .
I was able to get the error pages to appear when trying all combinations but still no luck to complete.
Will tell you if I can ever make it.
Good luck
Quy

jabird60
02-08-2006, 01:41 AM
Thanks and when you do fuiger it out can you explan it to me

jabird60
02-08-2006, 01:44 AM
Do you know what folder to put it at ,because i can alter the code to work with mine but i don't where to upload it.??

reply back

jabird60
02-08-2006, 02:05 AM
i noticed that you have a .html on the end of the address how did you do that ???

quyhurry
02-08-2006, 02:12 AM
i noticed that you have a .html on the end of the address how did you do that ???

Which address ?
I guess that you can make forms work already right? Me too. Now I am trying to make required fields for people to input. If there is nothing in the required fields, an error page will appear.
Actually I am testing a form with only 1 box (required field) and try the codes to see.
Will post if find out anything.
Cheers
Quy

jabird60
02-08-2006, 02:24 AM
http://www.nguyenthaihocfoundation.com/error_email.html (http://www.nguyenthaihocfoundation.com/error_email.html)

jabird60
02-08-2006, 02:40 AM
on certen pages i have seen the .html but i do not see it on any of my pages is that a problem??

quyhurry
02-08-2006, 02:49 AM
http://www.nguyenthaihocfoundation.com/error_email.html (http://www.nguyenthaihocfoundation.com/error_email.html)

Oh that is the error page regarding email. I did It like any other pages.
As a matter of facts, I did 3 error pages for the 3 required fields.
Hence in total I made :
-1 main page with the form (.html)
-1 confirmation page (.html)
-1 php page with same name as the main page but with .php extension
-And the 3 error pages for the 3 required fields. (.html)
All published.

I know my problem is the code that I put inside body tag of the php page. It's not good and need somebody to look at it.

jabird60
02-08-2006, 02:51 AM
my sites do not have the .html extention can you tell me how you did the error pages??

quyhurry
02-08-2006, 02:59 AM
my sites do not have the .html extention can you tell me how you did the error pages??

I need to know:
-Are you using BlueVoda builder?
-Do you have an account with Vodahost yet?
Because if u use BV, the extension .html is automatically converted from .bvp once published

Can u link your sites?

jabird60
02-08-2006, 01:13 PM
yes i am and i can link my sites the address is http://thiselitelife.com

quyhurry
02-08-2006, 02:55 PM
I see that there is no www either :)
I think that this is a matter of setting only which abbreviates the address. It could be inconvenient because sometimes you need to know what kind of extension is the site you are viewing.
May be someone else can explain better.

navaldesign
02-08-2006, 04:36 PM
yes i am and i can link my sites the address is http://thiselitelife.com

Well, i think you have done something like this:

you have created subfolders named as your pages should be. You then saved ALL your pages as index.html, each in it's own folder.
What you see in Blue FTP are not the pages, they are the folders. The links work ok and the site works ok. because having saved the pages as index.html in each folder, your links get the browser to the folder, and it automaticaly defaults to the index.html page. Just to see what i mean, click on http://www.thiselitelife.com/elitelifeshows/

and then on http://www.thiselitelife.com/elitelifeshows/index.html

You get the same result becuse your page is published as index.html .

There is no problem with your site, although it is rather unusual to have a folder for each page. This way you must also first create the folder using Blue FTP, and then publish the page.

quyhurry
02-08-2006, 06:13 PM
Navaldesign, You're the best!

jabird60
02-08-2006, 09:24 PM
yea really ,so how do i get the .html on the end of the site??

navaldesign
02-08-2006, 09:36 PM
yea really ,so how do i get the .html on the end of the site??

They are there already: you can't see them because the pages are in the folders. Just to convince you: open BlueFTP, connect, and you will see the folders you have created, f.e. the folder elitelifeshows. Double click on it so it's content will appear. You will see that there is a file index.html there.

The same goes for all the folders you have created.

Usually all the pages should be one level up, in your public_html folder. There was no need to create separate folders for each page.

jabird60
02-08-2006, 09:53 PM
what if i re-name all the pages to like say the home page insed of having home page it be named home page will that work

navaldesign
02-08-2006, 10:22 PM
what if i re-name all the pages to like say the home page insed of having home page it be named home page will that work

Maybe i haven't been clear enough. YOUR PAGES ARE ALREADY HTML. The problem is that all of your pages are called the same, "index.html". And each page has been published in a folder of it's own. The steps to correct this, if you wish to do so, would be (it is the same for all your pages except foryour homepage, which is already in the wright folder, the public_html)):
Open the page in Blue Voda. Change the menubar links, that for the moment are like: http://www.thiselitelife.com/elitelifeshows/ in http://www.thiselitelife.com/elitelifeshows.html . Save it with the correct name: f.e. "elitelifeshows". Publish it in the public_html folder, not in the public_html/elitelifeshows folder you have created. Repeat for all pages.

Please befor you do anything keep a backup of your original files, just in case ......

However, i repeat,there's not really any need to do all this.

jabird60
02-08-2006, 11:00 PM
i know i just figered it out what i did is i put a redirect on the address so if someone goes to thiselitelife.com/elitelifeshow it will redirect them to the address thiselitelife.com/elitelifeshows/index.html



I have a problem like bird is this script right??

<?php
@$Name = addslashes($_POST['Name']);
@$Gamer Tag = addslashes($_POST['Gamer Tag']);
@$E-Mail = addslashes($_POST['E-mail']);
if (strlen($Name) >40)
{
header("Location: error_name.html");
exit;
{
header("Location: error_name.html");
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Gamer Tag))
{
header("Location: error_gamertag.html");
exit;
}
if (strlen($Gamer Tag) == 0 )
{
header("Location: error_gamer tag.html");
exit;
}
if (strlen($e-mail) == 0 )
{
header("Location: error_email.html");
exit;
}
$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "Turnament Signups";
$pfw_email_to = "turn@thiselitelfie.com";
$pfw_message = "Name: $Name\n"
. "Email: $Gamer Tag\n"
. "Essay: $E-mail\n"
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: .php");

if it is let me know if not can you help me fix it . and where do i put it at like what folder??


Thanks

navaldesign
02-08-2006, 11:44 PM
i know i just figered it out what i did is i put a redirect on the address so if someone goes to thiselitelife.com/elitelifeshow it will redirect them to the address thiselitelife.com/elitelifeshows/index.html



I have a problem like bird is this script right??

<?php
@$Name = addslashes($_POST['Name']);
@$Gamertag = addslashes($_POST['Gamertag']);
@$Email = addslashes($_POST['Email']);
if (strlen($Name) >40)
{
header("Location: error_name.html");
exit;
}

{
header("Location: error_name.html");
exit;
}
DELETE THIS PART IN BLUE. YOU HAVE IT TWICE



if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email )) This validation is for the email
{
header("Location: error_email.html");
exit;
}
if (strlen($Email) == 0 )
{
header("Location: error_email.html");
exit;
}
if (strlen($Gamertag) == 0 )
{
header("Location: error_gamertag.html");
exit;
}
$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "Turnament Signups";
$pfw_email_to = "turn@thiselitelfie.com";
$pfw_message = "Name: $Name\n"
. "Email: $Email\n"
. "Gamer Tag: $Gamertag\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: confirmation.html");

if it is let me know if not can you help me fix it . and where do i put it at like what folder??


Thanks

There are some errors:
1. Rename your fields in Email, Gamertag. Consequently change the script.
2. Do the changes in red.
3. Create the three error pages. You MUST call them as above. Then create also a confirmation page, called "confirmation". When you save them in your computer, save them with these names. Then publish all pages -the form page, the error pages, and the confirmation page, in public_html. To do this, when you go to publishing and the popup window with the username and the password comes up, make sure that in the lower part, where it is written "Folder", only appears "public_html".

4. Then create the php file as my instructions in other posts. Give it the name "registration.php" . Upload it on the public_html folder on your site.

5. Make sure to set the form action in "registration.php", the method to "POST" and the "enctype" in "multipart/form data". Save it on your computer, the publish it in the same folder "public_html".

If you have problems post again.

quyhurry
02-09-2006, 12:05 AM
Sorry to disappoint you Jabird60 but it won’t work cause even I can see there are many mistakes. To name a few:

-redundant lines 9,10,11
{
header("Location: error_name.html");
exit;
-error_gamer tag.html
-if (strlen($e-mail) == 0 )
-
. "Email: $Gamer Tag\n"
. "Essay: $E-mail\n"
-header("Location: .php");

Only one minor mistake can screw up the code.
I suggest it's always good to practice with a simplest form (only 1 required field) like I did. Once you got the hand on it, then you can start to make your own.
I just finished a form with 3 required fields successfully :)
Anyway, I am taking a long vacation abroad and won't be able to hang around this forum for a couple of weeks.
Good luck and take care.
Best regards to all,
Quy

navaldesign
02-09-2006, 12:11 AM
Sorry to disappoint you Jabird60 but it won’t work cause even I can see there are many mistakes. To name a few:

-redundant lines 9,10,11
{
header("Location: error_name.html");
exit;
-error_gamer tag.html
-if (strlen($e-mail) == 0 )
-
. "Email: $Gamer Tag\n"
. "Essay: $E-mail\n"
-header("Location: .php");

Only one minor mistake can screw up the code.
I suggest it's always good to practice with a simplest form (only 1 required field) like I did. Once you got the hand on it, then you can start to make your own.
I just finished a form with 3 required fields successfully :)
Anyway, I am taking a long vacation abroad and won't be able to hang around this forum for a couple of weeks.
Good luck and take care.
Best regards to all,
Quy

Hae a nice vacation quyhurry.

And you don't desperate Jabird. Prepare the pages, upload them, correct your form and republish it, and provide me the URL to your pages. Let the script to me.

jabird60
02-09-2006, 12:42 AM
ok i have everything published but i am getting a page can not be displayed the script that you corrected for me that is the regestration.php right ..??

I need a little more help

navaldesign
02-09-2006, 12:48 AM
ok i have everything published but i am getting a page can not be displayed the script that you corrected for me that is the regestration.php right ..??

I need a little more help

correct, though it should be registration.php

Upload the links so i can have a look

jabird60
02-09-2006, 01:06 AM
ok The Form is http://thiselitelife.com/signups
and the email error page is http://thiselitelife.com/error_email
and the name error page is http://thiselitelife.com/error_name
and the Gamer Tag error page is http://thiselitelife.com/error_gamertag
and the conformation page is http://thiselitelife.com/sginups/confirmation.html

if you need anything else post agan

navaldesign
02-09-2006, 01:17 AM
ok The Form is http://thiselitelife.com/signups
and the email error page is http://thiselitelife.com/error_email
and the name error page is http://thiselitelife.com/error_name
and the Gamer Tag error page is http://thiselitelife.com/error_gamertag
and the conformation page is http://thiselitelife.com/sginups/confirmation.html

if you need anything else post agan

Sorry but your pages aren't there.Where did you uploaded them?and please try to get used to typing also the .html at the end

navaldesign
02-09-2006, 01:22 AM
ok The Form is http://thiselitelife.com/signups
and the email error page is http://thiselitelife.com/error_email
and the name error page is http://thiselitelife.com/error_name
and the Gamer Tag error page is http://thiselitelife.com/error_gamertag
and the conformation page is http://thiselitelife.com/sginups/confirmation.html

if you need anything else post agan

And you also have a problem in the form: you have named both the email and the gamertag fields as T1. Please correct them in "Email" and "Gamertag"

navaldesign
02-09-2006, 01:28 AM
I have to go off. It's 02:30 and i have only 4 hours to sleep. I'll see your posts tomorrow morning. Bye

jabird60
02-09-2006, 02:17 AM
ok i have done some re-configeration to the link the,the link are http://thiselitelife.com/error_name
http://thiselitelife.com/error_email
http://thiselitelife.com/error_gamertag
http://thiselitelife.com/confirmation


P.S The way i now have confugered you don't have to type .html at the end anymore)

If you need anything else post agan

navaldesign
02-09-2006, 08:18 AM
ok i have done some re-configeration to the link the,the link are http://thiselitelife.com/error_name
http://thiselitelife.com/error_email
http://thiselitelife.com/error_gamertag
http://thiselitelife.com/confirmation




P.S The way i now have confugered you don't have to type .html at the end anymore)

If you need anything else post agan

The pages now are ok. However you still go on creating folders for every single page. This is not a usual aproach to page publishing. It might also create you some problems with scripts that require all of the pages to be in the same folder.

However, i'll send you the necessary script. Please note that the php file i'll provide you MUST be published in the same folder as your form, that is ..../signup/

jabird60
02-10-2006, 12:20 AM
ok i if re-done to whole site it is now the way it should be

navaldesign
02-10-2006, 01:06 AM
ok i if re-done to whole site it is now the way it should be

sorry, i lost you somewhere in the way, what's the form URL?

jabird60
02-10-2006, 09:00 PM
the form url is thiselitelife.com/signups (http://thiselitelife.com/signups.html)

navaldesign
02-10-2006, 09:30 PM
the form url is thiselitelife.com/signups (http://thiselitelife.com/signups.html)

FORM name="Sign Ups" method="POST" action="Turnament Sign Up's.php" enctype="multipart/form-data">

Change the php page name in "turnament_sign_ups.php"
Tell me which fields you want to have as "required"

jabird60
02-10-2006, 09:39 PM
ok i have my script partly working the problem is that it is stuck on the gamer-tag

navaldesign
02-10-2006, 09:44 PM
ok i have my script partly working the problem is that it is stuck on the gamer-tag

Rename the field from "Gamer tag" in "Gamertag" . Remember to put in the mail part of the script your email on Vodahost, not an external one.

jabird60
02-10-2006, 09:54 PM
i am using my vodahost account here is the script maybe i did not fix all the errors yet

<?php
@$Name = addslashes($_POST['Name']);
@$Gamertag = addslashes($_POST['Gamertag']);
@$Email = addslashes($_POST['Email']);
if (strlen($Name) == 0 )
{
header("Location: error_name.html");
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email ))
{
header("Location: error_email.html");
exit;
}
if (strlen($Gamertag) == 0 )
{
header("Location: error_gamertag.html");
exit;
}
$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "Turnament Signups";
$pfw_email_to = "turn@thiselitelfie.com";
$pfw_message = "Name: $Name\n"
. "Email: $Email\n"
. "Gamer Tag: $Gamertag\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: confirmation.html");

jabird60
02-10-2006, 09:56 PM
go to thiselitelife.com/signups (http://thiselitelife.com/signups) and you will see what i mean

navaldesign
02-10-2006, 10:02 PM
There is nothing wrong with the script. Rename the Gamer tag field in Gamertag--- The field name, not the title. The script finds "Gamer tag" so "Gamertag" is null, and gives you the error message.

jabird60
02-10-2006, 10:23 PM
Dude you awsome

jabird60
02-10-2006, 10:56 PM
ok i have one more question i have a Check box and a comment feld. and when i get the e-mailed data it only has the name,e-mail,and gamertag

navaldesign
02-11-2006, 12:26 AM
ok i have one more question i have a Check box and a comment feld. and when i get the e-mailed data it only has the name,e-mail,and gamertag

Of course. you only put those in your mail body. Change it to:

<?php
@$Name = addslashes($_POST['Name']);
@$Gamertag = addslashes($_POST['Gamertag']);
@$Email = addslashes($_POST['Email']);
@$Comments = addlashes($_POST['Comments'];
@$Send_Me_News_Letter = addlashes($_POST['Send_Me_News_Letter'];

if (strlen($Name) == 0 )
{
header("Location: error_name.html");
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email ))
{
header("Location: error_email.html");
exit;
}
if (strlen($Gamertag) == 0 )
{
header("Location: error_gamertag.html");
exit;
}
$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "Turnament Signups";
$pfw_email_to = "turn@thiselitelfie.com";
$pfw_message = "Name: $Name\n"
. "Email: $Email\n"
. "Gamer Tag: $Gamertag\n"
. "Comments : $Comments\n"
. "Send Me News Letter : $Send_Me_Newsletter\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: confirmation.html");

hreftovoda
02-11-2006, 12:42 AM
Navaldesign, do you have freetime most of the time? because i notice that you always in the forum. but that is good, so all the one need help will get the answer straight away. Thank you. I'm just curious :)

navaldesign
02-11-2006, 01:07 AM
Navaldesign, do you have freetime most of the time? because i notice that you always in the forum. but that is good, so all the one need help will get the answer straight away. Thank you. I'm just curious :)

I'm awake almost 18-19 hours a day, most of them working. So having a look at the forum just makes me rest a while.

jabird60
02-11-2006, 03:04 AM
ok,the comment and send me news letter are on the e-mail but i tryed them out and like if the check box is check it does not say anything neather does the comment field

navaldesign
02-11-2006, 08:19 AM
ok,the comment and send me news letter are on the e-mail but i tryed them out and like if the check box is check it does not say anything neather does the comment field

I forgot the ) symols in there:

@$Comments = addlashes($_POST['Comments']);
@$Send_Me_News_Letter = addlashes($_POST['Send_Me_News_Letter']);


Also change in the form, the field name in Send_Me_News_Letter, (must be with underscores)

and in the mail body

. "Send Me News Letter : $Send_Me_News_Letter\n";

instead of:

. "Send Me News Letter : $Send_Me_Newsletter\n";

jabird60
02-11-2006, 08:08 PM
there sitll not working

navaldesign
02-11-2006, 10:16 PM
there sitll not working

Please use the following code as it is. Copy it, paste it in notepad, go to "Save as", chose "All files" and save it with the name of "registration.php". Upload it on the server.

<?php
// Receiving variables
@$Name = addslashes($_POST['Name']);
@$Gamertag = addslashes($_POST['Gamertag']);
@$Email = addslashes($_POST['Email']);
@$Send_Me_News_Letter = addslashes($_POST['Send_Me_News_Letter']);
@$Comments = addslashes($_POST['Comments']);
// Validation
if (strlen($Name) == 0 )
{
header("Location: error_name.html");
exit;
}
if (strlen($Gamertag) == 0 )
{
header("Location: error_gamertag.html");
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email))
{
header("Location: error_email.html");
exit;
}
if (strlen($Email) == 0 )
{
header("Location: error_email.html");
exit;
}
//Sending Email to form owner
$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "Turnament Signups";
$pfw_email_to = "turn@thiselitelfie.com";
$pfw_message = "Name: $Name\n"
. "Gamertag: $Gamertag\n"
. "Email: $Email\n"
. "Send_Me_News_Letter: $Send_Me_News_Letter\n"
. "Comments: $Comments\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: confirmation.html");
?>

jabird60
02-11-2006, 10:38 PM
thanks

jabird60
02-11-2006, 10:44 PM
ok,now i am not reciveing any e-mails

jabird60
02-12-2006, 01:37 AM
never mind,i look over the script and found a error you spelled thiselitelife.com worng . the life in thiselitelife.com

navaldesign
02-12-2006, 07:03 AM
never mind,i look over the script and found a error you spelled thiselitelife.com worng . the life in thiselitelife.com

I had it copied from the script you posted above

jabird60
02-12-2006, 08:59 PM
Oh,ok i apolagized

navaldesign
02-12-2006, 09:34 PM
Oh,ok i apolagized

Yes, but did it work ?

jabird60
02-15-2006, 02:30 AM
yes it did, it works fantastic. Dude you are really awsome

jabird60
02-15-2006, 02:54 AM
Do you work with voda host?? How Did you become a Modarator??

navaldesign
02-15-2006, 05:28 AM
Do you work with voda host?? How Did you become a Modarator??

I don't know. Maybe my wife gave some tip to Voda guys. Just joking. No, i'm a customer also. ***** made me this honour and i'm really happy with it

jabird60
11-12-2006, 09:03 AM
that's kool