Jump to content

Search the Community

Showing results for tags 'multiple items'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 2 results

  1. i have a php page that is opened by a form. when opened it displays 100's of rows of data from a database. what i need to do is have the user click on some rows, using either a link or a checkbox or something and then submit to the database that "that row" is now "checked" or "flagged" or something. i added a column to the database "flag" with value 0 or 1. also it is preferable to remain on same page after the database update. what would be the best way to do this? -i have tried putting a checkbox in each row, but then i dont know how to build the query at the end to submit multiple rows (how to access each row's name/value) -i then considered making each row a form itself...but seems bulky. (as i write this and wait for advice, im going to try this method it actually seems the easiest) -i considered making each row a link....but then how do i submit a query from a link(using javascript?!)
  2. So I have a form that I've been developing. I originally got the code from htmlDrive.net and have been working on applying it. Basically, I need this HTML form to post to my PHP page and generate/send the posted content into an email. I have been able to get this to work great for single selections but not for multiple selection boxes. Here is my form: <form id="formElem" name="formElem" action="mediaForm.php" method="post"> <fieldset class="step"> <legend>Media Request</legend> <p> <label for="segment">Product Segment: </label> <select name="segment[]" size="4" multiple id="segment"> <option selected> </option> <option>Pedestrian</option> <option>Industrial</option> <option>Security</option> <option>Sensorio</option> </select> </p> <p> <label for="media">Select Media: </label> <select name="media[]" size="4" multiple id="media"> <option selected> </option> <option>Catalog</option> <option>Media Kit</option> <option>Technical Binder</option> <option>General Information CD</option> </select> </p> <p> <label for="print">Printed Publication </label> <input name="print" type="checkbox" id="print"> </p> <p> <label for="digital">Digital Publication </label> <input name="digital" id="digital" type="checkbox"> </p> </fieldset> <fieldset class="step"> <legend>Personal Info</legend> <p> <label for="company">Company: </label> <input id="company" name="company" placeholder="ABC Automatics" AUTOCOMPLETE = "on" /> </p> <p> <label for="title">Job Title: </label> <input id="title" name="title" placeholder="President" AUTOCOMPLETE = "on" /> </p> <p> <label for="firstName">First Name: </label> <input id="firstName" name="firstName" placeholder="John" AUTOCOMPLETE = "on" /> </p> <p> <label for="lastName">Last Name: </label> <input id="lastName" name="lastName" placeholder="Smith" AUTOCOMPLETE = "on" /> </p> <p> <label for="customerType">Customer Type: </label> <select name="customerType[]" size="4" multiple id="customerType"> <option selected> </option> <option>Wholesale</option> <option>Distributor</option> <option>Architect</option> <option>Technician</option> <option>Sales</option> <option>End User</option> <option>Other</option> </select> <br> </p> <p> If you do not know your type, please choose "Other." </p> </fieldset> <fieldset class="step"> <legend>Contact Info</legend> <p> <label for="email">Email: </label> <input id="email" name="email" placeholder="jsmith@ABC_Auto.com" type="email" AUTOCOMPLETE = "on" /> </p> <p> <label for="phone">Phone Number: </label> <input id="phone" name="phone" placeholder="xxx-xxx-xxxx" type="tel" AUTOCOMPLETE = "on" /> </p> <p> <label for="address">Address: </label> <input id="address" name="address" placeholder="123 Enterprise Ln" AUTOCOMPLETE = "on" /> </p> <p> <label for="city">City: </label> <input id="city" name="city" placeholder="City Name" AUTOCOMPLETE = "on" /> </p> <p> <label for="state">State: </label> <input id="state" name="state" placeholder="ST" AUTOCOMPLETE = "on" /> </p> <p> <label for="zipcode">Zipcode: </label> <input id="zipcode" name="zipcode" placeholder="12345" AUTOCOMPLETE = "on" /> </p> <p> <label for="country">Country: </label> <select id="country" name="country"> <option selected> </option> <option>United States</option> <option>Mexico / Latin America</option> <option>Canada</option> <option>Other</option> </select> </p> </fieldset> <fieldset class="step"> <legend>Comments</legend> <p> <label for="comments"></label> <textarea name="comments" id="comments" placeholder="Insert additional comments here"></textarea> </p> </fieldset> <fieldset class="step"> <legend>Confirm</legend> <p> Everything in the form was correctly filled if all the steps have a green checkmark icon. A red checkmark icon indicates that some field is missing or filled out with invalid data. In this last step the user can confirm the submission of the form. </p> <p class="submit"> <button id="registerButton" type="submit" value="submit">Submit</button> </p> </fieldset> </form> My PHP: <?php if(isset($_POST['email'])) { $email_to = "email@yoursite.com"; $email_subject = "Media Request Form"; $segment = $_POST['segment']; $media = $_POST['media']; $print = $_POST['print']; $digital = $_POST['digital']; $company = $_POST['company']; $title = $_POST['title']; $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $customerType = $_POST['customerType']; $email = $_POST['email']; $phone = $_POST['phone']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zipcode = $_POST['zipcode']; $country = $_POST['country']; $comments = $_POST['comments']; $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Company: ".clean_string($company)."\n"; $email_message .= "Title: ".clean_string($title)."\n"; $email_message .= "Name: ".clean_string($firstName)." ".clean_string($lastName)."\n"; $email_message .= "Type: ".clean_string($customerType)."\n\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Phone: ".clean_string($phone)."\n"; $email_message .= "Address: ".clean_string($address)."\n"; $email_message .= "City: ".clean_string($city)."\n"; $email_message .= "State: ".clean_string($state)."\n"; $email_message .= "Zipcode: ".clean_string($zipcode)."\n"; $email_message .= "Country: ".clean_string($country)."\n\n"; $email_message .= "Segment: ".clean_string($segment[])."\n"; $email_message .= "Media Type: ".clean_string($media)."\n"; $email_message .= "Printed Copy: ".clean_string($print)."\n"; $email_message .= "Digital Copy: ".clean_string($digital)."\n\n"; $email_message .= "Comments: ".clean_string($comments)."\n\n"; // create email headers $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <!-- include your own success html here --> Thank you for contacting us. We will be in touch with you very soon. <?php } ?> My multiple selectors are not showing up correctly. They are only outputting "array" for the content. Any help would be much appreciated! Thanks!
  • 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.