We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
PHP Form?
Comments
-
Any reason for not using HTML forms, and passing the data into PHP.
<?php if ($_GET['action'] == "bus_sub")!! $to = "enquiries@onethoughtpgd.co.uk"; $subject = "Business Directory Listing"; $email = $_POST['email'] ; $message = $_POST['message'] ; $busname = $_POST['business_name']; $cat = $_POST['category']; $phone = $_POST['phone_number']; $web = $_POST['website']; $contact = $_POST['contact'] ; $str_message = "Contact Name: " . $contact . "\n\n" . "Message: " . $message . "\n\n" . "Business Name: " . $busname . "\n\n" . "Category: " . $cat . "\n\n" . "Phone: " . $Phone . "\n\n" . "Email: " . $email; $sent = mail($to, $subject, $str_message); if($sent) !! print "Your mail was sent successfully, please allow 2-3 working days for your information to be placed on the site."; } else !! print "We encountered an error sending your mail"; } } else !! ?> <form method="post" action="contactbusiness.php?action=bus_sub"> <p align="left"> Your Name: <input type=text name="business_name" /><br /> Message: <textarea name="message" rows="10" cols="25"></textarea><br /> <br><br /> Business Name: <input type=text name="business_name" /><br /> <br> Category: <input type=text name="category" /><br /> <br /> Phone Number: <input type=text name="phone" /><br /> <br /> Email: <input type=text name="email" /><br /> <br /> Website:<input type=text name="website" /><br /> </p> <input type="submit" value="submit"> </p> </form> <? } ?>
Works, just needs tarting up. Name it contactbusiness.php and your away.
JoelFreeBSD | Microsoft | Linux Nerd
GNU-PG Key-ID: 0xCBC2F26D
BSc MBCS MCP0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 352.1K Banking & Borrowing
- 253.6K Reduce Debt & Boost Income
- 454.2K Spending & Discounts
- 245.1K Work, Benefits & Business
- 600.7K Mortgages, Homes & Bills
- 177.5K Life & Family
- 258.9K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards