452 Posted Topics

Member Avatar for JosephHanh

Have you tried a Javascript function that uses [settimeout()](http://www.w3schools.com/jsref/met_win_settimeout.asp)?

Member Avatar for minitauros
0
186
Member Avatar for Tuan_2

What about you create a timer that checks every x miliseconds if the button exists, and if so, clicks it?

Member Avatar for minitauros
0
203
Member Avatar for sasikrishnasamy

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).

Member Avatar for minitauros
0
130
Member Avatar for kingwash

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; } }

Member Avatar for minitauros
0
143
Member Avatar for shady atef

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. …

Member Avatar for minitauros
0
149
Member Avatar for shan980

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; …

Member Avatar for minitauros
0
124
Member Avatar for PhilipRaj

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 …

Member Avatar for ezekel
0
184
Member Avatar for PhilipRaj

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.

Member Avatar for minitauros
0
130
Member Avatar for Nilesh_3

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 …

Member Avatar for minitauros
0
917
Member Avatar for Apurva1026
Member Avatar for diafol
0
209
Member Avatar for mohd_3

What about using a Javascript timeout? $('#element').click(function() { setTimeout(function() { window.location.href = 'http://website.com'; }, 3000); });

Member Avatar for diafol
0
226
Member Avatar for divyakrishnan

**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 …

Member Avatar for minitauros
0
2K
Member Avatar for harishprakash

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 …

Member Avatar for OsaMasw
0
173
Member Avatar for asaidi
Member Avatar for Lethugs

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?

Member Avatar for Lethugs
0
339
Member Avatar for davecoventry

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 …

Member Avatar for davecoventry
0
214
Member Avatar for AntonyRayan

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 …

Member Avatar for minitauros
0
106
Member Avatar for AntonyRayan

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>';

Member Avatar for diafol
0
164
Member Avatar for minitauros

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 …

0
94
Member Avatar for harishprakash
Member Avatar for minitauros
-1
126
Member Avatar for Deep Modi

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.

Member Avatar for Christel_1
0
147
Member Avatar for imti321

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 …

Member Avatar for iamthwee
0
470
Member Avatar for davy_yg

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 :)).

Member Avatar for iamthwee
-2
144
Member Avatar for fireburner29

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?

Member Avatar for fireburner29
0
356
Member Avatar for krishreddy

Well, have you checked line 22 in C:\xampp\htdocs\sandbox\config.php? It might contain an error :p.

Member Avatar for minitauros
0
77
Member Avatar for islamgul

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.

Member Avatar for minitauros
0
81
Member Avatar for UmeshBorse13

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, …

Member Avatar for almostbob
0
75
Member Avatar for fireburner29

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, …

Member Avatar for fireburner29
0
123
Member Avatar for Madiri Salman

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. …

Member Avatar for Madiri Salman
0
2K
Member Avatar for harishprakash

<?php $min = 0; $max = 100; $random_number = mt_rand($min, $max); printf('Your random number is %d', $random_number);

Member Avatar for edbr
0
135
Member Avatar for ravi142

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 …

Member Avatar for minitauros
0
123
Member Avatar for minitauros

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 …

Member Avatar for minitauros
0
1K
Member Avatar for iveto89

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?

Member Avatar for iveto89
0
270
Member Avatar for <M/>

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?

Member Avatar for imti321
0
238
Member Avatar for jacksonronald
Member Avatar for ankit1122

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 | …

Member Avatar for Taywin
0
222
Member Avatar for akhil1

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.

Member Avatar for akhil1
0
179
Member Avatar for AntonyRayan

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 …

Member Avatar for Traevel
0
982
Member Avatar for nadiam

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.

Member Avatar for janissantony
0
861
Member Avatar for chrisschristou

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. …

Member Avatar for diafol
0
267
Member Avatar for Ali_41

Looks as if you're simply providing a wrong username/password combination indeed.

Member Avatar for minitauros
0
149
Member Avatar for Micheal_5

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.

Member Avatar for minitauros
0
120
Member Avatar for ddanbe

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.

Member Avatar for ZZucker
1
407
Member Avatar for nufftalon

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 …

Member Avatar for nufftalon
0
326
Member Avatar for davy_yg

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; }

Member Avatar for diafol
0
298
Member Avatar for chaitu11

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 …

Member Avatar for minitauros
0
121
Member Avatar for munchlaxxx

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.

Member Avatar for minitauros
0
391
Member Avatar for Rahul47

Why do you have your *mouseout* event listener **inside** the other event listenere in the first place? :p

Member Avatar for minitauros
0
200
Member Avatar for mattsheets
Member Avatar for nadiam

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?

Member Avatar for minitauros
0
168

The End.