Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

2 problems with php mailer

Featured Replies

Two problems with a php mailer :

 

The 1st one

• Mailer does not work with :

<a class="button" href="javascript:" onClick="document.getElementById('form').submit()">SUBMIT</a>

 

• It uses to work well with :

<input type="Submit" name="Submit" value="send" class="submitbutton"/>

If I replace the button by the above input then it works.

 

However I have never used it with radiobuttons before : the form is submitted but radiobuttons are not processed which is trouble number 2 in this post;

The script seems to be created for multi alternative checkboxes and not for selective radiobutton.

 

What has to be changed to accomodate both submit button and radiobuttons ?

 

 

FORM

 

<form  class="form-1" id="form" method="POST" action="php/subscription.php">
<input type="text" id="name">
<input type="text" id="phone">
<input type="text" id="email">

<input type="checkbox" name="check[ ]" value="iwhishtoreceivemailing" >  WITH CHECKBOX VALUES ARE SUBMITTED  

<input type="radio" name="check[   ]" id="">  ?????????????  don´t know how to change the code for radiobuttons

<input type="text" id="message">

 <a class="button" href="javascript:" onClick="document.getElementById('form').submit()">SUBMIT</a>

 

how to make it work with this php script ??

 

 

 

 

MAILER.PHP (php code is pasted below)

<?php
if(isset($_POST['Submit'])) {
$to = "anything@whatever.com ";
$to2 = "johndoe@jackfrost.com"; 
$subject = "contact_form";
                   $name = $_POST['visitor_name'];
                   $phone = $_POST['one'];
                   $email  = $_POST['email'];
$message = $_POST['message'];

foreach( (array)$_POST['check'] as $value){
   $check_msg .= "Checked: $value\n";
} 

$body = "Name: $name\n phone: $phone\n Email : $email\n Mailing: $iwhishtoreceivemailing\n Message: $message\n";

header("Location: thankyoupage.html");
mail($to, $subject, $body );
mail($to2, $subject, $body);

} else {
echo "error_invalid_function";

Edited by ronwolpa
The code button is for code, the quote button is for quotes.

Hi ronwolpa!

 

My theory is that the reason your form is not working is because your link doesn't belong to the $_POST-variable. Try to check if the $_POST['email'] is set instead of $_POST['submit'].

 

As for the radio-buttons, you need to add a value to them, like you've done to the checkboxes. Sorry I didn't post any links or such. I'm browsing on my phone at the moment and am unable to link anything without exiting this page, nor am I able to try my theories, though I hope they work and wish you the best of lucks!

 

Regards,

/Nanashi

Edited by Nanashi

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.