
tecmeister
Members-
Posts
173 -
Joined
-
Last visited
Never
Everything posted by tecmeister
-
Hi guys, I am wondering if their is a way of getting the users location before the page has loaded? Thanks, tecmeister.
-
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.
-
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.
-
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").
-
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->
-
Yeah I am, I just missed copying and pasting it on the site.
-
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.
-
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.
-
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.
-
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.
-
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();
-
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.
-
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.
-
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.
-
Thank you so much for your help.
-
Hi Guys, I'm trying to check the database to see if the user has inserted any images. I've tried: if(empty()) SELECT COUNT(userid) FROM personalImage WHERE userid='$id'. Please will you be able to help me and tell me what I need to do. Thanks, tecmeister.
-
[SOLVED] replace a <br /> with an empty space
tecmeister replied to tecmeister's topic in PHP Coding Help
Thank you very much again Alex for your help -
Hi Guys, I'm trying to replace <br /> with an empty space. I'm removing the br / but not the < >. This is the code I'm using: $about = $row['about']; $br = "<br />"; echo preg_replace($br," ",nl2br($about)); How do I remove the < > aswell? Thanks, tecmeister.
-
I have just figured it out there was only meant to be one ../. Even thou when I browse the image on dreamweaver it use two. Thanks for you help, tecmeister.
-
I have just tried that and it doesn't work. I have know idea why it will not work. Thanks for your help thou.
-
Both of these folders are in the users directory. The path that the image is in: Images->profile_image->tecmeister The path I'm trying to view from is: update->_INCLUDE->main.php
-
Hi Guys, I'm having trouble viewing an image from a folder that is not in the same main directory. When I try and view it in the same main directory it is fine. <img src="<?php echo "../../".$data['imagePath'];?>" width="210px" height="auto" /> I have tried viewing the image not using php and it still has the same problem. <img src="../../Images/profile_image/tecmeister/n509028508_2928.jpg" width="210px" height="auto" /> I've also looked at the permission of the folder and it is fine.
-
Hi Guys, I'm having this problem: The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. I deleted a folder that I created. The folder I named wrong. After doing this, I got the error. It works fine on the html, but get the error on php. I've looked at the permissions on each file/folder. They are all set to 755. http://aerialfusion.co.uk working fine http://aerialfusion.co.uk/index.php getting the error Thanks for you help, tecmeister.
-
I use this: if(isset($_SESSION['attemps'])){ echo "Then do this"; } else{ $this->attemps(); } and it keeps on doing the else.
-
Array ( [attemps] => 0 [test] => 0 )