Jump to content

Mace

Members
  • Posts

    36
  • Joined

  • Last visited

  • Days Won

    3

Mace last won the day on January 28 2014

Mace had the most liked content!

About Mace

  • Birthday 11/29/1986

Profile Information

  • Gender
    Male
  • Location
    Netherlands

Mace's Achievements

Newbie

Newbie (1/5)

9

Reputation

  1. The page you want to fetch is a page that fetches data with ajax. The simplehtmldom class isn't compatible with that. The requested url = http://www.ebay.com/cln#{"category":{"id":1,"text":"Collectibles"}} However, only javascript can read the part after the #. So that's why your request returns only http://www.ebay.com/cln#. So the only thing I tell you is that this won't work what you're trying to achieve. Maybe there is an RSS feed? of maybe there is way to browse without a # in your browser?
  2. I wrote you an example to give you an idea how to work with a php class. class MyClass { protected $arg; // this function will be called if you create the class public function __construct($creationArg) { // using "$this" will refer to the class itself // the protected $arg defined at the start is avaible with $this $this->arg = $creationArg; } public function MyFunctionInClass() { // the $this is still avaible here. return $this->arg; } } $myClass = new MyClass('Hello world'); echo $myClass->MyFunctionInClass(); exit;
  3. remove the column "id" in your inner select. This conflicts the columns you want to est.
  4. However, you could still redirect with javascript: if($failed == false) { ?> <script> window.location="premier_view.php"; </script> <?php exit; }
  5. This is because you already outputted html at the top of your file. First build all your php code, and then output your html. Not the other way around. After outputting html/echo/any other output, you cant do header(Location) anymore.
  6. Try this. Just check if the query failed. If not, then redirect. Also, dont put your $_POST values unprotected in your INSERT query. Use something like mysql_real_escape_string() on all your $_POST values <?php include_once '../includes/db_connect.php'; include_once '../includes/functions.php'; sec_session_start(); if (login_check($mysqli) == true) { $logged = 'in'; } $error_msg = ""; $username = $_SESSION['username']; $email = $_SESSION['email']; $id = $_SESSION['user_id']; // create string of queries separated by ; //var_dump(login_check($mysqli)); //var_dump($_SESSION); exit; //var_dump($_POST);exit; $query = "UPDATE members SET level = '$_POST[level]' WHERE id = $id;"; $query .= "INSERT INTO members_info ( id , fname , known_as , lname , gender , race , start_date , department , msisdn , dob , details , emergency_contact , emergency_msisdn ) VALUES ( '".mysql_real_escape_string($_POST['user_id'])."' , '".mysql_real_escape_string($_POST['fname'])."' , '".mysql_real_escape_string($_POST['known_as'])."' , '$_POST[lname]' , '$_POST[gender]' , '$_POST[race]' , '$_POST[start_date]' , '$_POST[department]' , '$_POST[msisdn]' , '$_POST[dob]' , '$_POST[details]' , '$_POST[emergency_contact]' , '$_POST[emergency_msisdn]' );"; // execute query - $result is false if the first query failed $result = mysqli_multi_query($mysqli, $query); $failed = false; if ($result) { do { // grab the result of the next query if (($result = mysqli_store_result($mysqli)) === false && mysqli_error($mysqli) != '') { echo "Query failed: " . mysqli_error($mysqli); $failed = true; } } while (mysqli_more_results($mysqli) && mysqli_next_result($mysqli)); // while there are more results } else { echo "First query failed..." . mysqli_error($mysqli); $failed = true; } $mysqli->close(); if($failed == false) { header('Location: ../success.php'); exit; }
  7. Try setting a cronjob. That's a scheduled action on your server. http://en.wikipedia.org/wiki/Cron
  8. My guess is that the number is echo'd in one of the include_once files.
  9. just add all the files you want to grant acces to in the array $allowed. place this code in the function. if($_SESSION['level'] == 0) { header('Location:info.php'); exit; } and i would do the session start before the checkLoginLevel. checkLoginLevel(); sec_session_start();
  10. I'm not sure if you mean something like this, but i'll give it a try function checkLoginLevel() { $allowed = array( '1' => array('first-page.php'), '2' => array('first-page.php', 'second-page.php'), '3' => true, ); if(!isset($allowed[$_SESSION['level']])) { echo 'You have no login level'; exit; } if(is_array($allowed[$_SESSION['level']])) { $file = $_SERVER["PHP_SELF"]; $file = explode('/', $file); $file = end($file); if(!in_array($file, $allowed[$_SESSION['level']])) { echo 'You are not allowed on this page'; exit; } } if(is_bool($allowed[$_SESSION['level']])) { // you're allowed; } }
  11. So if login_check($mysqli) returns true, your problem is not in the login check. However you haven't post any other part of your code so we have no clue why the wrong pages are being displayed.
  12. It might be easier to find the problem by finding out which condition is invalid. Try an echo at every possible return false. if ($login_check == $login_string) { // Logged In!!!! return true; } else { // Not logged in echo 1; return false; } } else { // Not logged in echo 2; return false; } } else { // Not logged in echo 3; return false; } } else { // Not logged in echo 4; return false; } } Depending on which number is echo'd you know where your problem is.
  13. ginerjm solution is this: elseif(!(is_numeric($_POST['number1']) && is_numeric($_POST['number2']) && is_numeric($_POST['number3']) && is_numeric($_POST['number4']))){
  14. the attribute with the value _blank is target so maybe try a[target=_blank]. The page might also be blank because there is a php error. Try setting your error reporting on E_ALL.
×
×
  • 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.