Jump to content

tecmeister

Members
  • Posts

    173
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tecmeister's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi guys, I am wondering if their is a way of getting the users location before the page has loaded? Thanks, tecmeister.
  2. There is know way of creating/programming a website. It is your own way. Some people may think its wrong/right. What ever way you feel comfortable with is fine.
  3. Where? You don't. If I copy and paste everything we will be here for ever. And if I put in the delete method parent::__construct() as the first thing i still get the same warning.
  4. AGAIN, yes I do. On the index page I run the __constructor(), and the page that I'm running the delete class on is displayed on the index as require_once("/pages/delete.php").
  5. This is the database class that I use to connect to the database. On the index page I refer to the database class. class database { function __construct(){ $this->connect(); } public function connect(){ mysql_connect("localhost","nurevol1_teci","b748a9766483850584695e364c8b2d34")or die("<h1>Connect ERROR</h1>".mysql_error()); mysql_select_db("nurevol1_pyung")or die("<h1>MYSQL SELECT ERROR</h1>".mysql_error()); } public function query($sql) { return $query = mysql_query($sql)or die("<h1> MYSQL QUERY ERROR </h1>".mysql_error()); } public function fetch($query) { return $fetch = mysql_fetch_assoc($query); } } This is the class that I'm using to delete te Image. class delete extends database { function selectDB($ID) { $sql = "SELECT path FROM news WHERE ID='$ID'"; $query = parent::query($sql); $fetch = parent::fetch($query); $this->delImage($fetch['path']); exit(); } function delImage($image) { unlink($image); } } This is the code that I use to get the get the class and refer to it. // GETTING THE ID FROM THE URL $ID = $_GET['id']; $page = $_GET['delete']; if((isset($_GET['delete'])) && ($_GET['delete'] == 'news')) { require_once("_class/delete.php"); $delete = new delete(); $delete->selectDB($ID); } O and just to note that I have just put the parent:: into try new stuff. I was using $this->
  6. Yeah I am, I just missed copying and pasting it on the site.
  7. I typed it corret on the site. it was just a miss type on here. I have no idea what this means please can you tell me.
  8. require_once("_class/delete.php"); $delete = new delete($ID); class database { function __construct(){ $this->connect(); } public function connect(){ mysql_connect("localhost","**********","**********")or die("<h1>Connect ERROR</h1>".mysql_error()); mysql_select_db("**********")or die("<h1>MYSQL SELECT ERROR</h1>".mysql_error()); } public function query($sql) { return $query = mysql_query($sql)or die("<h1> MYSQL QUERY ERROR </h1>".mysql_error()); } public function fetch($query) { return $fetch = mysql_fetch_assoc($query) } } class delete extends database { function selectDB($ID) { $sql = "SELECT path FROM news WHERE ID='$ID'"; $query = $this->query($sql); $fetch = $this->fetch($query); $this->delImage($fetch['path']); exit(); } function delImage($image) { unlink($image); } } I have put the exit() in so I can see the Warning.
  9. Even if I remove the __constructor and have it as a basic method I still get the same Warning. I have got the: error_reporting(-1); ini_set('display_error', 1); The thing that I dont understand it that it has know problem not in a class but when in a class it gives me th same Warning. I have the __constructor connecting to the database at the start of the page. Much appreciated for your help, tecmeister.
  10. Hi Guys, I only get this Warning when I use it in a class. This is the class script: require_once("_class/delete.php"); $delete = new delete($ID); class database { function __construct(){ $this->connect(); } public function connect(){ mysql_connect("localhost","**********","**********")or die("<h1>Connect ERROR</h1>".mysql_error()); mysql_select_db("**********")or die("<h1>MYSQL SELECT ERROR</h1>".mysql_error()); } public function query($sql) { return $query = mysql_query($sql)or die("<h1> MYSQL QUERY ERROR </h1>".mysql_error()); } public function fetch($query) { return $fetch = mysql_fetch_assoc($query) } } class delete extends database { function __construct($ID) { $sql = "SELECT path FROM news WHERE ID='$ID' LIMIT 1"; $query = $this->query($sql); $fetch = $this->fetch($query); $this->delImage($fetch['path']); exit(); } function delImage($image) { unlink($image); } } This is the not class working code $sql = "SELECT path FROM news WHERE ID='$ID' LIMIT 1"; $query = mysql_query($sql)or die("<h1> MYSQL QUERY ERROR </h1>".mysql_error()); $fetch = mysql_fetch_assoc($query); $image = $fetch['path']; unlink($image); Please could someone tell me it happens in a class. Thanks for your help, tecmeister.
  11. You need to put the database info inside the mysql_num_row($query) example: $query = SELECT * FROM users; if(mysql_num_rows($query) > 1) echo "alert"; else quit();
  12. I have already tried that and still got the same problem. Is there a basic $headers that you know of that will send the email directly to the inbox with the from info etc? Thanks for your help, tecmeister.
  13. Hi Guys, I've set up a contact email form. It sends the information fine, but it sends it to the junk folder. If I just use this command: $headers = "MIME-Version: 1.0 \n"; It will send it to my inbox folder. If I use any other command after it in the $headers variable it will then send it to my junk folder. Here is the full code I'm using: $to = "[email protected]"; $subject = $title; $message = "<html><body>"; $message .= "<div style='border: 1px #ccc solid; padding: 5px; width: 100%; text-align: center'>"; $message .= "<b>Message From ". $name ."</b></div><br />"; $message .= "<div style='border: 1px #ccc solid; padding: 10px'>"; $message .= "Dear Emma,<br /><br />"; $message .= "<span>".$mess."</span></div>"; $message .= "</body></html>"; $headers = 'MIME-Version: 1.0' . "\n"; $headers .= "From: ".$name."<".$email.">\n"; $headers .= "Reply-To: ".$name."<".$email.">\n"; $headers .= "Return-Path: ".$name."<".$email.">\n"; $headers .= "cc: ". $name . "<".$email.">\n"; $headers .= "X-Mailer: Drupal\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" . "\n"; mail($to, $subject, $message, $headers); Thanks, tecmeister.
  14. Hi guys, The title of my question problem seems a bit confusing, so I'll try and explain it to the best of my ability. I'm trying to make my web site move down to the news that they have selected on in the home page. Rather than always start at the top and have to move down there self. How do I do so? Thanks, tecmeister.
  15. Thank you so much for your help.
×
×
  • 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.