Jump to content

wiredphp

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

wiredphp's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i to does, i see the items from database and that is good, but i need them to send me to specific page. if I have home, about, etc I want them to send me, when I click on them to home.php or about.php
  2. I'll try to be more specific. Menu has shown up, as expected but now hot to make item in menu, exampe: home, about, gallery to be links to pages home.php, about.php... how to make menu items to be links....
  3. Hi, I'm doing web page menu that will be stored in mysql database called 'menitest' it has 2 fields, menu id (INT) and item (VARCHAR). For now I made index.php and style.css, menu is ul list, connection to database works, and I'm managed to get everythig works. menu is populated from database, and that is fine, but what I need is help to make menu items to links to another pages. here is the code for now. index.php <?php include('testconnect.php'); //calling menu from database $query_sql = "SELECT * FROM meni"; $item_query = mysql_query($query_sql) or die(mysql_error()); $rsitem = mysql_fetch_assoc($item_query); ?> <! DOCTYPE html> <html> <head><title></title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <link rel="stylesheet" href="style2.css" type="text/css" /> </head> <body> <nav> <ul> <?php do { ?> <li><a href="menutest.php?meni_ID=<?php echo $rsitem['meni_ID']; ?>"><?php echo $rsitem['item']; ?></a></li> <?php }while ($rsitem = mysql_fetch_assoc($item_query)); ?> </ul> </nav> </body> </html> menutest.php does not be there, it just page that I use for testig to see if it works...
  4. Hi, I need tips and sugestions for form that I crated, just basic stuff. Also there is couple things that I need to do: 1) when submitted, form should to print message that form is sent, or if something is not ok, to display error mesage, everything on same page example, contact.php 2) now, when form is sent I recive it on email, but feedback field, textarea give me html tags for new line and something like that here is the code, please help: <?php if(empty($_POST["name"])) { die("Please provide valid name"); } ?> <?php if(is_numeric($_POST["name"])) { die("Please provide valid name"); } ?> <?php $email = $_POST["email"]; if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email)) { die("E-mail address not valid"); }; ?> <?php if(empty($_POST["subject"])) { die("Plese enter a subject."); } ?> <?php if(!isset($_POST['submit'])) { $ToEmail = 'xxx@yahoo.com'; $EmailSubject = 'Pitanje sa xxx.com'; $mailheader = "From :". $_POST["email"]. "\r\n"; $mailheader .= "Reply to :". $_POST["email"]. "\r\n"; $mailheader .= "Ova poruka sadrzi pitanje postavljeno na www.xxxx.com \r\n"; $MESSAGE_BODY = "Ime : " .$_POST["name"]." \r\n"; $MESSAGE_BODY .= "Email : " .nl2br($_POST["email"])." \r\n"; $MESSAGE_BODY .= "Naslov : " .$_POST["subject"]." \r\n"; $MESSAGE_BODY .= "Poruka : " .nl2br($_POST["feedback"])." \r\n"; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); echo "Vasa poruka je uspjesno poslana! Kliknite <a href=\"index.html\">ovde</a> za pocetnu stranu "; }; ?>
  5. so what I did for now is to see if fields are set, if not code shuld return message to enter req field. but, to do that I need to remove onBlur javascript value from contact form becuse php used default value to send it, if you know what I mean. now it dosen't look like I wanted to... is there posibility to somehow hide that default vaule? <?php if(empty($_POST["name"])) { die("Please provide valid name"); } ?> <?php if(is_numeric($_POST["name"])) { die("Please provide valid name"); } ?> <?php $email = $_POST["email"]; if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email)) { die("E-mail address not valid"); }; ?> <?php if(empty($_POST["subject"])) { die("Plese enter a subject."); } ?> <?php if(!isset($_POST['submit'])) { $ToEmail = 'ndneasystems@yahoo.com'; $EmailSubject = 'Pitanje sa ndnea.com'; $mailheader = "From :". $_POST["email"]. "\r\n"; $mailheader .= "Reply to :". $_POST["email"]. "\r\n"; $mailheader .= "Ova poruka sadrzi pitanje postavljeno na www.ndnea.com \r\n"; $MESSAGE_BODY = "Ime : " .$_POST["name"]." \r\n"; $MESSAGE_BODY .= "Email : " .nl2br($_POST["email"])." \r\n"; $MESSAGE_BODY .= "Naslov : " .$_POST["subject"]." \r\n"; $MESSAGE_BODY .= "Poruka : " .nl2br($_POST["feedback"])." \r\n"; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); echo "Vasa poruka je uspjesno poslana! Kliknite <a href=\"index.html\">ovde</a> za pocetnu stranu "; }; ?>
  6. Thank you. Now I will try to validate fields from form. If you know any good online tutorial of form handling please post it. And sorry for my bad english.
  7. I will give it a try... I'm new to php so.... anyway, thanks, I hope that will work...
  8. echo is there because I didn't know how to redirect, so I put it there so that users can return to page, and not to see blank page...
  9. so here is my code: <?php if(!isset($_POST['submit'])) { $ToEmail = 'ndneasystems@yahoo.com'; $EmailSubject = 'Pitanje sa ndnea.com'; $mailheader = "From :". $_POST["email"]. "\r\n"; $mailheader .= "Reply to :". $_POST["email"]. "\r\n"; $mailheader .= "Ova poruka sadrzi pitanje postavljeno na www.ndnea.com \r\n"; $MESSAGE_BODY = "Ime : " .$_POST["name"]." \r\n"; $MESSAGE_BODY .= "Email : " .nl2br($_POST["email"])." \r\n"; $MESSAGE_BODY .= "Naslov : " .$_POST["subject"]." \r\n"; $MESSAGE_BODY .= "Poruka : " .nl2br($_POST["feedback"])." \r\n"; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); echo "Vasa poruka je uspjesno poslana! Kliknite <a href=\"index.html\">ovde</a> za pocetnu stranu "; }; ?> so what I want to do is, when user submited form to be redirected to contact page... any suggestions?
×
×
  • 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.