This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello October Community! I'm currently partaking in the lovely job of transferring a straight file based PHP site, with no CMS, to October. I've gotten just about everything from styles to Javascript setup, but I'm having one main problem.
I can't seem to get those PHP forms to work. Below is a sample of the original form
<aside class="sidebar">
<div class="info-message">
<p>Into paragraph</p>
</div>
<div class="evaluation-form">
<?php if (isset($_REQUEST['mess'])) { ?>
<p class="info">Thank you for your enquiry, a representative from Someone <strong>Somewhere</strong> will get back to you within 24 hours</p>
<?php } ?>
<form class="validate" enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>?mess=true">
<strong class="ttl">Your Details</strong>
<div class="row">
<input name="sidebar_form" value="true" type="hidden" value="">
<input id="name" name="name" class="required <?php if(!isset($_POST['name'])){ echo 'defaultInvalid'; } ?>" type="text" value="<?php if((isset($_POST['name']))){ echo $_POST['name']; } else{ echo 'Name'; } ?>">
</div>
<div class="row">
<input id="email" class="email" type="text" name="email" value="<?php if((isset($_POST['email']))){ echo $_POST['email']; } else{ echo 'Email'; } ?>">
</div>
<div class="row">
<input id="phone" name="phone" class="required <?php if(!isset($_POST['phone'])){ echo 'defaultInvalid'; } ?>" type="text" value="<?php if((isset($_POST['phone']))){ echo $_POST['phone']; } else{ echo 'Phone'; } ?>">
</div>
<strong class="ttl">SomeDetails</strong>
<div class="row">
<select class="required" name="model">
<option></option>
<option>Option1</option>
<option>Option2</option>
<option>Option3</option>
<option>Option4</option>
<option>Option5</option>
<option>Option6</option>
</select>
</div>
<div class="row">
<input type="text" name="modelno" value="<?php if((isset($_POST['modelno']))){ echo $_POST['modelno']; } else{ echo 'Model no'; } ?>">
</div>
<ul class="check-list">
<li>
<label for="o_box">Original box:</label>
<input id="o_box" type="checkbox" name="orig-box" value="1">
</li>
<li>
<label for="o_papers">Original papers:</label>
<input id="o_papers" type="checkbox" name="orig-pap" value="1">
</li>
</ul>
<div class="row">
<label>Upload picture:</label>
<div class="container">
<input type="file" name="uploaded_file" >
</div>
</div>
<div class="row">
<input type="text" name="old" value="<?php if((isset($_POST['old']))){ echo $_POST['old']; } else{ echo 'How old is your watch?'; } ?>">
</div>
<div class="row">
<input type="text" name="price" value="<?php if((isset($_POST['price']))){ echo $_POST['price']; } else{ echo 'Asking price'; } ?>">
</div>
<div class="row">
<textarea name="add_info" name="info" cols="30" rows="10"><?php if((isset($_POST['add_info']))){ echo $_POST['add_info']; } else{ echo 'Additional info'; } ?></textarea>
</div>
<div class="row">
<button class="btn-request">Request Your FREE Evaluation</button>
</div>
</form>
</div>
</aside>
Besides pointing out I really need to learn PHP (and if this is just a case of un-education, let me know so I can study up), I'd appreciate any advice on how to get this form to start working on my OctoberCMS site!
Really, any and all help is appreciated.
-Harry
For anyone else wondering how to do this, I am experimenting with using a PHP script outside of the OctoberCMS shell that will execute the form intake and email the submissions. I have success in getting it to write to a txt file. Feel free to reply if you want some code snippets.
1-3 of 3