php - Displaying same page with diffrent content based on database -


I needed some help in php.

I am creating a website in php for a website which is information displayed for each teacher, so the same page will appear in different information, depending on the login email!

Right now, I have created my database and login script, but it is without session or cookies, do I need both of those which are a thank you in advance for displaying a different information with mysql query ! ---------- login.php ----------

 ? Php require_once ('init.php'); Include_once ("scripts / connect.php"); $ Login_error = ""; $ Email = ""; $ Password = ""; If (isset ($ _GET ['login'])) {$ email = strip_tags (mysql_real_escape_string ($ _ POST ['email'])); $ Password = strip_tags (mysql_real_escape_string ($ _ POST ['password'])); $ Sql ​​= mysql_query ("Select mail_secinegent, Nom_Enignet, MODE_SE_PAPE with ESINGENT where mail_signit = '" .mailer "and thick_de_pace ='" password. "'1 limited'); Echo mysql_error (); if (mysql_num_rows ($ Sql) == 1) {$ row = mysql_fetch_assoc ($ sql); $ _SESSION ['mail_sign'] = $ line ['mail_isign']; $ _SESSION ['Nom_Enseignant'] = $ line ['Nom_Enseignant']; $ _SESSION ['Mot_de_passe'] = $ line ['Mot_de_passe']; header ("location: note-on.fp? Email = $ email"); exit ();} and {$ login_error = "invalid notification .. . ";}}? & Gt; & lt; h3 & gt; Enigener Login Below & lt; / h3 & Gt; & lt; form action = "? Login "method =" post ">  gt; legend & gt; unseen login & lt; / legend & gt; & lt; p & gt; mail_ins: & lt; input type = "Text" name = "email" value = "& lt ;? Php echo $ email ;? & Gt; "/ / & gt;  & lt; p & gt; Password: & lt; input type =" password "name =" password "value =" & lt ;? Php $ password ;; & Gt; / & Gt; & Lt; / P & gt; & Lt; P & gt; & Lt ;? Php if (isset ($ login_error) & amp; ($ login_error! = "")) {Echo "& lt; p style = 'margin-right: 10px; color: # ff0000' & gt; $ Login_error "& Lt; / p & gt;"; ?} & Gt; & Lt; Input type = "submit" value = "login NCInet" name = "submit_ login" /> gt; & Lt; / P & gt; & Lt ;! - & lt; Input type = "image" src = "image / sign_in.gif" id = "signin" alt = "sign in" /> - & gt; & Lt; / Fieldset & gt; & Lt; / Form & gt;  

And this is the page that I want to disappoint based on the notification email with a different information

-------- Note- On .php ----------

  & lt; Div id = "left_column" & gt; & Lt; Div class = "holder" & gt; & Lt; H2 class = "title" & gt; Specialty & amp; Group & lt; / H2 & gt; & Lt; Ul class = "nostart" & gt; & Lt; Select name = "select" class = "text field" id = "special" & gt; & Lt; Option id = "0" & ​​gt; - Choose Attribution - & lt; / Options & gt; & Lt ;? Php echo $ _SESSION ['mail_enseignant']; ? & Gt; & Lt ;? Php if (isset ($ _GET ['email'])) {$ getall Specification = mysql_query ("Specially select Nom_Specialite where enseignant.mail_enseignant = '" $ email. "' And enseignant.Id_Enseignant = effect.Id_Enseignant And Affect.Id_Groupe = Group.Id_Graphy and Specialty.IIDSCICILI = Group.IIDCCIS ""); While ($ viewallSpeciality = mysql_fetch_array ($ getallSpeciality)) {? & Gt; Option ID = "& lt ;? Php echo $ viewallSpeciality ['Id_Specialite'] ;; & Gt; "gt; & lt; php echo $ viewall Specification ['Nom_specialite']? & Gt; & lt; / option & gt; & lt ;? php}}? & Gt; & lt; / selection &  
> Sessions and Cookies are the easiest way.
But if you do not want to use any of these, you can get method
  http: /mtsite.com?teacherid=somevalue  

get this value

  $ Id = $ _ GET ['teacher'];  

And then come to get your desired output


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -