Jump to content

IanA

Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by IanA

  1. Wow, yes most definitely update. The latest version of PHP 4 has been depricated since 2008...
  2. Is it a premium template? If so, surely you could speak to the creator's and ask for some support? If you provide some error messages from your error log then that may give you some indication as to what is wrong. I guess there's something that's gone wrong with the initial setup of the template or an issue with the template itself.
  3. Use relative URLs, depending on where the classes directory lies in your structure, you could do the following: spl_autoload_register(function($class) { require_once ($_SERVER['DOCUMENT_ROOT'] . '/classes/' . $class . '.php'); }); From your error you can see that your autoloader can't find the file to include.
  4. In what way is the date/time incorrect? $date = date('Y-m-d'); $time = date('H:i:s'); Try the above, that will give you the date and time of the current timestamp.
  5. Hey, did something happen with the Facebook login for the phpFreaks forum recently? Been trying to log in for some time now but I kept receiving errors. Glad it's back working now!
  6. The variable $subject is declared inside an if statement. You are then trying to access the variables outside this statement and if it hadn't been entered, the variables would not have been initialized. Try initializing the variables to null above the line: if (!empty($_POST['submit'])) {
  7. What I am referring to is the execution of this line of code $id = $this->db->lastInsertId(); It should be ran following the execution of: $insert->execute(array( $id = $this->db->lastInsertId(); //REMOVE THIS LINE ':member_id' => $abc['member_id'], ':username' => $abc['username'], ':name' => $abc['name'], ':password' => $abc['password'], ':address' => $abc['address'], ':phone' => $abc['phone'], ':nik_numb' => $abc['nik_numb'], ':gender' => $abc['gender'], ':role' => $abc['role'] )); //AND PLACE IT HERE
  8. Do you have a working SMTP server running on your localhost also? The mail function won't simply send an e-mail for you unless you have SMTP set up too. There are some good free examples such as smtp4dev or fakesmtp that should help you get on your way.
  9. That should work? Is there a redirect on the url you're trying to go to, or is there something in the .htaccess file which is automatically putting 'actions' into the url?
  10. And what does your form look like? Can you provide that?
  11. First, you might want to hide the log in details for all to see... Try adding the following: $mail->SMTPSecure = "tls"; $mail->Port = 587;
  12. It would be interesting to know a good solution to this. My first thoughts would be to have different threads handling this, one handling your presentation logic and another handling the e-mail side of things - I may be incorrect here, so will be best to wait for some of the more experienced developers to have their input.
  13. The query that Barand gave you should do exactly that, as it is using the BETWEEN keyword, it will only return results between the values passed in. Maybe check the user input to ensure the values are being passed through correctly? Obviously Barand has given you two variables: $minprice = 1000; // would come from user input $maxprice = 10000; These were provided as an example only, if you're still using these static values in your query then it will always return that range.
  14. Do you understand simple HTML in order to create your table structure, if not, I would recommend learning this first before worrying about the PHP side of things. If you do know how to create the table structure in HTML, what exactly is it that you want help with? Do you know how to query the database with PHP?
  15. Please make use of the code tag (seen in the toolbar) as this is quite difficult to read. You have highlighted some code in red...are you telling us that this is what you've changed, because if so, it would appear you haven't made changes to to reflect the link Barand gave you. Change your file inputs to the following: <input type="file" onchange="readURL(this);" id="file" name="file[]" /> <input type="file" onchange="readURL(this);" id="file2" name="file[]" />
  16. It would appear that the main reason the image is being 'overwritten' is because either: 1) You haven't properly implemented the examples seen in Barand's link 2) If the file input is now correct, that your PHP is not referencing the uploaded file array correctly. Please attach the php file following your changes so we can see whether they've been implemented correctly.
  17. If you echo your query following the changes made, can you provide us the output?
  18. No problem, glad your issue is resolved. Please mark it as answered.
  19. In your budget table, is ID a primary key? Following your previous two queries, you are missing mysql_query from your INSERT query. I would recommend moving your code over to updated extensions such as PDO or mysqli as the method you're using is depricated and does not protect against SQL injections.
  20. Might not be the most elegant solution, but you could build your query up depending on the result of if statements. i.e $query = "SELECT distinct Img.propertyId as PropertyId, Title, ImageUrl, Location, Bedrooms, Bathrooms, Parking, Price FROM PROPERTIES as Prop LEFT JOIN IMAGES as Img ON Img.PropertyId = Prop.PropertyId WHERE 1=1 AND "; if(PRICESELECTED >= 5000 && PRICESELECTED <= 10000) { $query .= "Price >= 5000 AND Price <= 10000"; } else if(PRICESELECTED >= 10000 && PRICESELECTED <= 15000) { $query .= "Price >= 10000 AND Price <= 15000"; }
  21. Shouldn't you be calling lastInsertId() following the execution of a query? And as Jacques1 said, it doesn't seem clear as to why you've placed that line of code within the array expression?
  22. Try unset($_SESSION["authenticatedUser"]);
  23. Have you simply re-posted the original issue? Have you tried my suggestion?
×
×
  • 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.