wordpress - Adding a Select Field to PHP form -


i following this tutorial , going , works brilliantly. i've been able change , add relevant fields need... except one. trying add 'select' field visitors can select inquiry type list. i've attempted few different ways, literally no experience in php i'm finding difficult.

could give me guidance towards how so?

thanks much.

pretty bad tutorial
horrific code

just add <select> inside form. style css.

echo '<form action="' . esc_url( $_server['request_uri'] ) . '" method="post">'; echo '<select><option>option 1</option><option>option 2</option><option>option 3</option></select>'; echo '<p>'; 

this better code:

$uri = $_server["http_host"] . $_server['path_info']; $cf_name = htmlspecialchars( $_post["cf-name"] ) ; $cf_email = htmlspecialchars( $_post["cf-email"] ); $cf_subject = htmlspecialchars( $_post["cf-subject"]); $cf_message = htmlspecialchars( $_post["cf-message"]);  echo <<<eof <form action="$uri" method="post"> <select><option>option 1</option><option>option 2</option><option>option 3</option></select> <p>your name (required) <br/> <input type="text" name="cf-name" pattern="[a-za-z0-9 ]+" value="$cf_name" size="40" /></p> <p>your email (required) <br/><input type="email" name="cf-email" value="$cf_email" size="40" /></p> <p>subject (required) <br/><input type="text" name="cf-subject" pattern="[a-za-z ]+" value="$cf_subject" size="40" /></p> <p>your message (required) <br/> <textarea rows="10" cols="35" name="cf-message">$cf_message</textarea></p> <p><input type="submit" name="cf-submitted" value="send"></p> </form> eof; 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -