452 Posted Topics
Re: So what seems to be the problem? :) Do you get any errors? | |
Re: What does the error message say? The value you filled in for "url" seems a bit odd to me - maybe that's a file that cannot be loaded? | |
So I've given RequireJS a try this weekend, and although it appears to work pretty smooth, I can't figure out one thing: How do I combine PHP and Javascript while using RequireJS? See, RequireJS can only work with .js files, meaning that it cannot "require" .php files. In many files, … | |
Re: Why don't you just select the product merely by the product code? Or isn't that unique? E.g. foreach($_SESSION['products'] as $key => $cart_item) { if($product_code == $_GET['product_code']) { //* This is the product of which we're reducing the quantity. // Substract one (or whatever you want) from the quantity. $cart_item['quantity'] -= … | |
I'll be visiting my girlfriend who's staying in Helsinki, Finland until the end of december, and I'd like to surprise her by taking her on some kind of trip or event or something. However, last time I was there we have already seen the most popular places in Helsinki. So … | |
For some reason my triggers are recursing, while I think they shouldn't. I'll simplify the examples for the sake of you not having to read through all the code. Trigger 1: CREATE TRIGGER table_1_after_delete AFTER DELETE ON table_1 FOR EACH ROW BEGIN DELETE FROM table2 WHERE table2.table_1_key = OLD.table_1_key; END … | |
Re: Just for your information: you can also use PHP to read your URL. Say your .htaccess is like this: RewriteEngine on Options -Indexes RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L] **Everything** is redirected to index.php. In index.php, you can use $_SERVER['REQUEST_URI'], for example, to parse the URL … | |
Re: What is the query that you are using to delete the record? Are you not in a transaction that is cancelled and rolled back? Some background info (queries) would not be misplaced here :). ![]() | |
Re: Well I guess that would be possible :). Maybe something like: $(window).resize(function() { // Do your width checks etc. here, check out the jQuery website for more info. if(page_width < 700) { // Create <meta> tag. $('head').append('<meta name="bla" content="test">'); } else { // Remove the <meta> tag. $('meta[name="bla"]').remove(); } }); | |
Re: I'm sorry but I find it kind of hard to understand your question :p. Is what you're asking: 'How do I pass the value of a textarea to a checkbox WHILE staying on the same page?' If yes, I'd say you'd have to use Javascript for that. If not, could … | |
Re: Why are you uploading images to your database? Wouldn't it be much easier to just upload the images to a specific destination on your server, and then insert the location of that image into your database? E.g. you save your images in /uploads/images and you then save the location of … | |
Re: Have you given these pages/articles a read? http://stackoverflow.com/questions/4329396/mysql-select-10-random-rows-from-600k-rows-fast http://stackoverflow.com/questions/12087519/how-to-query-10-random-unique-records-in-mysql-database http://stackoverflow.com/questions/4966154/how-to-select-random-unique-records-on-each-execution-of-the-sql-query | |
Re: You could add a counter that counts how many times the function has been executed. If it reaches 10, you could prevent the timeout from being set again. I hope that's clear enough :). | |
![]() | Re: Nothing wrong with it. Simple. Maybe you could add some more details :). |
Re: I'm not sure, but most posts I've read about this notice that using the [format()](http://www.php.net/manual/en/datetime.format.php) function might work. So you would return a value that is returned by Datetime::format() instead of just Datetime. | |
Re: Does either of those statements return `true` or `1` or anything that is not `null` or `false`? If yes, then your `||` operator is working for sure :). | |
Re: Might be that your webhost has [register_globals](http://php.net/manual/en/security.globals.php) enabled. Register_globals is deprecated since PHP 5.3, so if this is the case, your webhost is running an older PHP version. I guess you can see if register_globals is turned on or off by using [phpinfo()](https://php.net/phpinfo), but I'm not sure. | |
![]() | Re: From which point up is it going wrong? Is the user with the given username even being retrieved? Or does shit hit the fan when you compare the given password with the password in the database? |
Re: Why don't you just clone the table's <body> element's content and insert it into the other table's body? Why are you cloning the **whole** table and to which exact element are you cloning it? A <td> element in the other table, or another element? | |
Re: The inputs will indeed need new names. Maybe you could add square brackets to the names, to make them an array? PHP will be able to work with that. Example: $(document).ready(function() { $('select[name=options]').change(function() { var number_of_forms_to_create = $(this).val(); var form = $('form#form1').clone(); var target = $('div#test'); for(var i = 0; … | |
Re: If you tell jQuery to `element.after('<tr>');`, the <tr> part is interpreted as "<tr></tr>" (as a whole tag). Therefore you should use another way to create the table you want. For example (with example data): var table = $('table#table_id'); var tr = $('<tr>'); var td; // Create a <td> tag, fill … | |
Re: I guess something like this should work: $('table#your_table_id tr').not(':first').remove(); | |
Re: Well, can't you loop through your queries and validate that the correct data is being inserted? You could break the loop when the error occurs, showing you which data is generating the error. | |
Re: This is not an error, not a warning, but merely a notice. It seems to be caused by `$_POST['check']` not being defined, while your script is trying to access it. You can modify which errors are being reported by using the [error_reporting()](http://www.php.net/manual/en/function.error-reporting.php) function, if you wish to not display notices, … | |
Re: What abouuuut you select the logins only for the user that is logged in? :) For example `SELECT * FROM logins WHERE user = "julius"`. You will then only fetch the login records for that user, which you can display one by one. Alternatively, you can use an ORDER BY … | |
Re: What is it that you want to do, exactly? If you need to "refresh" the content of a div, doesn't that mean you need to check if new data is available? Or do you just want to load new, already known data into a div after a specific amount of … | |
So I'm planning to make a trip through the US. More specifically: through the west of the US (San Fransisco, Las Vegas, that area). I was wondering if you had any tips for me. It would be a 2-person trip of 20 days. Our plan was to rent a car … | |
Re: You could do that, but why don't you just save the image on the server, and save a link to it in the database, which you can use to display the image? :) Oh, and what is it that you are asking, exactly? | |
Re: Tip: If you use time() or microtime() in your random number somehow, you will generate a number that is much more likely to be unique, which means you may have to execute less database operations (less queries are needed to find out if a number already exists, for the number … ![]() | |
Re: What about displaying, for example, no more than 50 records per page, so that a maximum of 50 rows will be updated at a time? And then about updating a large amount of rows: each row contains data that is unique to that row, so you will probably have to … ![]() | |
Re: (However, note that the mysql_* functions will be deprecated in the future, so it is recommended you use another extension for making a MySQL connection, for example PDO or MySQLi.) | |
Re: I guess that the problem is that you are trying to display XML as XML in an HTML document. It works like this: Your HTML document has already told your browser it's an HTML document. Therefore your browser will treat your document as an HTML document. If you want the … | |
Re: I'm not sure, but I don't think that that function is returning an integer, which **is** what you are comparing it against. I suggest you check out what exactly is being returned by the format() function, e.g.: var_dump($verscil_huwelijksdat_tot_zestien_jaar->format('%R%a')); | |
Re: If your purpose is to hide your PHP code, don't worry, because as diafol says: that isn't visible to the client. | |
| |
Re: Have you tried opening a new window with Javascript? You can use the window.open() function for that, if I'm not mistaken. ![]() | |
Re: So.. do you have a start on this project? What have you created so far? :) | |
Re: You could try using [HTML2PDF](http://html2pdf.fr/en/example). It's a (for as far as I know) free PHP class to convert.. HTML to PDF, yea! (guess you didn't see that coming). Create a PHP file, generate a PDF in it and set the headers so that the file will be seen/handled as a … | |
Re: I think this post might help you: http://stackoverflow.com/questions/4110907/how-to-decode-a-base64-string-gif-into-image-in-php-html According to that post and a bit of experience in such matters, you either have a PHP page that outputs ONLY the image, and then put that page inside an <img> element's "src" attribute (e.g. `<img src="image.php?id=1">`), or you use something like … | |
Re: You start a session with session_start(). That should probably be one of the first lines, if not the first line, of any of your files in which you want to use the session. Then, after starting the session, you can save values to it or retrieve values from it, using … | |
Re: Maybe you can use curl for that? :) Example: http://davidwalsh.name/curl-post | |
Re: The imagejpeg() function tries to create a JPEG file in the given directory. If the permissions for that directory are set so that an image cannot be created in it, you will get an error such as the one you are currently getting. Permission denied simply means that the server … | |
Re: I'm not sure but maybe the RAND() should be something your select returns. Just a piece of thought, though. Something like SELECT RAND() AS rand_nr ORDER BY rand_nr DESC Just a question though: what use does it have to create a random order, after you've already ordered by relevance? | |
Re: Of course you are encouraged to create such a slideshow yourself, because it's a nice opportunity and a very good way to practice your programming. However, there are thousands of slideshow plugins out there, and if there is no real need or desire to create one yourself, why don't you … | |
Re: Well it seems like this should be working. Only thing that I see is wrong (in case you haven't found it yet yourself) is the misplacement of your semicolon on line 23. It shouldn't be `include ("inc/OutletsIn" . $country_selected .".php";)` but `include ("inc/OutletsIn" . $country_selected .".php");`. | |
Re: Well, if you need only one record from the *tblStudents* table, and multiple records from the *tblGrades* table, I suggest you just perform two queries. The first query will retreive the student info from the *tblStudents* table. Then, with the studentId that was retrieved, the second query retrieves the student's … | |
Re: Yes you can :). Do you have any experience in using AJAX? If not, this might be a nice tutorial to start: http://www.w3schools.com/jquery/jquery_ajax_intro.asp | |
Re: PS: A link table is an extra table that stores which products are connected to which categories. E.g.: Table categories_products category_id | product_id 1 | 5 1 | 6 1 | 9 2 | 5 2 | 7 2 | 10 3 | 6 3 | 9 Select all products … | |
Re: Not sure but I think it's not recommended you place HTML elements outside your <body> tags (which is what your CSS is doing with the black bar). |
The End.