Jump to content

Recommended Posts

Hi guys.

 

Ive created a in website mail system for my website, however i am not using a button for the submit. I am using normal text and javascript to submit form which works fine BUT

 

in order to insert the information into the database im using

 

 if (isset($_POST[''])) { 

 

Now if i was using a button to submit it and had the name as submit i would enter submit into the post area however im not using any names. How would i go about inserting the information into my database?

 

Thanks

 

Dane

Link to comment
https://forums.phpfreaks.com/topic/48477-solved-isset/
Share on other sites

If you don't name your form fields then the browser will use numbers as the names, for example $_POST[0] will be the first field, $_POST[1] will be the second, $_POST[2] will be the third etc.

 

You should really name your fields, It will be a lot easier identifying where your data is coming from rather then numbers.

Link to comment
https://forums.phpfreaks.com/topic/48477-solved-isset/#findComment-237126
Share on other sites

You don't have to use a submit button if you don't want to. If you are using a link to submit the form then give the form itself a name and then use the following HTML to submit the form:

<a href="javascript:void(0)" onClick="document.MYFORM.Submit();">Send Mail</a>

When you click the link it will submit the form.

 

In your code you don't check for the submit button, as you don't have one. All you do is check the required fields are filled in, such as To, Subject, From and Message for example.

Link to comment
https://forums.phpfreaks.com/topic/48477-solved-isset/#findComment-237140
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.