Jump to content

farban

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

Everything posted by farban

  1. Hello Got a problem where I want to get prepared statements to work through adding parameters, something like this <?php class Prepared_Statement extends Handle_DB { private $query; private $bind_result; private $stmt; public function set_PS_query($query) { $this->query = $query; } public function setup_PS($bindresult) { $this->stmt = parent::connect_DB()->stmt_init(); $this->stmt->prepare($this->query); $this->stmt->execute(); $this->stmt->bind_result($bindresult); } public function show_PS_results($result) { while($this->stmt->fetch()) { return $result; } } public function close_PS() { $this->stmt->close(); } } $preS = new Prepared_Statement(); $preS->set_PS_query("SELECT user_name FROM usertest"); $preS->setup_PS("user_name"); echo $preS->show_PS_results("user_name"); $preS->close_PS(); ?> The problem is that it throws up Undefined variable: user_name errors when i run the script. I know why this is the case, how can I pass a variable into the prepared statement without it saying its undefined??
  2. can i just say i know its off topic butwould it cost money for a client to upgrade php4 to php5
  3. Well for the echo it dosent print out the varibles so it should echo $artist - $title - $url instead its echoing - - so its not outputting the varibles
  4. i cant change hosts or upgrade the server as its for a client and uni project so i cant really tell the client to upgrade im afraid here is the code <?php $doc = domxml_open_mem(); $doc = domxml_open_file("Playlist.xml"); $musiclist = $doc->get_elements_by_tagname( "mp3" ); foreach( $musiclist as $song ) { $artists = $song->get_elements_by_tagname( "artist" ); $artist=htmlentities(utf8_decode($artist->nodeValue)); $titles= $song->get_elements_by_tagname( "title" ); $title= $titles->nodeValue; $urls = $song->get_elements_by_tagname( "url" ); $url = $urls->nodeValue; echo "<b>$artist - $title - $url\n</b><br>"; } ?> just really need some solution to this ...only need to make the title artist and url appear
  5. sorry i just wasnt sure if this was different enough to warrent a new thread
  6. just wondering what is it i need to do to convert this line of code to php 4 $title= $titles->item(0)->nodeValue;
  7. can anyone help me please?
  8. Hey i have a T_OBJECT_OPERATOR syntax error when opening mp3.php page. I know its because its php 4 and dosent understand the code but i want to fix this problem without upgrading to php 5. any help please? mp3.php page <?php $doc = new DOMDocument(); $doc->load( 'Playlist.xml' ); $musiclist = $doc->getElementsByTagName( "mp3" ); foreach( $musiclist as $song ) { $artists = $song->getElementsByTagName( "artist" ); $artist = $artists->item(0)->nodeValue; $titles= $song->getElementsByTagName( "title" ); $title= $titles->item(0)->nodeValue; $urls = $song->getElementsByTagName( "url" ); $url = $urls->item(0)->nodeValue; echo "<b>$artist - $title - $url\n</b><br>"; } ?>
  9. I have two php files that simply need modifing so that they communicate with this xml file <?xml version="1.0" encoding="UTF-8" ?> <songs> <song filename="The Birthday Massacre - Nothing And Nowhere - 06 - Video Kid.mp3" track="Video Kid" artist="The Birthday Massacre" album="Nothing And Nowhere" /> <song filename="The Birthday Massacre - Nothing And Nowhere - 07 - Over.mp3" track="Over" artist="The Birthday Massacre" album="Nothing And Nowhere" /> <song filename="The Birthday Massacre - Nothing And Nowhere - 08 - Broken.mp3" track="Broken" artist="The Birthday Massacre" album="Nothing And Nowhere" /> <song filename="The Birthday Massacre - Nothing And Nowhere - 09 - The Dream.mp3" track="The Dream" artist="The Birthday Massacre" album="Nothing And Nowhere" /> <song filename="The Birthday Massacre - Nothing And Nowhere - 01 - Happy Birthday.mp3" track="Happy Birthday" artist="The Birthday Massacre" album="Nothing And Nowhere" /> </songs> here is the two php files upload.php <h1>Jukebox Playlist</h1> <p>Enter the Artist and Title names as you want them to appear on the jukebox. It'll take a few minutes to upload a song after you click submit, so leave it and don't close the page until you see it added to the Current Entries list.</p> <form action="playlistaction.php" method="post" enctype="multipart/form-data"> <table> <tr> <td colspan="2"class="labelcell"><label for="artist">Artist:</label></td> <td colspan="2"class="fieldcell"><input type="text" id="artist" name="artist" tabindex="1"/></td> </tr> <tr> <td colspan="2"class="labelcell"><label for="title">Title:</label></td> <td colspan="2"class="fieldcell"> <input type="text" id="title" name="title" tabindex="2"/><br /> </td> </tr> <!-- <tr> <td colspan="2"class="labelcell"><label for="path">URL:</label></td> <td colspan="2"class="fieldcell"> <input type="text" id="url" name="url" tabindex="3"/> <br /> </td> </tr>--> <tr> <td colspan="2"class="labelcell"><label for="userfile">Song Upload</label></td> <td colspan="2"><input name="userfile" type="file" id="userfile" tabindex="4"></td></tr> </td> </tr> <td colspan="4"><input type="submit" name="upload" class="box" value="Submit" tabindex="5" /></td> </table> </fieldset> </form> <h2>Current entries:</h2> <p>Artist - Title - URL</p> <?php $xml = simplexml_load_file("..songs/playlist.xml"); foreach($xml->songs[0]->attributes() as $a => $b) { echo $a,'="',$b,"\"</br>"; } ?> ?> playlistaction.php <?php $uploadDir = 'Bulrush\songs'; if(isset($_POST['upload'])) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $filePath = $uploadDir . $fileName; $result = move_uploaded_file($tmpName, $filePath); if (!$result) { echo "Error uploading file"; exit; } } $song = array( 'track' => $_POST['track'], 'artist' => $_POST['artist'], 'album' => $_POST['album'], 'song filename' => $filePath, ); $doc = new DOMDocument(); $doc->load( 'playlist.xml' ); $doc->formatOutput = true; $r = $doc->getElementsByTagName("songs")->item(0); $title = $doc->createElement("track"); $title->appendChild( $doc->createTextNode( $song["track"] ) ); $b->appendChild( $title ); $artist = $doc->createElement("artist"); $artist->appendChild( $doc->createTextNode( $song["artist"] ) ); $b->appendChild( $artist ); $artist = $doc->createElement("album"); $artist->appendChild( $doc->createTextNode( $song["album"] ) ); $b->appendChild( $artist ); $url = $doc->createElement("song filename"); $url->appendChild( $doc->createTextNode( $song["song filename"] ) ); $b->appendChild( $url ); $r->appendChild( $b ); $doc->save("player.xml"); header("Location: {$_SERVER['HTTP_REFERER']}"); ?> i have tried to change it and modify it so it works with the xml but i just dont know what to change. its important that its changed to the xml file
  10. aha it says that Notice: Undefined index: user_id in C:\xampp\htdocs\testsite\community\viewprofile.php on line 44 Notice: Undefined index: user_id in C:\xampp\htdocs\testsite\community\viewprofile.php on line 75 for viewprofile.php any help please?
  11. doing something like this in viewprofile.php works fine cause its static $q = " SELECT user.user_first_name, user.user_surname, user.user_photo, user.user_age, user.user_sex, user.user_city, user.user_home_phone, user.user_mobile_phone, user.user_profession, user.user_specialist_area, user.user_email, user.user_password, user.user_username FROM user WHERE user.user_id=3"; but i need it to be dynamic to represent the user that has been selected $q = " SELECT user.user_first_name, user.user_surname, user.user_photo, user.user_age, user.user_sex, user.user_city, user.user_home_phone, user.user_mobile_phone, user.user_profession, user.user_specialist_area, user.user_email, user.user_password, user.user_username FROM user WHERE user.user_id='".$_GET['user_id']."'"; this code dosent work. really need some help soo close to fixing this
  12. I have done the changes and it seems to be navigating to the correct id numbers which is great but nothting appears on the viewprofile.php page. arghh so close !! viewprofile.php <?php session_start(); if (!isset($_SESSION['user_id'])) { $url = absolute_url(); header("Location: $url"); exit(); } include("includes/start.php"); require_once("includes/_connect.inc.php"); if (isset($_GET['user_id'])) { $q = " SELECT user.user_first_name, user.user_surname, user.user_photo, user.user_age, user.user_sex, user.user_city, user.user_home_phone, user.user_mobile_phone, user.user_profession, user.user_specialist_area, user.user_email, user.user_password, user.user_username FROM user WHERE user.user_id= '".$_GET['user_id']."'"; $result = @mysqli_query($dbc, $q); if ($result) { while ($row =mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<table class='pictable'> <tr> <td><img src='images/".$row[user_photo]."' width='100%' height='100%'></img></td> </tr></table> <table class='profiletable'> <tr><td>First Name</td> <td>".$row[user_first_name]."</td> </tr> <tr><td>Surname</td> <td>".$row[user_surname]."</td></tr> <tr><td>Age</td> <td>".$row[user_age]."</td></tr> <tr><td>Email</td> <td>".$row[user_email]."</td></tr> <tr><td>Sex</td> <td>".$row[user_sex]."</td></tr> <tr><td>City</td><td>".$row[user_city]."</td></tr> <tr><td>Home Phone</td> <td>".$row[user_home_phone]."</td></tr> <tr><td>Mobile Phone</td> <td>".$row[user_mobile_phone]."</td></tr> <tr><td>Profession</td> <td>".$row[user_profession]."</td></tr> <tr><td>Specialist area</td> <td>".$row[user_specialist_area]."</td></tr> </table>"; } if (isset($_SESSION ['user_id']) && ($_SESSION ['user_id'] == $_GET['user_id'])) { echo "<div class='usereditprofile'><a href='editprofile.php'>Edit Profile</a></div>"; } mysqli_free_result($result); } } include("includes/footer.php"); ?>
  13. ill post up the code for the userlist.php <?php session_start(); if (!isset($_SESSION['user_id'])) { $url = absolute_url(); header("Location: $url"); exit(); } include("includes/start.php"); require_once("includes/_connect.inc.php"); echo "<h1>The user list</h1><p>Listing the members of the site</p>"; $id = $_GET['user_id']; $display= 2; if (isset($_GET['p']) && is_numeric($_GET['p'])) { $pages = $_GET['p']; } else { $q = " SELECT COUNT(user_id) FROM user"; $result = @mysqli_query($dbc, $q); $row = mysqli_fetch_array($result, MYSQLI_NUM); $records = $row [0]; if ($records > $display) { $pages = ceil ($records/$display); } else { $pages= 2; } } if (isset($_GET['s']) && is_numeric ($_GET['s'])) { $start =$_GET['s']; } else { $start =0; } $q = " SELECT user.user_first_name, user.user_surname, user.user_photo, user.user_age, user.user_sex, user.user_city, user.user_home_phone, user.user_mobile_phone, user.user_profession, user.user_specialist_area, user.user_email, user.user_password, user.user_username FROM user ORDER BY user.user_id ASC LIMIT $start, $display"; $result = @mysqli_query($dbc, $q)or die("Error: ".mysqli_error($dbc)); while ($row =mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<div class='userlist'><table class='pictable'> <tr> <td><img src='images/".$row[user_photo]."' width='100%' height='100%'></img></td> </tr></table> <table class='profiletable'> <tr><td>First Name</td> <td>".$row[user_first_name]."</td> </tr> <tr><td>Surname</td> <td>".$row[user_surname]."</td></tr> <tr><td>Age</td> <td>".$row[user_age]."</td></tr> <tr><td>Email</td> <td>".$row[user_email]."</td></tr> <tr><td>Sex</td> <td>".$row[user_sex]."</td></tr> <tr><td>City</td><td>".$row[user_city]."</td></tr> <tr><td>Home Phone</td> <td>".$row[user_home_phone]."</td></tr> <tr><td>Mobile Phone</td> <td>".$row[user_mobile_phone]."</td></tr> <tr><td>Profession</td> <td>".$row[user_profession]."</td></tr> <tr><td>Specialist area</td> <td>".$row[user_specialist_area]."</td></tr> <tr><td><a href='viewprofile.php?='".$id."'>View Profile</a></tr></td> </table></div>"; } mysqli_free_result($result); mysqli_close($dbc); if ($pages > 1) { echo'<div class="userlinklist"><p>'; $current_page =($start/$display) +1; if ($current_page !=1) { echo '<a href="userlist.php?s='.($start - $display).'&p='.$pages.'">Previous</a>'; } for ($i =1; $i <= $pages; $i++) { if ($i !=$current_page) { echo ',<a href="userlist.php?s='.(($display * ($i -1))).'&p='.$pages.'">'.$i.'</a>,'; } else { echo $i.''; } } if ($current_page !=$pages) { echo '<a href="userlist.php?s='.($start + $display).'&p'.$pages.'">Next</a>'; } echo '</p></div>'; } include("includes/footer.php"); ?>
  14. Got a userlists.php script that paginates all the users of a site. When clicking on view profile on a user it will direct to a veiwprofile.php which will display all the info of that user. I cant explain very well in detail but i want it so that the url represents the user id so that the veiwprofile.php page is dynamic and it will show the user that was selected from the userlist.php page. i have this so far but when i click on view profile all i get is a blank page userlist.php <tr><td><a href='viewprofile.php?='".$id."'>View Profile</a></tr></td> viewprofile.php <?php session_start(); if (!isset($_SESSION['user_id'])) { $url = absolute_url(); header("Location: $url"); exit(); } include("includes/start.php"); require_once("includes/_connect.inc.php"); if (isset($_GET['user_id'])) { $q = " SELECT user.user_first_name, user.user_surname, user.user_photo, user.user_age, user.user_sex, user.user_city, user.user_home_phone, user.user_mobile_phone, user.user_profession, user.user_specialist_area, user.user_email, user.user_password, user.user_username FROM user WHERE user.user_id= '".$_GET['user_id']."'"; $result = @mysqli_query($dbc, $q); if ($result) { while ($row =mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<table class='pictable'> <tr> <td><img src='images/".$row[user_photo]."' width='100%' height='100%'></img></td> </tr></table> <table class='profiletable'> <tr><td>First Name</td> <td>".$row[user_first_name]."</td> </tr> <tr><td>Surname</td> <td>".$row[user_surname]."</td></tr> <tr><td>Age</td> <td>".$row[user_age]."</td></tr> <tr><td>Email</td> <td>".$row[user_email]."</td></tr> <tr><td>Sex</td> <td>".$row[user_sex]."</td></tr> <tr><td>City</td><td>".$row[user_city]."</td></tr> <tr><td>Home Phone</td> <td>".$row[user_home_phone]."</td></tr> <tr><td>Mobile Phone</td> <td>".$row[user_mobile_phone]."</td></tr> <tr><td>Profession</td> <td>".$row[user_profession]."</td></tr> <tr><td>Specialist area</td> <td>".$row[user_specialist_area]."</td></tr> </table>"; } if (isset($_SESSION ['user_id'])) { echo "<div class='usereditprofile'><a href='editprofile.php'>Edit Profile</a></div>"; } mysqli_free_result($result); } } include("includes/footer.php"); ?>
  15. Hey there I am making a edit profile page and this is what i have so far. I am making it so that the profile info appears with the editatble values in the form feilds which the user can then edit and change and then click on submit. here is the code i have on editprofile.php <?php session_start(); if (!isset($_SESSION['user_id'])) { $url = absolute_url(); header("Location: $url"); exit(); } include("includes/start.php"); require_once("includes/_connect.inc.php"); echo "<h1>Update Profile</h1><p>Update the profile</p>"; if (!isset($_POST['submitted'])) { $q = " SELECT user.user_first_name, user.user_surname, user.user_age, user.user_sex, user.user_city, user.user_home_phone, user.user_mobile_phone, user.user_profession, user.user_specialist_area, user.user_email, user.user_username FROM user WHERE user.user_id= '".$_SESSION['user_id']."'"; echo '<form action="editprofile.php" method="post"> <p>First name<input type="text" name="user_first_name" size="15" maxlength="15" value="'.$user_first_name.'"/> </form>'; } ?> how can i print out the firstname value into the firstname input feild of the form?
  16. I dont understand why i run this page and it comes up with Parse error: parse error in C:\xampp\htdocs\testsite\community\editprofile.php on line 217 I have checked line 217 but cant see no errors if (mysqli_num_rows($result) == 1) { editprofile.php <?php session_start(); if (!isset($_SESSION['user_id'])) { $url = absolute_url(); header("Location: $url"); exit(); } include("includes/start.php"); echo "<h1>Update Profilet</h1><p>Update the profile</p>"; if ((isset($_GET['user_id'])) && (is_numeric($_GET['user_id']))) { $user_id = $_GET['user_id']; } else if ((isset($_POST['user_id'])) && (is_numeric($_POST['user_id']))) { $user_id =$_POST['user_id']; } else { echo '<p>This page has been accessed in error</p>'; include("includes/footer.php"); exit(); } require_once ("includes/_connect.inc.php"); if (isset($_POST['submitted'])) { $errors = array(); if (empty($_POST['user_first_name'])) { $errors[] ='You forgot to enter your first name'; } else { $user_first_name = mysqli_real_escape_string($dbc, trim($_POST['user_first_name'])); } if (empty($_POST['user_surname'])) { $errors[] ='You forgot to enter surname'; } else { $user_surname = mysqli_real_escape_string($dbc, trim($_POST['user_surname'])); } if (empty($_POST['user_age'])) { $errors[] ='You forgot to enter your age'; } else { $user_age = mysqli_real_escape_string($dbc, trim($_POST['user_age'])); } if (empty($_POST['user_email'])) { $errors[] ='You forgot to enter your email address'; } else { $user_email = mysqli_real_escape_string($dbc, trim($_POST['user_email'])); } if (empty($_POST['user_sex'])) { $errors[] ='You forgot to enter your gender'; } else { $user_sex = mysqli_real_escape_string($dbc, trim($_POST['user_sex'])); } if (empty($_POST['user_city'])) { $errors[] ='You forgot to enter your city'; } else { $user_city = mysqli_real_escape_string($dbc, trim($_POST['user_city'])); } if (empty($_POST['user_home_phone'])) { $errors[] ='You forgot to enter your home'; } else { $user_home_phone = mysqli_real_escape_string($dbc, trim($_POST['user_home_phone'])); } if (empty($_POST['user_mobile_phone'])) { $errors[] ='You forgot to enter your mobile phone'; } else { $user_mobile_phone = mysqli_real_escape_string($dbc, trim($_POST['user_mobile_phone'])); } if (empty($_POST['user_profession'])) { $errors[] ='You forgot to enter your profession'; } else { $user_profession = mysqli_real_escape_string($dbc, trim($_POST['user_profession'])); } if (empty($_POST['user_specialist_area'])) { $errors[] ='You forgot to enter your specialist area'; } else { $user_specialist_area = mysqli_real_escape_string($dbc, trim($_POST['user_specialist_area'])); } if (empty ($errors)) { $query = "SELECT user_id FROM user WHERE user_email='$user_email' AND user_id ! =$user_id"; $result =@mysqli_query($dbc, $query); if (mysqli_num_rows($result) ==0) { $query = "UPDATE user SET user_first_name ='$user_first_name', user_surname='$user_surname', user_age='$user_age', user_email='$user_email', user_sex='$user_sex', user_city ='$user_city', user_home_phone='$user_home_phone', user_mobile_phone='$user_mobile_phone, user_proffesion='$user_profession', user_specialist_area='$user_specialist_area' WHERE user_id=$user_id LIMIT 1"; $result =@mysqli_query($dbc, $query); if (mysqli_affected_rows($dbc) ==1) { echo '<p>The user has been edited</p>'; } else { echo '<p>The user cannot be edited due to a system error</p>'; echo '<p>'.mysqli_error($dbc).'<br/>Query:'.$query.'</p>'; } } else { echo '<p>The email address has already been registered</p>'; } } else { echo '<p>The following errors occured:<br/>'; foreach ($errors as $msg) { echo "- $msg<br/>\n"; } echo '</p><p>Please try agian</p>'; } } $query = " SELECT user.user_first_name, user.user_surname, user.user_age, user.user_sex, user.user_city, user.user_home_phone, user.user_mobile_phone, user.user_profession, user.user_specialist_area, user.user_email FROM user WHERE user.user_id=$user_id"; $result =@mysqli_query($dbc, $query) if (mysqli_num_rows($result) == 1) { $row =mysqli_fetch_array($result, MYSQLI_NUM); echo '<form action="editpage.php" method="post"> <p>Firstname: <input type="text" name="user_first_name" size="20" maxlengh="80" value="'.$row[0].'"/> </p> <p>Surname: <input type="text" name="user_surname" size="20" maxlengh="80" value="'.$row[1].'"/> </p> <p>Age: <input type="text" name="user_age" size="20" maxlengh="80" value="'.$row[2].'"/> </p> <p>Email: <input type="text" name="user_email" size="20" maxlengh="80" value="'.$row[3].'" /> </p> <p>Sex: <input type="text" name="user_sex" size="20" maxlengh="80" value="'.$row[4].'"/> </p> <p>City: <input type="password" name="user_city" size="20" maxlengh="80" value="'.$row[5].'"/> </p> <p>Home Phone: <input type="text" name="user_home_phone" size="20" maxlengh="80" value="'.$row[6].'"/> </p> <p>Mobile Phone: <input type="text" name="user_mobile_phone" size="20" maxlengh="80" value="'.$row[7].'"/> </p> <p>Profession: <input type="text" name="user_profession" size="20" maxlengh="80" value="'.$row[8].'"/> </p> <p>Specialist Area: <input type="text" name="user_specialist_area" size="20" maxlengh="80" value="'.$row[9].'"/> </p> <p><input type="submit" name="submit" value="Update"/> </p> <input type="hidden" name="submitted" value="TRUE"/> <input type="hidden" name="user_id" value="'.$user_id.'"/> </form>'; } else { echo '<p>This page has been accessed in error</p>'; } mysqli_close($dbc); include("includes/footer.php"); ?>
  17. got errors Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\testsite\community\userlist.php on line 85 Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\testsite\community\userlist.php on line 109 the url looks abit strange too when going from previous and next
  18. Ahh yes no more parse errors but now its throwing up some strange issues. I am paginating results so there are two profiles per page. The results are not appearing and the navigation at the bottom is just very strange. Its hard to explain whats happening so i sent the site as a attachment and included some screenshots of the problem im having. [attachment deleted by admin]
  19. here is my userlist.php when i run the page i get the parse error Parse error: parse error in C:\xampp\htdocs\testsite\community\userlist.php on line 152 line 152 of userlist.php is this include("includes/footer.php"); ?> when i remove the include footer it still has the same error here is the userlist.php code <?php session_start(); if (!isset($_SESSION['user_id'])) { $url = absolute_url(); header("Location: $url"); exit(); } include("includes/start.php"); require_once("includes/_connect.inc.php"); $display= 2; if (isset($_GET['p']) && is_numeric($_GET['p'])) { $pages = $_GET['p']; } else { $q = " SELECT COUNT(user_id) FROM user"; $result = @mysqli_query($dbc, $q); $row = mysqli_fetch_array($result, MYSQLI_NUM); $records = $row [0]; if ($records > $display) { $pages = ceil ($records/$display); } else { $pages= 1; } } if (isset($_GET['s']) && is_numeric ($_GET['s'])) { $start =$_GET['s']; } else { $start =0; } $q = " SELECT user.user_first_name, user.user_surname, user.user_photo, user.user_age, user.user_sex, user.user_city, user.user_home_phone, user.user_mobile_phone, user.user_profession, user.user_specialist_area, user.user_email, user.user_password, user.user_username FROM user ASC LIMIT $start, $display"; $r = @mysqli_query($dbc, $q); while ($row =mysqli_fetch_array($result, MYSQLI_ASSOC)) { while ($row =mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<div class='userlist'><table class='pictable'> <tr> <td><img src='images/".$row[user_photo]."' width='100%' height='100%'></img></td> </tr></table> <table class='profiletable'> <tr><td>First Name</td> <td>".$row[user_first_name]."</td> </tr> <tr><td>Surname</td> <td>".$row[user_surname]."</td></tr> <tr><td>Age</td> <td>".$row[user_age]."</td></tr> <tr><td>Email</td> <td>".$row[user_email]."</td></tr> <tr><td>Sex</td> <td>".$row[user_sex]."</td></tr> <tr><td>City</td><td>".$row[user_city]."</td></tr> <tr><td>Home Phone</td> <td>".$row[user_home_phone]."</td></tr> <tr><td>Mobile Phone</td> <td>".$row[user_mobile_phone]."</td></tr> <tr><td>Profession</td> <td>".$row[user_profession]."</td></tr> <tr><td>Specialist area</td> <td>".$row[user_specialist_area]."</td></tr> </table></div>"; } mysqli_free_result($result); mysqli_close($dbc); if ($pages>1) { echo'<br/><p>'; $current_page =($start/$display) +1; if ($current_page !=1) { echo '<a href="userlist.php?s='.($start - $display).'&p='.$page.'">Previous</a>'; } for ($i =1; $i <= $pages; $i++) { if ($i !=$current_page) { echo '< a href="userlist.php?s='.(($display * ($i -1))).'&p='.$pages.'">'.$i.'</a>'; } else { echo $i.''; } } if ($current_page !=$pages) { echo '<a href="userlist.php?s='.($start + $display).'&p'.$pages.'">Next</a>'; } echo '</p>'; } include("includes/footer.php"); ?> can anyone help much thanks
  20. mchl i could kiss you lol much thanks to all who helped ill mark it as solved
  21. whole project with sql file in folder [attachment deleted by admin]
  22. I read the sticky and sorry im just not very good at understanding php and the header problems. Same number of header problems still Here is what the login.php looks like now login.php <?php if(isset($_POST['submitted'])) { require_once ('includes/loginfunctions.php'); require_once ("includes/_connect.inc.php"); list ($check, $data) = check_login ($dbc, $_POST['user_username'], $_POST['user_password']); if ($check) { session_start(); $_SESSION['user_id'] = $data ['user_id']; $_SESSION['user_first_name'] = $data ['user_first_name']; $url = absolute_url ('loggedin.php'); header("Location: $url"); exit(); } else { $errors = $data; } mysqli_close($dbc); } require_once ("includes/loginpage.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.