Jump to content

Need help


gdoggy1678

Recommended Posts

i need to put this on my page but when people type in what item they want in the prompt box i want it to send that item to my email gdoggy1678(at)yahoo.comheres what i am using<html><head><script type="text/javascript">function disp_prompt(){var name=prompt("Please enter the item you want added","")if (name!=null && name!=""){document.write("You submited " + name + "! check back later to see if it has been added?")}}</script></head><body><form><input type="button" onclick="disp_prompt()" value="Display a prompt box"></form></body></html>

Link to comment
Share on other sites

I don't know if it is possible to mail to Yahoo, but if you define an action attribute for the form element with "mailto:myaddress@someserver.com", the data should be sent to the address. Though you should return the value made by the prompt into an element inside the form, but again, I don't know if posting such data to a Yahoo address is possible. Hotmail can I remember.But you could also choose to use server-side mail script, or even a database. With a database, it can all be full automatic :)Then you don't need to use mails to your self, nor your interferance in adding the items.

Link to comment
Share on other sites

I don't know if it is possible to mail to Yahoo, but if you define an action attribute for the form element with "mailto:myaddress@someserver.com", the data should be sent to the address. Though you should return the value made by the prompt into an element inside the form, but again, I don't know if posting such data to a Yahoo address is possible. Hotmail can I remember.But you could also choose to use server-side mail script, or even a database. With a database, it can all be full automatic :)Then you don't need to use mails to your self, nor your interferance in adding the items.
How would i make it go to my data base can you give some codes please if you can sorry not that good at java yet
Link to comment
Share on other sites

You need to be able to use php, and have a sql database (mysql is most popular, plus its free..). And please dont call it java, I cant stand when people say that because java is a completly different type of language.. Its javascript :)

Link to comment
Share on other sites

To send it to your database, you need to use mysql functions with php in the processor file. This is the file you would specify in the action attribute of the form. You would need to understand basics of communicating with the database, like with mysql_connect() and mysql_query(). Another important php function to use with databases (and not to forget) is mysql_fetch_array(). With those three basic php scripts can be made for handling the data sent by the form, and store or also get data in/from the database. It is much more difficult when you're only used to html and javascript, php is a server-side language :) If you don't know "java" yet, when you mean "javascript", php can be a very difficult step yet to come. But everything in its time, don't rush into things.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...