Dear folks , I've already created some website from scratch with html and javascript , php etc. On the other hand i also created websites with wordpress. I find the freedom in creating from scratch grandiose to say at least but wordpress to me has the benefits of professionally looking design from scratch which you dont need to code yourself and its ready made-ness.
Now i want to combine boths advantages and started a wordpress site with around 5 pages (menupoints) . Thing now is .... I want to add selfwritten files like the following php file which i've saved as testconnect.php as a webpage(menupoint). If possible i dont want to use a plugin , no i want to have the file as such saved somewhere in the wordpress directory and functioning. How do i do that ? Plenty of thx !!!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Search Contacts</title> </head> <body> <h3>Search Contacts Details</h3> <p>You may search either by first or last name</p> <form method="post" action="search.php?go" id="searchform"> <input type="text" name="name"> <input type="submit" name="submit" value="Search"> </form> <?php
if(isset($_POST['submit'])){
if(isset($_GET['go'])){
if(preg_match("/[A-Z | a-z]+/", $_POST['name'])){
$name=$_POST['name'];
//connect to the database
$db=mysql_connect ("host", "user", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
else{
echo "<p>Please enter a search query</p>";
}
}
}
?> </body> </html>