452 Posted Topics
Re: Have you tried a Javascript function that uses [settimeout()](http://www.w3schools.com/jsref/met_win_settimeout.asp)? | |
Re: What about you create a timer that checks every x miliseconds if the button exists, and if so, clicks it? | |
Re: An unescaped dot matches **any** character (except a whitespace if the modifier is not set). You need to use `\.` to match a dot, instead of just `.`. Also, you can replace `{1,}` by `+` (which means the same: 1 or more). | |
Re: Use the [__construct()](http://php.net/manual/en/language.oop5.decon.php) function. It is called when the object is instantiated (i.e. when you execute `$object = new Object();`. Example: class booking_diary { // Time Related Variables public $booking_start_time; public $booking_end_time; public function __construct($a, $b) { $this->booking_start_time = $a; $this->booking_end_time = $b; } } | |
Re: You're probably getting a **notice** that there is an undefined variable on line 4. That is because `$_post` does not exist. Variable names in PHP are case-sensitive. This means that you need to use `$_POST` (with capital letters) - this represents the values that are sent with the POST request. … | |
Re: 1. [Google](https://www.google.nl/search?q=browser+close+event) 2. Leads to [StackOverflow](http://stackoverflow.com/questions/20853142/trying-to-detect-browser-close-event) 3. You've got your answer! Which is something like: ----- window.onbeforeunload = function (event) { var message = 'Important: Please click on 'Save' button to leave this page.'; if (typeof event == 'undefined') { event = window.event; } if (event) { event.returnValue = message; … | |
Re: These are notices, not severe errors. You can change your error reporting to E_ALL & ~E_NOTICE if you don't want to see them. Or you can simply check for the existence of values before you try to display them. E.g. `if (!empty($var)) { echo $var; }`. Also, there's a "Reply … | |
Re: What is the error that you're getting? You could try to add `print_r($row);` inside your loop so that you can see the contents of $row and see if anything is missing. | |
Re: When a session is completely destroyed is not always up to you. A user himself can decide when he wants to clear all website data. That can be when he closes the browser, but that can also be when he closes a tab. The only thing you have influence on … | |
![]() | |
Re: What about using a Javascript timeout? $('#element').click(function() { setTimeout(function() { window.location.href = 'http://website.com'; }, 3000); }); ![]() | |
Re: **When** do you want those fields to have their values reset? Because looking at your code, there doesn't seem to be a problem to me: if a selects an unallowed file type for uploading, he will get an alert and the field will be rest, right? Isn't that what you … | |
Re: You search Google for info about the .htaccess file and try some tutorials to create one. Then, if you can't figure out how to create one or if you run into problems, you post your questions here, and we can help you. Edit: A useful link given by fireburner29 in … | |
Re: Could you post what's on line 142? | |
Re: My eyes, it burns! Sorry, just had to say that before anyone else can. It's also a bit much to read, and I'm wondering what the goal of the query/procedure is - maybe it can be improved? | |
Re: You can invalidate your cache by using `header()`. Example: header('Cache-Control: private, max-age=0, no-cache'); on the first line of your file. But I don't think that'll work in your example. It only works on the page that offers the file as a download. That means that in your case, you'd have … | |
Re: You should checkout the [DateTime](http://php.net/manual/en/class.datetime.php) class. Example: <?php $date_1 = new DateTime; $date_2 = new DateTime; $date_1->setDate(2015, 02, 01); $date_1->setTime(0, 0, 0); $date_2->setDate(2015, 02, 05); $date_2->setTime(0, 0, 0); $diff = $date_1->diff($date_2); echo '$diff: ' . $diff->format('%d days') . '<br>'; // OR: $date_1->add(new DateTimeInterval('P1Y'); // Adds 1 year to $date_1, check … | |
Re: What about something like: <?php $letters = range('a', 'z'); $numbers = range(0, 26); echo 'Value before: ' . $value . '<br>'; $value = strtolower($value); // The value in which you want to replace stuff. $value = str_replace($letters, $numbers); echo 'Value after: ' . $value . '<br>'; ![]() | |
After reading [this](https://www.daniweb.com/web-development/php/threads/491368/looking-for-advice) post I started wondering what is required nowadays to build an app. Let's take an Android app as an example. I've heard of porters like PhoneGap, that convert your HTML/Javascript to Java (Android for as far as I know), but are there easier ways nowadays? I know … | |
| |
Re: No no, "float" is a style property, you'd have to put it in your CSS ;). So, instead of `float="right"`, use `style="float: right;"` or put a `float: right;` in your stylesheet for the element it needs to be applied to. | |
Re: Well, even though you are setting error messages, you don't check if those error messages are set anywhere, and you don't generate an error based on the error messages. So in your code, it seems to me that it is a waste of lines, time and resources to even set … ![]() | |
Re: Have you tried the bootstrap website? It contains a great starters guide. http://getbootstrap.com/css/ (I know you're asking for a forum, but my interpretation is that you are also looking for a way to learn bootstrap, hence this answer :)). ![]() | |
Re: I don't really get what you're asking here. What exactly is is that you want help with? Writing PHP to display records? Then you'd have to be a bit more specific about what information you want to display. So could you clear up your question a bit? | |
Re: Well, have you checked line 22 in C:\xampp\htdocs\sandbox\config.php? It might contain an error :p. | |
Re: It seems like a notice, so it's not an error that will stop your script. What it means is that all the mysql_ functions are deprecated and you are disencouraged to use them. Instead, you should use the mysqli_ functions, or the mysqli or PDO class to execute your queries. | |
Re: This is because you've outputted something (probably tex) to the browser before your headers were sent. Headers net to be set and sent **before** you output text to the screen, because the headers usually tell the browser what kind of stuff it is that you are sending to the screen, … | |
Re: You can't. You would have to either have to lock down your website for **everyone** or leave it open to everyone. And a website that is publically accessible will be readable and will thus be copyable. You can try to prevent some stuff by disabling right mouse clicks, for example, … | |
Re: HTML: <form action="enableprofile1.php" method="post"> <input type="hidden" name="id[]" id="id[]" value="<?php echo $sn; ?>"> <input type="checkbox" name="enable[]" id="enable[]" value="1" <?php if($en=='1'){ echo 'checked'; } ?>> <input type="submit" name="save" value="Save" class="fontBold"> </form> PHP: <?php foreach ($_POST['id'] as $i => $id) { $enable = $_POST['enable'][$i]; if (!$enable) continue; // Do whatever you want here. … | |
Re: <?php $min = 0; $max = 100; $random_number = mt_rand($min, $max); printf('Your random number is %d', $random_number); | |
Re: Well, that sounds like there is no easy solution. You'd just have to find out what `wp_get_current_user()` does, where it comes from, when it should be included and why it isn't included in your file. Or find someone with the same problem, but it doesn't really sound like a much … | |
Does anyone know how to install a new locale on Apache that comes with Xampp for Windows? I'm trying to find an answer with Google but it only shows results for "local" instead of "locale" -_-. (I want to install a Dutch locale. It might even be in there already … | |
Re: Well, there seems to be missing an INSERT or UPDATE query to insert/update the like/dislike, and there seems to be missing a `<form>` that the buttons use. So where/when exactly is stuff going wrong? | |
Re: What JorgeM says, plus: my best guess is that it has something to do with the contents of `$message`. Have you tried omitting `$message` from your CSV to see if styling still comes through? | |
Re: So all a shop's products are saved inside a big TEXT field? Isn't the whole idea of SQL that you - in this case - should save all your products in one table, say "products"? That would probably increase performance by itself. For example: +-------+--------------+------+-----+---------+-------+ | Field | Type | … | |
Re: jQuery would indeed be excellent for this task. If you don't know it yet, I suggest you read some tutorials. What Traevel says will also be much clearer if you have a basic understanding of what you can do with Javascript / jQuery. | |
Re: Don't get me wrong here, but are you sure you know how to use the rest of that script if you don't even know how to output such a thing? :p Because seeing that script I don't get the impression that you're new to scripting. Anyway, usually you perform a … | |
Re: Well that probably means that you have somehow specified the wrong MySQL connect/login data. EDIT: Ahum, reading the error again, I think there might be something else wrong :p. Although I am not sure what it could be, I still suggest you validate that your connect/login data is correct. | |
Re: If you are asking how to create a complete CMS, I'm afraid that's going to be too much to explain in just one forum post. There are numerous tutorials on the internet that explain step by step how you can set up PHP-MySQL websites and, with that, content management systems. … ![]() | |
Re: Looks as if you're simply providing a wrong username/password combination indeed. | |
Re: I believe there are multiple e-commerce management systems. There are plugins for Wordpress, but probably for Joomla as well. You have Magento, OpenCart, and probably numerous others. I suggest you google for something like "web shop management systems", "hosted web shop management", or anything like that. | |
Re: God damnit I was just getting used to Windows 8, and now they're going to bake scrambled eggs with it to make yet another new interface and who knows what. I actually kinda like Windows 8. | |
Re: First of all: do you get an error, or does the mail simly not arrive? Second: you don't have to enclose the variables you pass to the mail() function in quotes. So: mail("$sendto","$thesubject","$emessage","$eheaders"); could/should become: mail($sendto, $thesubject, $emessage, $eheaders); Third: your $thesubject variable does not seem to contain a value … | |
Re: I think you may want to style the <td> borders instead of the <table> borders to get what you're looking for. So: table#adminTable td { border: 1px solid #e2e0e0; } ![]() | |
Re: First thing I see is that your code is a bit.. unexpected: Your code: if(isset($_SESSION['user'])== ' '){ header('location:index.php'); exit(); } Should be: if(!empty($_SESSION['user'])){ header('location:index.php'); exit(); } as isset() returns a true/false value, and not a string like " " (to which you are comparing it now). I suspect that you … | |
Re: You have bound the checkForm() function to the form's submit button. I think that's what destroying your plans here. You should probably bind the function to the submit event of the form instead of to the submit button. | |
![]() | Re: Why do you have your *mouseout* event listener **inside** the other event listenere in the first place? :p |
Re: That looks like text highlight --> add comment? | |
Re: Doesn't the Javascript version require two http requests to be made (the post request and then the reload) versus only one when submitting a form right away? |
The End.