Jump to content

enlighten

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Everything posted by enlighten

  1. Ok ive managed to do everything i needed. The only problem now is the form or message is in the wrong place, it's all at the top of the page because thats where the code is, how do i place it where it should be?, to see where it should be look here http://www.eminence-logistics.co.uk. Thanks
  2. At the moment i have this as my home page. and you can see where hte login form is, basically if the session is equal to 1 i want this bit to say welcome instead of the form if equal to null i want it to stay on same page but for the login form to show. Any thoughts? <?PHP session_start(); if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) { header ("Location: login.php"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <!-- Meta --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="language" content="en" /> <meta name="robots" content="index,follow" /> <meta name="author" content="Thomas Burman" /> <meta name="description" content="Eminence Logistics is dedicated to delivering innovative, value added logistics solutions with unparalleled levels of service and commitment." /> <meta name="keywords" content="fulfilment,fulfillment,services,order fulfillment,warehousing, pick, pack, retail,shipping,air,freight,sea,fmcg,kent,south,east,UK,distribution" /> <meta name="robots" content="noodp,noydir" /> <!-- CSS --> <!--[if IE]> <link rel="stylesheet" type="text/css" href="ie-style.css" /> <![endif]--> <link rel="stylesheet" type="text/css" href="style.css" /> <link href="css/screen.css" rel="stylesheet" type="text/css" media="screen" /> <link href="css/top-nav.css" rel="stylesheet" type="text/css" media="screen" /> <!-- Scripts --> <script type="text/javascript" src="js/jquery-1.5.1.min.js"></script> <script type="text/javascript" src="js/easySlider1.7.js"></script> <script language="JavaScript" src="scripts/gen_validatorv31.js" type="text/javascript"></script> <script type="text/javascript" src="js/jquery.vticker-min.js"></script> <script type="text/javascript" src="js/top-nav.script.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#slider").easySlider({ auto: true, continuous: true, controlsShow: false, pause: 6250 }); $('#news-container').vTicker({ speed: 1000, pause: 6250, animation: 'fade', mousePause: false, showItems: 1 }); }); </script> <title>Eminence Logisitics</title> </head> <body> <!-- Top Banner --> <div id="top-banner"> <div id="logo"> <a href="index.html"><img src="images/CB_EM_LOGO.png" width="350" height="140" alt="Eminence Logistics"/></a> </div> <div id="top-contact"> <div id="top-number"> <p id="call">Call now for free consultation:</p> <p id="no">Tel +44 (0)1634 244074</p> </div> </div> <div id="log-in"> <h2>Log In Here</h2> <form action="check_user.php" method="post" name="" id=""> <table width="50%" border="0" align="center" cellpadding="4" cellspacing="0"> <tr> <td>Username</td> <td><input name="username" type="text" id="username"></td> </tr> <tr> <td>Password</td> <td><input name="password" type="password" id="password"></td> </tr> <tr> <td> </td> <td><input type="submit" value="Sign In" class="text_button"></td> <td></td> </tr> </table> </form> <!-- <p> Member area coming soon! </p> --> </div> </div> <!-- Main Body --> <div id="wrapper"> <div id="main-wrapper"> <div class="menu"> <ul id="jsddm"> <li id="home_link"><a href="index.html">Home</a></li> <li><a href="about.html">About Us</a></li> <li><a href="shipping.html">Shipping</a> <ul> <li><a href="air.html">Air Cargo</a></li> <li><a href="sea.html">Sea Cargo</a></li> </ul> </li> <li><a href="warehousing.html">Warehousing</a> <ul> <li><a href="trad.html">Traditional</a></li> <li><a href="retail.html">Retail/</br>Pick & Pack</a></li> <li><a href="fmcg.html">FMCG</a></li> <li><a href="ecom.html">Ecommerce</a></li> </ul> </li> <li><a href="distribution.html">Distribution</a> <ul> <li><a href="deliveries.html">Deliveries</a></li> <li><a href="pallets.html">UK Pallets</a></li> </ul> </li> <li><a href="reverse_logs.html">Reverse Logs</a></li> <li><a href="packaging.html">Packaging</a></li> </ul> <br style="clear:left"/> </div> <div id="top-left-col"> <div id="social"> <div id="icon"> <p class="icon"><a href="#"><img src="images/Twitter_64.png" width="48" height="48" alt="Eminence Logistics on Twitter"/></a></p> <p class="icon"><a href="#"><img src="images/Facebook_64.png" width="48" height="48" alt="Eminence Logistics on Facebook"/></a></p> <p class="icon"><a href="#"><img src="images/Google_64.png" width="48" height="48" alt="Eminence Logistics on Google +"/></a></p> </div> </div> <div id="quick-link-1" class="sidebar-links"> <h2 class="ql-title">Track & Trace</h2> <!-- <form action="checktrack.php" method="post" name="" id=""> <table id="track"> <tr> <td>Enter your reference no.</td> </tr> <tr> <td><input name="reference" size="15" type="text" id="reference"></td> </tr> <tr> <td><INPUT TYPE="image" SRC="images/track_but.png" HEIGHT="25" WIDTH="100"></td> </tr> </table> </form> --> <p> Track and trace feature coming soon! </p> </div> </div> <div id="slider-outside"> <div id="slider"> <ul> <li><img src="slider_images/slide1.jpg" alt="Eminence Logistics | Proffesionalism | Cost Effectiveness | Speed" /></li> <li><img src="slider_images/slide2.jpg" alt="Eminence Logistics | Space | Warehousing" /></li> <li><img src="slider_images/slide3.jpg" alt="Eminence Logistics | Warehousing" /></li> <li><img src="slider_images/slide4.jpg" alt="Eminence Logistics | Delivery | Sea | Air " /></li> <li><img src="slider_images/slide5.jpg" alt="Eminence Logistics | Packaging " /></li> </ul> </div> </div> <div id="left-column"> <div id="quick-link-2"class="sidebar-links"> <h2 class="ql-title">Contact Us</h2> <form method="POST" name="contactform" action="contact-form-handler.php"> <p> <label for='name'>Your Name:</label> <br> <input type="text" size="18" name="name"> </p> <p> <label for='email'>Email Address:</label> <br> <input type="text" size="18" name="email"> <br> </p> <p> <label for='message' >Message:</label> <br> <textarea name="message" rows="8" cols="14"></textarea> </p> <INPUT TYPE="submit" class="button" HEIGHT="35" WIDTH="125"><br> </form> <script language="JavaScript"> var frmvalidator = new Validator("contactform"); frmvalidator.addValidation("name","req","Please provide your name"); frmvalidator.addValidation("email","req","Please provide your email"); frmvalidator.addValidation("email","email", "Please enter a valid email address"); </script> </div> <div id="quick-link-3"class="sidebar-links"> <a href="team.html"><img src="images/meet_team.png" alt=" Eminence Logistics Team"/></a> </div> </div> <div id="right-column"> <h1 id="main-title">Welcome to Eminence Logistics</h1> <p id="text-block-1"> Eminence Logistics is dedicated to delivering innovative, value added logistics solutions with unparalleled levels of service and commitment. We have earned a reputation for our innovation and ability to reduce costs whilst improving service. </p> <p id="text-block-2"> Our core services are complemented by a strong understanding of the industry. We are best placed to deliver supply chain and logistics solutions and benefits. We are a UK company in central Kent and we have a strong network for deliveries, a manufacturing plant & warehouse in Newmarket and forwarding offices in China. Operating in a modern, fast-moving logistics arena, we have amassed an enviable skills base and experience in various fields. </p> <p id="text-block-3"> Our expertise extends to all areas of the Supply Chain. From shipping to delivery on time and in full, with a large network of third parties who will support and collaborate with us to help your business. These areas are Customer services, customs & duty, consulting and negotiating. </p> </div> </div> <!-- Footer --> <div id="footer"> <div id="bottom-links"> <div id="bottom-link-1" class="bottom-links"> <h2 class="ql-title">Latest News</h2> <div id="news-container"> <ul> <li> <div class="news-item"> <h2>News Item 1</h2> jugbit.com jquery vticker more info more info more info more info more info </div> </li> <li> <div class="news-item"> <h2>News Item 2</h2> Lorem ipsum dolor sit amet, porta at, imperdiet id neque. more info </div> </li> <li> <div class="news-item"> <h2>News Item 3</h2> Lorem ipsum dolor sit amet, consectetur adipiscing elit. more info </div> </li> <li> <div class="news-item"> <h2>News Item 4</h2> Lorem ipsum dolor sit amet more info more info more info more info </div> </li> </ul> </div> </div> <div id="bottom-link-2" class="bottom-links"> <h2 class="ql-title">Request a call back...</h2> <a href="call-back.html"><h3>Click here to</br>request a call back</br>for your convenience</h3> <img id="call-img" style="float: right;" alt="Eminence Logistics Call Back" src="images/Google voice.png"/></a> </div> <div id="bottom-link-3" class="bottom-links"> <div id="inner-3"> <h2 class="ql-title">Associations</br> &nbsp &nbsp &nbsp we are part of...</h2> <img id="pall-ex" class="assoc" src="images/uk-pallets-logo.png"> <img id="rha" class="assoc" src="images/RHA-logo.png"> <img id="ukwa" class="assoc" src="images/ukwa_logo.png"> </div> </div> <div id="bottom-nav"> <p id="bot-links">|&nbsp <a href="index.html">Home</a> &nbsp | &nbsp <a href="recruitment.html">Recruitment</a> &nbsp | &nbsp <a href="privacy.html">Privacy Policy</a> &nbsp | &nbsp <a href="sitemap.xml">Site map</a> &nbsp | &nbsp <a href="contact.html">Contact</a> &nbsp |</p> <p id="copy">All Rights Reserved &copy Eminence Logistics 2011</p> <p id="design"><a href="http://www.enlightenwebdesign.co.uk">Designed by Enlighten Web Design</a></p> </div> </div> </div> </body> </html> Thanks again
  3. I been trying to use SESSIONS, how would you do it with these, because everything i seem to try it doesn't work Thanks for the response
  4. Hi guys, Im building a website for a company http://www.eminence-logistics.co.uk and the client wants a log in system which im having problems with. The registration system is all working fine. If you go to the website you can see where the login form is. Now when the user isn't logged in i need the form to show, but when the user IS logged in i would like a message replacing the form saying welcome, along with a log out button. How do i do this? Thankyou very much Enlighten
  5. Hi Guys, just been writing this script up but for some reason the validation is messing up creating account, apparently nothing is valid that i put in Any ideas? the .phps are below and the .inc ar all below. Also when i try to log in with an existing user it says i cant because the username or password is incorrect which is isn't. Any help will be much appreciated. Enlighten <?php /* File: login_reg_form.inc * Desc: Contains the code for a web page that displays two html forms, side by side. One is a login form, and the second is a registration form. */ include("functions.inc"); ?> <head><title>Customer Login page</title> <style type='text/css'> <!-- label { font-weight: bold; float: left; width: 27%; margin-right: .5em; text-align: right; } legend { font-weight: bold; font-size: 1.2em; margin-bottom: .5em; } #wrapper { margin: 0; padding: 0; } #login { position: absolute; left: 0; width: 40%; padding: 1em 0; } #reg { position: absolute; left: 40%; width: 60%; padding: 1em 0; } #field { padding-bottom: .5em; } .errors { font-weight: bold; font-style: italic; font-size: 90% color: red; margin-top: 0; } --> </style> </head> <body style="margin: 0"> <?php $fields_1 = array("fusername" => "User Name", "fpassword" => "Password"); $fields_2 = array("user_name" => "User Name", "password" => "Password", "email" => "Email", "first_name" => "First Name", "last_name" => "Last Name", "street" => "Street", "city" => "City", "county" => "County", "post_code" => "Post Code", "phone" => "Phone", "fax" => "Fax"); ?> <div id="wrapper"> <div id="login"> <form action=<?php echo $_SERVER['PHP_SELF']?> method="POST"> <fieldset style='border: 2px solid #000000'> <legend>Login Form</legend> <?php if (isset($message_1)) { echo "<p class='errors'>$message_1</p>\n"; } foreach ($fields_1 as $field => $value) { if(preg_match("/pass/i", $field)) $type = "password"; else $type = "text"; echo "<div id ='field'> <label for='$field'>$value</label> <input id='$field' name='$field' type= '$type' value='".@$$field."' size='20' maxlength='50' /> </div>\n"; } ?> <input type="submit" name="Button" style='margin-left: 45%; margin-bottom: .5em' value="Login" /> </fieldset> </form> <p style='text-align: center; margin: 1em'> If you already have an account, log in.</p> <p style='text-align: center; margin: 1em'> If you do not have an account, register now.</p> </div> <div id='reg'> <form action=<?php echo $_SERVER['PHP_SELF']?> method="POST"> <fieldset style='border: 2px solid #000000'> <legend>Registration form</legend> <?php if(isset($message_2)) { echo "<p class='errors'>$message_2</p>\n"; } foreach($fields_2 as $field => $value) { if (preg_match("/pass/i", $field)) $type="password"; else $type="text"; echo "<div id='field'> <label for='$field'>$value</label> <input id='$field' name='$field' type='$type' value='".@$$field."' size='40' maxlength='65' /> </div>\n"; } // end foreach field ?> <input type="submit" name="Button" style='margin-left: 45%; margin-bottom: .5em' value="Register"> </fieldset> </form> </div> </div> </body></html> 17238_.php 17239_.php 17240_.php
  6. Ok so yeah i took out all md5 encryptions and now it works perfectly. SO why was this md5 causing a problem within the database? Thanks Enlighten
  7. Thanks for your test help. Id one exactly what you said and this is what got echoed. 5f4dcc3b5aa765d61d8327deb882cf99SELECT first_name FROM users WHERE user_name='tommy' AND password=md5 ('password') No i guess that long line of numbers and letters is what is in the database but im not sure why its doing that. My password field is simply a varchar with a length of 20, any ideas? Thanks Enlighten
  8. Yes i am using phpMyAdmin and yes i believe they are, there are 4 fields ID : Auto_increment INT user_name: varchar password: varchar first_name: varchar It's pretty simple so i don't see whats going wrong. Thanks Again Enlighten
  9. Thanks very much for your input guys you have helped my out over the first hurdle so thanks!. It all seems to be working connecting etc now but one more problem, I entered some data (first_name,user_name and password) into the database, so now when i am testing the form and entering the username and password it always comes up with username and password not found. But the data is obviously in the database and i am definately typing it in correctly. Any ides? Thanks Enlighten
  10. Ok Thanks, Just to clarify what code needs to be in the dbstuff.inc? Could i see an example please. Thankyou Enlighten
  11. Hi Guys, i got the PHP and MYSQL for dummies (4th addition) and i am typing up the code examples myself just to gain the experience. Im at the end of the book nearly where it is talking about log in applications that add info to the url but for some reason the code doesn't work. Im using Xampp as a localhost server. Attached are the two scripts for the program, and below is the include file. I open up the login_url form first: form_log.inc: <?php /* Program name: form_log.inc * Description: Displays a login form */ if( isset ( $message ) ) { echo $message; } echo "<form action='$_SERVER[php_SELF]' method='POST' style='margin: .5in'>\n <p><label for='username' style='font-weight: bold; padding-bottom: 1em'>User ID: </label> <input type='text' name='user_name' id='user_name' value='$user_name' />\n</p> <p><label for='password' style='font-weight: bold'>Password: </label> <input type='password' name='password' id='password' value='$password' />\n</p> <p><input type='submit' value='Log In'>\n</p> <input type='hidden' name='sent' value='yes' /> </form>\n"; ?> Here are the errors i get: Warning: include(dbstuff.inc) [function.include]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/test_php/login_url.php on line 31 Warning: include() [function.include]: Failed opening 'dbstuff.inc' for inclusion (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') in /Applications/XAMPP/xamppfiles/htdocs/test_php/login_url.php on line 31 Couldn't execute query. Any help would be appreciated thankyou Enlighten 17227_.php 17228_.php
×
×
  • 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.