| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
I like Iced Tea
|
Can Someone Help me with my PHP script
Hey. I have the following script. Which is suppost to validate the information in the textboxes and send error messages if something is wrong. I didnt make the validation too complex, but I just wanted to start it. And after everything is validated, it should send all the information to my email. PHP Code:
Can someone tell me what is wrong? it doesnt seem to work! and could someone tell me what excess code I have. And useless stuff I added which doesnt need to be there. Any help to make this php script work and to make i better is appriciated! thanks! Last edited by Maciek : 16-12-2007 at 15:55. |
|
|
|
|
|
#8 (permalink) |
|
I like Iced Tea
|
ohh ok. NOW. ive ran into a problem with my script. I try to move the success message to another place and it totally screws with my whole website layout. its annoying. The error message when moved reacts fine with everything. But its stupid that everything is php and the sucess message is in a div? so it has to be in between the code its in or else it wont work. Is there a php way for making a success message for my form? so that i can place it anywhere and it will work fine. thanks.. |
|
|
|
#9 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,610
|
Parsing issues aside, your form isn't going to work for one major reason - you didnt put action="something.php" in the initial <form> tag, so the form will have no idea where to go with the information when you push the submit button. |
|
|
|
#11 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,610
|
As for your last question there, I think you have to realize what exactly php does. Php looks at the current set of circumstances (which could include anything - location of user, time of day, information entered into form, information in database and any number of other things), and then runs through a script using that information to basically create a text file that it sends to that browser. You could really make the text file anything, but since we are working with browsers, and browsers interpret (x)html, we usually make php output (x)html. So when you ask if there is a php solution to outputting a success answer instead of html, that doesnt really make sense, as what php does IS output html. If you output anything else, your browser can't interpret it. If the output is causing troubles with your design, then you need to learn more about design to be able to fix it. Php is great for what it does, but unless you know what exactly the (x)html is that you want to output, then knowing php isn't really going to do much for you. Its like putting the cart before the horse. So maybe you should take a bit of time to learn some basic (x)html and css first before php. Thats really probably the better order in which to do it, unless you have someone telling you what (x)html they want you to output. |
|
|
|
#12 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,610
|
"something.php" was just an example. You have to put the filename that contains the script you want to run. It looks like you have everything contained in one file, so it should probably be the filename of the file you are working in. If your script was in a different file from the form, you would want to use that filename instead. |
|
|
|
#15 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,610
|
I'm sorry to tell you, but you do not know html very well at all. That is an absolute mess of divs. And if you knew CSS well, then your error message wouldn't be a problem, because you would just fix the issue using some CSS positioning. |
|