Jump to content

insert query for text field


Spraban9

Recommended Posts

hi guys,

i create the form for registration

i going to confirm via phone number

"INSERT INTO ozekimessageout (receiver,msg,status) VALUES ('".$contact."','".$randomno."','send')"

this query is working but i want to save this for button click event 

but already i have the save button for registration form

i want one more button to run this query

 

plz help me guys.

 

 

Link to comment
Share on other sites

You could do something like this?

<form action="user.page.php?page=3" method="post">

<input type="hidden" name="action" value="process" />


<input type="text" name="phone" value="" />

<input type="submit" name="submitButton" id="submitButton" value="SUBMIT" /></form><br />
 

Then all you have to do is something like this

 

 

 

  if ( isset( $_POST["action"] ) and $_POST["action"] == "process" ) {
           $phone = htmlspecialchars($_POST['phone']);
           // Your function to the write to database?     
    }    
 

The above would probably be best at the top of you page before the header portion of your html.

Edited by Strider64
Link to comment
Share on other sites

but it not working i try this coding

	  if ( isset( $_REQUEST["action"] ) ) {
           $phone = htmlspecialchars($_POST['contact']);
		   
		   
           	$que=mysql_query("INSERT INTO ozekimessageout (receiver,msg,status) VALUES ('".$phone."','".$randomString."','send')");  
    }  	  

plz help me

i want save this message on buttin click 

 

   <label>Contact No</label></span></td>
            <td><input required name="contact" type="text" value=""  width="250" $pattern = "/^(\+94\s?7\d{3}|\s?\d{3}\s?\d{3}$/"; x-moz-errormessage="Mobile Phone is Required!"><input type="button" name="action" value="process" />
Edited by Spraban9
Link to comment
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.