Jump to content

Recommended Posts

Hi All,

 

I am trying to create a call to action feature on my website, I am trying to send data from one form to another by using the post function and on the second form when the user clicks submit the data should be sent to the database, I can send data to the other form when they submit the data the data is not sent to the database, What could be the problem?

 

code:

 

<div class="callback" style='width:150px'>

  <form action='calltoaction.php' method='post'>

  <table width='320' border="1">

  <tr>

  <td width='139'>

  <p>Next Step</p>

  <p>Connect with Us</p>                   

  </td>

  <td rowspan='2'>

  <textarea name='user_question' rows='4'  placeholder='Please ask a question and we will respond as quick as possible' value='<?php echo $_POST['user_question'] ?>'></textarea>

  </td>

  </tr>

  <tr>

  <td>

  <input name='user_name' placeholder='Please enter your name' class='required' required value='<?php echo $_POST['user_name'] ?>' />

  </td>

  </tr>

  <td align='center'>

  <input type='submit' value='ask a question' />

  </td>

  <tr>

  <td><input name="website_id" type="hidden" value="1" /></td>

  </tr>

  </tr>

  </table>

  </form>

    </div>

 

Calltoaction:

 

  <div class="callback" style='width:150px'>

  <form method='post'>

  <table width='320' border="1">

  <tr>

  <td width='250'>

  <p>Next Step</p>

  <p>Connect with Us</p> 

  <tr>                                   

  <td><input name='user_name' type='text' placeholder='Please enter your name' class='required' required value='<?php echo $_POST['user_name'] ?>'/></td>

  </tr>

  <tr>

  <td><textarea name='user_question' rows='4' placeholder='Please ask a question and we will respond as quick as possible' value='<?php echo $_POST['user_question'] ?>'></textarea></td>

  </tr>

  <tr>

  <td><input name='call_email' type='text' placeholder='Please enter your email' class='required' required value='<?php echo $_POST['user_email'] ?>'/></td>

  </tr>

  <tr>

  <td><input name='call_callback' class='datepicker' placeholder='best time for callback' value='<?php echo $_POST['call_calback'] ?>'/>optional</td>

  </tr>

  <tr>

  <td><input name='call_tel' type='text' placeholder='telephone number' value='<?php echo $_POST['call_tel'] ?>' />optional</td>

  </tr>

  </td>

  </tr>

  <td align='right'>

  <button name='submit' type='submit'>Submit query</button>

  </td>

  </tr>

  </table>

  </form>

    </div>

 

Thank You

Link to comment
https://forums.phpfreaks.com/topic/266723-call-to-action-on-my-website/
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.