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.

kornfreak

Members
  • Joined

  • Last visited

Everything posted by kornfreak

  1. Hi There, I'm new here (Hi) but would really appreciate some help after having spent the last day trying to find and work an answer without any success. I've got a problem trying to solve an issue for passing a hidden form field. I'm building a small hotel directory website (very small only nine hotels). Each hotel page has its own contact form below: <form id="contact-form" class="clearfix"> <div class="success-message">Contact form submitted.</div> <fieldset class="fleft"> <label class="name"> <input type="text" placeholder="Name:" data-constraints="@Required @JustLetters" /> <span class="empty-message">*This field is required.</span> <span class="error-message">*This is not a valid name.</span> </label> <label class="email"> <input type="text" placeholder="E-mail:" data-constraints="@Required @Email" /> <span class="empty-message">*This field is required.</span> <span class="error-message">*This is not a valid email.</span> </label> <label class="phone"> <input type="text" placeholder="Phone:" data-constraints="@Required @JustNumbers"/> <span class="empty-message">*This field is required.</span> <span class="error-message">*This is not a valid phone.</span> </label> </fieldset> <fieldset class="fright"> <label class="message"> <textarea placeholder="Message:" data-constraints='@Required @Length(min=20,max=999999)'></textarea> <span class="empty-message">*This field is required.</span> <span class="error-message">*The message is too short.</span> </label> </fieldset> <div class="form_buttons"> <a href="#" data-type="submit" class="link">send message</a> </div> </form> Now I need to add a hidden field with the name of the hotel for each contact form on each hotels page, here is the PHP code: <?php $owner_email = $_POST["owner_email"]; $headers = 'From:' . $_POST["email"] . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n"; $subject = 'A message from your site visitor ' . $_POST["name"]; $messageBody = ""; if($_POST['name']!='nope'){ $messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n"; $messageBody .= '<br>' . "\n"; } if($_POST['email']!='nope'){ $messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n"; $messageBody .= '<br>' . "\n"; }else{ $headers = ''; } if($_POST['state']!='nope'){ $messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "\n"; $messageBody .= '<br>' . "\n"; } if($_POST['phone']!='nope'){ $messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n"; $messageBody .= '<br>' . "\n"; } if($_POST['fax']!='nope'){ $messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n"; $messageBody .= '<br>' . "\n"; } if($_POST['message']!='nope'){ $messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n"; } if($_POST["stripHTML"] == 'true'){ $messageBody = strip_tags($messageBody); } try{ if(!mail($owner_email, $subject, $messageBody, $headers)){ throw new Exception('mail failed'); }else{ echo 'mail sent'; } }catch(Exception $e){ echo $e->getMessage() ."\n"; } ?> Any help would be bloody marvellous!!! Kornfreak
  2. Hi Everyone, Pretty new to all this so hopefully I won't come across dumb a**! Looking forward to hopefully gaining some knowledge and help along the way. Kornfreak PS Just posted this topic looking for help http://www.webdesignerforum.co.uk/topic/73442-need-help-passing-hidden-form-field-php/

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.