Jump to content

black_pearl

Members
  • Posts

    17
  • Joined

  • Last visited

black_pearl's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hey iarp i tried the code and it gives me this error Warning: Cannot modify header information - headers already sent by (output started at /customers/8/c/6/bemotors.be/httpd.www/views/header.php:7) in /customers/8/c/6/bemotors.be/httpd.www/controllers/LoginController.php on line 39
  2. hey guys, i have just uploaded my website online and the headers seems to be broken whenever i login it has to normally redirect me to the home page but it just jam there and nothing happens and i have to refresh the page or go to the home page on my own and on my localhost they work fine no problem at all and i am using the same code nothing has changed someone told me it might be coz of the php version on my localhost i have 5.5.12 and online its 5.5.27 code : <?php class LoginController { public function __construct() { } public function run() { // if user already connected redirect to user home page if (!empty ( $_SESSION ['authentification'] )){ header ( 'Location: index.php?action=home' ); die (); } // initial notification $notification = ''; if (! empty ( $_POST )) { if (empty ( $_POST ['username'] ) && empty ( $_POST ['password'] )) { $notification = 'Entrez un login et mot de passe non vides.'; } elseif (empty ( $_POST ['username'] )) { $notification = 'Entrez un login non vide.'; } elseif (empty ( $_POST ['password'] )) { $notification = 'Entrez un mot de passe non vide.'; } elseif (preg_match ( '/^[a-z]{4,5}$/', $_POST ['username'] )) { $login = htmlentities ( $_POST ['username'] ); $password = htmlentities ( $_POST ['password'] ); if (Db::getInstance ()->login_exists ( $login )) { // authentication if (Db::getInstance ()->authentication ( $login, $password )) { // create session username and copy login $_SESSION ['login'] = $login; $_SESSION ['authentification'] = 'admin'; // Redirection HTTP to home page header ( 'Location: index.php?action=home' ); die (); } } // in case login doesn't exist in db or incorrect paswsord $notification = 'Nom d\'utilisateur et/ou mot de passe incorrecte(s).'; } else { // in case login doesn't match preg_match $notification = 'Nom d\'utilisateur et/ou mot de passe incorrecte(s).'; } } // view : login.php require_once (VIEWS_PATH . 'login.php'); } } ?>
  3. thank you very much the big gap is gone : http://prntscr.com/7w5268 and is there a way to even delete the little gap left ? or its just like that?
  4. and btw how do u get the box to put code in it ?
  5. oke thank you very i am going to try it out now and let you know
  6. html code : http://prntscr.com/7w4wzp css code : http://prntscr.com/7w4x6e its not on the net yet and i dont know a way to show to you if u know a way please let me know
  7. hello everyone i just have started creating a new website and i have a problem i have a gap between the banner and the nav and i have been looking all over the net and couldn't find a solution here is a ss : http://prntscr.com/7w4t80 and the css : @CHARSET "ISO-8859-1"; html { width: 1216px; margin: auto; font-family: Menlo, Consolas, Monaco, "Lucida Console", monospace; background-color: #fff7d8; } header{ text-align: center; } body { font-family: "SourceSansPro Regular",sans-serif; font-weight: 400; font-style: normal; font-size: 1em; } #menu { text-align: center; background-color: #5f92cd; padding: 2px 4px 2px 4px; color: #180457; } nav ul, ul { list-style-type: none; } nav li, li { display: inline-block; list-style-type: none; } nav a { text-decoration: none; font-size: 1.2em; padding: 0px 10px 0px 10px; font-size: 1.2em; } nav a:hover { background-color: white; } header a { text-decoration: none; }
  8. wow that way would of save me a lot of time all the returns i wrote could be done with one function thanks to you guys now i know this way
  9. thank you very much scootstah and cyberRobot for the help it works now i tried the code u gave scootstah and it works but u said its a wacky way, how can i improve it how else can i do it ? i have learned that way thats why went for it
  10. they r just returns : http://prntscr.com/7vbf1c
  11. idk thats the way i learned it but it works fine when i do it like this : echo $car[0]->photo1() or echo $car[0]->photo2() or echo $car[0]->photo3() ... but idk how many pics the user will add (max is 8 photos per car) and i want to use the " for " the problem is idk how to get it right echo $car[0]->photo . $i . "()" this doesn't work it only does echo $car[0]->photo thus gives me error i want to be able to send this echo $car[0]->photo1() with the $i
  12. if u dont mind we can do a teamviewer session ? would be easier ah shi i dont have a mic
  13. just tried it gives me empty items, i just copied the code u posted did i have to change something else anywhere ?
  14. yes this is it and i am trying to do $car[0]->photo1(), $car[0]->photo2() , $car[0]->photo3() ,$car[0]->photo4() ..
×
×
  • 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.