Jump to content

prinzzchyz

Members
  • Posts

    5
  • Joined

  • Last visited

prinzzchyz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi I have 3 field which ID , part No and Size with submit query button this is a simple script i made and no security. if 3 fields are blank and I click Submit query button still have value 0 store in the database. how to set security if the field are blank and accidentally click submit it should be prompta message " please fill in the blank" thanks and regards
  2. Hi I have a first project for my self is to create a simple WEBSite I have a scripts that it can add new person and notify if added already the problem is that even i refresh the page the content of the database increases for example if I add Firstname Joe and the last name is MOnkey it will added to the database. then if I refresh the page it will also added to the database but it is blank please can anyone help me if my codes is correct, Im planning to make a COMMENT Menu in my website Firstname: Last name: Email: Comments: then save button Code: <?php include('connect_db.php'); $fname = $_POST['fname']; $lname = $_POST['lname']; $sqlinsert = "INSERT INTO people (firstname, lastname) VALUES ('$fname', '$lname')"; if (!mysqli_query($dbcon, $sqlinsert)) { die('error inserting new record'); } // end of my nested if statement $newrecord = "1 record added to the database"; ?> <html> <head> <title>Insert Data into DB</title> </head> <body> <h1>Insert Data into DB</h1> <form method="post" action="insert-data.php"> <input type="hidden" name="submitted" value="true" /> <fieldset> <legend>New People</legend> <label>First Name:<input type="text" name="fname" /></label> <label>Last Name:<input type="text" name="lname" /></label> </fieldset> <br /> <input type="submit" value="add new person" /> </form> <?php echo $newrecord ?> </body> </html> Thanks in Advance
  3. Hi this is now my new code I also insert height and width. The problem that i noticed is that the proper path code so i used this ../ then it works <div id="header"><h1>Website</h1> </div> <div id="menu"> <a href="index.php"><img src="../home.png" height="42" width="42"></a> <a href="index.php?p=aboutus"><img src="../about.jpg" height="42" width="70"></a> <a href="index.php?p=contacus"><img src="../contacus.jpg" height="42" width="70"></a> <a href="index.php?p=news">News</a> </div> Thank you so much
  4. Hi thanks for your reply I tried this <div id="header"><h1>Website</h1> </div> <div id="menu"> <a href="index.php"><img src="/phptest/div2_test/1.png>"Home</a> <a href="index.php?p=aboutus">About us</a> <a href="index.php?p=contacus">Contact us</a> <a href="index.php?p=news">News</a> </div> but the output is i cant see image see attached file thanks
  5. Hi I am newbie in PHP Programming or in any programming languages but Im willing to learn in PHP Programming My first project for myself is to create a simple website with a MENU Navigation like Home, About US, Contacts US and News. here is my CODE: <html> <head> <title>My First Website</title> <style type="text/css"> body { font-family: Verdana; font-size: 12px; alignment-adjust: middle; } a { color: #000; margin-right: 10px; } #menu { font-size: 10px; border-bottom: 1px solid #000; margin-left: auto; margin-right: auto; width: 650px; padding: 5px; } </style> <div id="header"><h1>My First Website</h1> </div> <div id="menu"> <a href="index.php">Home</a> <a href="index.php?p=aboutus">About us</a> <a href="index.php?p=contacus">Contact us</a> <a href="index.php?p=news">News</a> </div> <div id="content"> <?php $pages_dir = 'pages'; if (!empty($_GET['p'])) { $pages = scandir($pages_dir, 0); unset($pages[0], $pages[1]); $p = $_GET['p']; if (in_array($p.'.php', $pages)) { include ($pages_dir.'/'.$p.'.php'); } else { echo 'Sorry, Page has not found.'; } } else { include($pages_dir.'/index.php'); } ?> </div> </body> </head> </html> I just want to insert images in every menu navigation or enchance it not just only a text. Thanks in advance
×
×
  • 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.