505 Posted Topics
Re: You need to have two distinct processes. One to log in and another to log out. With the approach you have suggested, what if someone forgets to enter the code for a second time to logout? With regard to your database structure, I would suggest a user table, and then … | |
Re: When defining your database table, typically the unique identifier is a numerical field, where the value automatically increments. MySQL will then keep a track of what the next id number should be based on those it has previously allocated. Auto increment would not reallocate the same id value, unless you … ![]() | |
Re: I usually use this plugin... [url]http://jquery.malsup.com/cycle/pagerHover.html[/url] | |
Re: It looks as though it is storing the time against the post, so that the same post is used for an entire day. Another way to achieve something similar would be use the query: [CODE] global $wpdb; $timestamp = strtotime(date('Y-m-d')); $sql = "SELECT * FROM `wp_posts` WHERE `post_type` = 'post' … | |
Re: Binding the onkeypress event to the body tag might do it. And it would only work when the browser window is active But why would you want to? What are you trying to accomplish? | |
Re: Three options would be to: 1. Create a [URL="http://codex.wordpress.org/Shortcode_API"]shortcode[/URL], which you could enter into the content field of a normal WordPress page, and that could take the ebook for display on that page as an argument, and then render the flash markup. 2. Create a custom WordPress [URL="http://codex.wordpress.org/Theme_Development"]page template[/URL] and … | |
Re: The whole point of the web root is that web accessible content should be in the web root or lower. Content above the web root, e.g the server OS and other important files are protected. You can access these protected files via other scripts within the web directory, but you … | |
![]() | Re: Why not simply add the user type to the query when looking up the username and password? [CODE] $sql= mysql_query("SELECT userID FROM user WHERE username='$superUser' AND password='$password' AND userTypeId = 1 LIMIT 1"); [/CODE] |
Re: You need to start the session before any other output is sent to the browser, because it sends a PHPSESSID cookie in the response headers. | |
Re: This is quite a common question on programming tests... Is that coincidence? :) | |
Re: The require statements in Zend Framework are relative to the Zend directory. You therefore need to add Zend Framework to your include path: [CODE] set_include_path(implode(PATH_SEPARATOR, array( '/path/to/Zend', get_include_path(), ))); [/CODE] R. | |
Re: What data type is your date field? Varchar? One reason MySQL stores dates in the format YYYY-MM-DD is that it allows the field values to be quickly searched. For example, if searching for values between 26/12/2011 and 09/01/2012, MySQL would be able to discard all fields that start with anything … | |
Re: You can only download one file per server response, because you can only send one set of response header. If you want to download multiple, based on which checkbox values are selected, write them to a [URL="http://php.net/manual/en/class.ziparchive.php"]ZIP archive[/URL] and return that instead. R. | |
Re: Hi, I think you've answered your last question yourself. PHP session data is stored on the server, although there is a cookie that is stored on the client's machine to tell PHP which session to use. It largely depends on what you need to do with the session data. JavaScript … | |
Re: Hi, It's not working because your selector doesn't exist: [CODE] $('#datepicker'); // This means an element with id="datepicker" $('input[name=datepicker]'); // This means an input element with name="datepicker" [/CODE] To resolve, change your selector, or add an id attribute of datepicker to your input field. R. | |
Re: Hi, A couple of options that I can think of are: 1. Disable case sensitivity on Apache. This [URL="http://keystoneit.wordpress.com/2007/02/19/making-apache-case-insensitive/"]article[/URL] might help. 2. Use mod rewrites to redirect requests for lowercase URLs to uppercase, etc. R. | |
Re: Just looking at the calculations you have, you're checking whether the ratio is [B]exactly[/B] equal to 0.8 or 0.7 or whatever. The probability of a user entering measurements that would give you exactly that ratio is very remote. Consider someone having a waist of 30" and hips of 32". That's … | |
Re: I think you might be looking for the [ICODE]eval[/ICODE] function. ![]() | |
Re: Did you not like the [URL="http://www.daniweb.com/web-development/php/threads/396257"]answer[/URL] that I posted to this same question yesterday? | |
Re: If you want to take plain text from a textarea, and treat each new line as a separate bullet point, you could store the plain text in the database, and then parse the content as follows when retrieving it: [CODE=php] <?php $bullet_points = explode("\n", $plain_text); ?> <ul> <?php foreach($bullet_points as … | |
Re: Have you confirmed whether the counter value in the database is being incremented? I don't mean to tell you something you might already know, but check the wp_options table, and search by option_name for [I]cf7-counter[/I]. If the value is being incremented, that means you've set up the action correctly. Then … | |
Re: As @jogesh pointed out, there is no such function as mysql_results. Drop the [B]s[/B] - [B]mysql_result[/B]. Also, mysql_result only returns false on error, otherwise it returns a MySQL result object, even if no rows are found. You would therefore need to use the mysql_num_rows function to determine whether no results … | |
Re: I used the code snippet in this [URL="http://jqueryfordesigners.com/fixed-floating-elements/"]tutorial[/URL] and it worked rather well. Just add jQuery and the JavaScript to your theme and the CSS to your stylesheet. R. | |
Re: Do you have the GD library installed on the server where it isn't working? | |
Re: Why don't you look at the database object from one of the many PHP libraries? E.g. [URL="http://framework.zend.com/manual/en/zend.db.html"]Zend[/URL], [URL="http://docs.kohanaphp.com/libraries/database/builder"]Kohana[/URL], etc? Why re-inventing the wheel? ![]() | |
Re: When the form is submitted, you can access the input value from the POST array: [CODE] var_dump($_POST[$id]); [/CODE] Also, your method for selecting random questions doesn't look too efficient. You're making a separate query for each question. An alternative would be to move the random element into the SQL query. … | |
![]() | Re: If you're running Apache, and PHP, have you installed and configured mod_php5? This is what essentially links the two and tells the web server to parse the PHP code, rather than just return it. |
Re: I assume you need to dynamically add the city id to the navigation item. If you do, then I think you're going to need to write and pass a [URL="http://codex.wordpress.org/Function_Reference/wp_nav_menu"]custom walker[/URL] to the wp_nav_menu function. Also, bear in mind that just because WordPress provides a menu function, it doesn't mean … | |
Re: HTTP requests in themselves are stateless. The only way to persist data/variables between requests is to persist them in a file (database, session, cookie). The singleton pattern will only work during the same request. So if during a single AJAX request, you get a database instance twice using getSingleton, it … | |
Re: Can you post your code? And you might get more help in the [URL="http://forum.kohanaphp.com"]Kohana forum[/URL]. | |
Re: If you write a script to write the data to a file with a .xls extension as an HTML table, it will open in Excel. Then all you need to do is select and iterate through all the tables and rows you want to export from your MySQL database. | |
Re: Are you asking how you can use the search term Action, Documentary, etc in the Wordpress search form and for it to display posts filed under the searched category? If so, Wordpress strangely enough doesn't do this by default. Instead, you need to override the search query in Wordpress. This … | |
Re: Why not just use a HTML form, with the PHP file path set as the action. Generally, hitting enter in a text field will submit the form. If not, use JavaScript to force form submission when the enter key is pressed. | |
Re: At a guess, I assume your table `Usuarios` has more than just two columns. If so, on line 10, you need to specify the fields for which you're providing values. E.g. [CODE] INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...) [/CODE] If that still fails, run the query … | |
![]() | Re: Why not try something like: [CODE=php] if($country == 'GB') $delivery = 1.15; elseif(in_array($county, array('AI', 'AD', 'AM', 'AT', 'BY', 'BE')) $delivery = 2.15; else $delivery = 3.15; [/CODE] All, variable names are case sensitive, and strings should be wrapped in single quotes (or double depending on usage). This may help explain … ![]() |
Re: I've tried quite a few over the years. I found Notepad++ to be a very simple IDE, which does the basics very well. But I did find that I missed a project/file list. I found Eclipse to be feature packed, but very bloated. Zend Studio is again feature packed, but … ![]() | |
Re: You have just answered your own question. The link you have provided appears to use JavaScript to do exactly what you ask. Why not view the source and extract the code? Otherwise, find the ingredient measurements for a single serving and multiply this value by however many people the recipe … | |
Re: [CODE=php] header("Location:edit_products.php?catid={$_POST['catidHd']}&catname={$_POST['catnameHd']}"); [/CODE] | |
Re: I'm not too familiar with Joomla, but could you not check the name of the menu being rendered, and if it's the header, use one template, otherwise use the default? | |
Re: Try [URL="http://www.sencha.com/products/extjs/"]ExtJS[/URL]. | |
Re: Have you considered using a JavaScript library, like jQuery or Mootools for performing AJAX and other JavaScript tasks? These libraries perform all of the heavy listing and are thoroughly tested to ensure maximum cross-browser compatibility. | |
| |
Re: Do you understand the purpose of object inheritance? Simply, the idea is that when two objects have similar attributes and methods, rather than declare the attributes and methods twice, you can use inheritance - DRY - Don't Repeat Yourself. From the example you have provided, I cannot see why an … | |
Re: Hi, Below is a .htaccess file from WordPress. The third and fourth lines check whether the requested path is an actual file or directory. If either returns true, then the rewrite rule will not be followed. [CODE] <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule … | |
Re: Unless you've simplified your code for posting it in this forum, and as such some steps are missing, you have gone about the process of redirecting to that URL in a very long winded way. A more succinct method might be: [CODE] include 'connect.php'; $m = (int)$_GET['m']; // Assumed integer … | |
Re: If you amended your notification links to have their own subdirectory, to something like: [CODE=html] <a href="/report/dead?id=123" title="Report dead link">Report dead link</a> [/CODE] Then you could use a robots.txt file to exclude the /report directory. This should stop robots from indexing any page in that directory. R. | |
Re: You haven't specified the field names in your insert query: [CODE=mysql] INSERT INTO `jlt`(`id`, `name`) VALUES (1, 'example'); [/CODE] And by not escaping your input variables, you're leaving the script open to SQL injection attacks. | |
Re: My first question would be, why are you writing your own MVC framework? Why do you think you can do it better than any of the other people who have already released frameworks? I'm not asking to be mean, it's a genuine question you need to ask yourself. Could your … | |
![]() | Re: You could do: [CODE=php] $name = $firstName . ' ' . $lastName; $name = "{$firstName} {$lastName}"; $name = "$firstName $lastName"; [/CODE] R. |
Re: Input fields need to have the attribute name specified, and this is then used as the key for the $_POST array. E.g. [CODE=html] <input type="text" id="name" name="name" /> [/CODE] |
The End.