452 Posted Topics
Re: Are you asking how you can use the item that the user selects in your <select> to fill another <select> element? | |
Re: In line 2, you are comparing `session` to `null`. However, firstly, there is an error in your code here, as "session" is no PHP language. It should either be $session or $_SESSION. If you want to check if a session has been started, I recommend you use session_id() to check … | |
Re: Maybe the varchar (225) kicks in here. Does the article that you are submitting not exceed the field's maximum storage size (225)? ![]() | |
Re: If you are still looking for a regex, something like this might work: `/\[url\](?!\[url\])(.*?)\[\/url\]/is` It returns only [url] tags that are not followed by another [url] tag. | |
Re: Have you checked your developer console for possible errors? Usually it shows information about what's going wrong - if something is going wrong. | |
Re: What pritaeas says is (well, what else would you expect) right. To track progress, you'd have to separately select and insert those rows, which would - in this case - probably create an unnecessary delay in your operation. ![]() | |
Re: Index page: <?php session_start(); echo '<p>Your session id is: ' . session_id() . '</p>'; Other page: <?php session_start(); echo '<p>Your session id is: ' . session_id() . '</p>'; See if they match if you will ;). | |
Re: You could do it in the loop that fetches your DB records. E.g. <?php while(...) { $website = $record['website']; $website = str_replace('$site', $site, $website); } | |
Re: I think you should maybe use `<?= $_POST['name']; ?>` instead of just `<?= $name; ?>`, as the `$name` variable hasn't been set yet when PHP arrives at the <form> part. | |
Re: Have you tried what has been posted [here](http://stackoverflow.com/questions/376253/stretch-and-scale-css-background) (StackOverflow)? | |
Re: Move the `name` parameter to the input with `type="text"`, then it should probably work! <input type="text" name="q"id="searchtxt" /> <input type="submit" id="searchbtn"/> | |
Re: For as far as I know, the css() function only accepts two parameters, being index and value. E.g. you would execute `css('width', 420)`. I'm not completely sure though, but I can provide you with an example of which I'm sure it works: var new_width = $('#div').width() + 120; $('#div').css('width', new_width); … | |
Re: What about: <?php if(date('H') > 9 || date('H') < 21) { // Show div. } ![]() | |
Re: An example, with you class A (just try to execute it, might clear things up a bit more for you): <?php class A { private $private_attribute = 'this is a class attribute, that you can use in any of this class's functions'; public $public_attribute = 'this is a class attribute, … | |
Re: Your query seems to be incorrect. You should probably not use `WHERE $add_city` but `WHERE add_city` (without the $). Besides that, a COUNT() query might be more efficient here. E.g.: <?php $q = 'SELECT COUNT(add_city) AS c FROM dbAdd WHERE add_city = "' . mysql_real_escape_string($wil) . '"'; $rq = mysql_query($q); … | |
Re: First of all I think the use of the <marquee> element is waaaay overaged. Second, I think you could solve this problem by adding a CSS style to your <ul>'s <li> elements. Example: li { float: left; margin-right: 6px; } | |
Just curious about your thoughts on this subject. **Example:** www.site.com/?id=1 or www.site.com/?id=8adyfa8df614812yasdf (which is also "1", but encrypted) What would you recommend? What do you use? Anyone with pros and/or cons on if you should encrypt your URL data? **My thoughts:** Pros (to encrypting URL data): - Makes it harder … | |
Re: I'm not sure but the first thing that comes to my mind is that IE8 is not ready to interpret HTML5 tags like <nav>. Maybe you could find out more about that? | |
Re: I would like to suggest a (in my opinion) cleaner solution :). This solution is as follows: 1. Create a database file, in which you create your database connection, etc. You can include that file in every file that you need a database connection in. This way, you don't need … | |
Re: I guess you should check out the [fputcsv()](http://www.php.net/fputcsv) function :). | |
Re: You must select a database using the [mysql_select_db()](http://www.php.net/mysql_select_db) function. So, replace this line `$con = mysql_connect($host, $username, $password, $db_name);` by the following $con = mysql_connect($host, $username, $password); mysql_select_db($db_name, $con); Note, however, that PHP's mysql_* functions will be deprecated in the future, and that any further use of it is disencouraged. | |
Re: What do you have so far? :) Usually it goes something like: SELECT * FROM table_name WHERE created = "2013-12-11" | |
Re: First thing that comes to mind: Make the PHP script that does the pinging (ping.php) write its results to, for example, ping_results.txt. Then, make an AJAX call to ping.php and immediatelty after execute a Javascript timeout that executes an AJAX function every 0.5 or 1 seconds, which opens ping_results.txt and … | |
Re: Maybe your PHP installation does not support shortcodes. You could try using ` Second<input type="text" name="text2" value="<?php echo $var2; ?>" disabled><br>` instead of ` Second<input type="text" name="text2" value="<? echo $var2; ?>" disabled><br>` | |
Re: I suppose something like this should work: $_SESSON['username'] = $result[0]['username']; $_SESSON['fullname'] = $result[0]['fullname']; | |
Re: Are you getting any errors or is the data not being inserted without giving you a notice/warning/error? | |
Re: It is called Javascript ;). It would work something like: <script> function activateLinkOne() { displayMessage('Link 2 is disabled.'); link1.activate(); return false; } </script> <a href="link.com" onclick="return false;">Link 1</a> <a href="link2.com" onclick="activateLinkOne()">Link 2</a> (Note that this code will not work; it is merely an example). | |
Re: Well it seems like you already have some code. Is that not working correctly or? Checking if a checkbox is checked, by the way, can be done properly and easily by using `.is(':checked')` (jQuery, returns true or false). | |
Re: I think you could add `RewriteRule ^product.php/([a-zA-Z0-9]+)$ product.php?id=$1` to get that working. Or you could use this: RewriteEngine on Options -Indexes RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L] to redirect **everything** to your index page, and then use $_SERVER['REQUEST_URI'] to parse the URI and load the appropriate … | |
Re: I haven't done this with editable <div>s before, but usually you get a div's content by using div.innerHTML, not div.value. So changing your code to function maths() { var qt = document.getElementById("quantity1").innerHTML; var up = document.getElementById("unitprice1").innerHTML; qtup = parseFloat((qt * up)) || 0; document.getElementById("total1").innerHTML = qtup; } might work. Why … | |
Re: I guess that by "certifications" they mean something like "which languages have you proven yourself certified to program in?". So I guess you could fill in the languages you have a lot of experience with? | |
Re: You could use jQuery's `$(window).scroll()` function, which can execute a function on scroll. That function could then check what the screen's height is (`$(window).height()`), how far the user has scrolled from the top (`$(window).scrollTop()`) and then use those values in a calculation to see what part of the screen is … | |
Re: Do you want an AJAX request to be executed when that happens? And do you maybe have some more information about the case? Like what does the <select> element look like, and how does the percentage get calculated? | |
Re: The problem with your code is that you are assuming that every field always has a value. However, `undefined * something` will always return NaN. It works the same as `0 * anything`: 0 times anything is always 0. Example: var a = undefined; var b = 15; var c … | |
Re: Pfew this maybe is a pretty vague description of your problem ^^. Could you be a bit more specific please? You have two database columns which both have an INT field set as primary key, of which the one references to the other? And you want to store which value … | |
Re: So the user has to check some checkboxes, of which the values will then be converted to .csv and offered as a download? Or are there multiple .csv's available for download, and does the user have to select which of those he wants to download? | |
Re: Well, your checkboxes will not be in the `$_POST['hidden']` array if they have not been checked. Therefore you cannot set them to 0 using a foreach() loop the way you are using it. You will somehow need to compare the checked checkboxes against the present checkboxes, and work with the … | |
Re: For as far as I know, when you do something like this: <?php echo $shipping1+number_format ($row_panier['subtotal'], 2, '.', ''); ?> it is not just an echo that is taking place; rather the script is parsed one by one and `$row_panier['subtotal']` is added to `$shipping1`. I think this can easily be … | |
Re: Well if you have stored information about where these files are saved with your link, I guess you could retrieve this information when you delete the link, and delete the related files with it? You can use the [unlink()](http://php.net/manual/en/function.unlink.php) function for deleting files :). | |
Re: if (mysql_num_rows($userquery) != 1) /* I think this line is the problem but how to i fix this */ { die ("that member could not be found!"); These lines are saying: If not exactly one record is found, stop the script. Why don't you use this instead?: if (mysql_num_rows($userquery) < … | |
Re: I guess you could use `document.getElementById('loginstate').setAttribute('href', 'url');`? | |
Re: What is the error that is being caused? | |
Re: I've never used this API before and this might sound really really dumb, but have you tried using the keyword "flying" instead of "fly"? (Since you're also talking about driv*ing*, walk*ing*) | |
Re: Are you getting an error? Multiple errors? What seems to be the problem? | |
Re: Try replacing `<link rel="style" href="main.css" >` with `<link type="text/css" rel="stylesheet" href="main.css">`, and check if main.css is in the same folder as your main.html =). | |
Re: I disagree on that you NEED a color picker, and there are a lot more resources that can help you to learn how to code. Maybe you could expatiate on all these subjects a bit more? Because I don't think this short post gives someone who wants to start coding … | |
Re: Well, reading your post I'm assuming this is your problem: In Javascript you have an array with values (var chart in your example), which you want to be converted to a string and then to be set as the value of a specific input checkbox. This can be achieved as … | |
Re: A working solution, although maybe not the fastest, could be: $(this).find('td:nth-child(2)').each(function() { // Create a clone of the <td>, so that we can modify its contents. var clone = $(this).clone(); // Remove the <select> from the cloned <td>, so that we can properly use // the :contains selector. clone.find('select').remove(); // … | |
Re: That sounds like some basic Javascript (I would suggest jQuery) tutorials. I would say: check out these pages: http://www.w3schools.com/jquery/ (If you have never worked with jQuery before) http://www.w3schools.com/jquery/jquery_ajax_intro.asp (Introduction to jQuery's AJAX functions) http://api.jquery.com/jQuery.ajax/ (The jQuery ajax() function) |
The End.