452 Posted Topics
Re: Well hasn't it always been so that there is an "intellectual few" and a "following mass"? "Intellectual" here does not mean "morally just" or anything like that, just clever people. Relatively, do you think there has been any change during "all" those centuries? I don't think that we've either become … | |
Someone just notified me that a new free online space provider has launched, called Copy. If you know Dropbox: it's pretty much similar to that for as far as I can see now, only here you get a starting **15GB** for free (instead of 2? at Dropbox). They now have … | |
Re: Do you have any *NULL* values in your database? Because then you would have to append "AND value IS NOT NULL" to your query :). | |
Re: For as far as I can say now: I like the new looks. Only thing is that I find the topic overview pages too busy. I think it is because there are suddenly so many images and colors because all avatars are now shown. A bit too many colors, if … | |
Re: You can store the IP address of the user who is using the form and the time at which the form is submitted. When the form is then submitted again, you can check the time difference between now and the last time the form was submitted, and if that time … | |
Re: On a sidenote I would like to mention that I too have been messing around with my own AJAX scripts for quite some time, until I finally decided to give jQuery a try. It has a couple of AJAX functions built in, and they work like a charm, at least … | |
Re: Well if you need only one row, using the mysql extension you could do the following: <?php $query = 'SELECT something FROM table ORDER BY id DESC LIMIT 1'; $result = mysql_query($query) or die(mysql_error()); $fetch = mysql_fetch_assoc($result); // Contains only the first row, as we're not using it in a … | |
Re: Is it not easier to just let him on your computer for a couple of minutes while you're in class? :) Or aren't you in class? | |
Does anybody know of a reason why a custom font would not load directly when a web page is loaded? When I visit the main page of my website, it uses a standard font instead of the custom font I selected, but if I then go to another page, that … | |
Okay so I've been going through my HTML lately and I discovered that I was still using the <base> element to define my website's base path. I want to get rid of that - I would like to be able to use relative URLs all the time, without having to … | |
Re: This query: SELECT value FROM settings WHERE value = "Login Script" seems a bit odd to me. You are selecting the *value* field of records of which you already know what the *value* field contains (namely "Login Script"). It is something like saying: `SELECT "Login Script" AS value FROM settings … | |
Re: Well have you checked if the file of which the servers says it is missing is actually there? :) | |
Re: Could be that it's overheating, and if it is, you could (like caperjack said) try to clean the dust inside. You could also buy a laptop cooling platform (with vents in it) or put something underneath the back side of your laptop so that it is tilted a bit, so … | |
Re: You could check from which website the user is referred to a page? Check out $_SERVER['HTTP_REFERER']. You can also add CAPTCHA validation to your form, which should be different for every form that is submitted. You store the correct CAPTCHA answer in a session when the form page is loaded, … | |
![]() | Re: For as far as I know, executing a COUNT instead of count_num_rows is faster, performance wise. Your new query would look like [code]SELECT COUNT(a_unique_field_occuring_in_every_record_that_is_selected) AS num_rows, * FROM products ORDER BY dateadded DESC[/code] I'm not 100% sure if it is faster though, but with this query, you could use mysql_fetch_assoc … |
Re: Have you tried any MySQLi tutorials? Like: http://www.xphp.info/mysqli-tutorial/ or http://codular.com/php-mysqli ? | |
I am currently working on a project, and I had a name for it in mind. However, the .com domain with that name is already in use. What do you think I should do? Rename my project, or use a .net domain instead of a .com? The name would be: … | |
Re: Damn that is a whole lot of code man. Would you be so kind to specify the lines that you would like us to look at? ^^ By the way, on a side note, using $_REQUEST is considered unsafe/risky, as it may get defined by $_COOKIE, $_GET and $_POST values, … | |
Re: My question would be the same as jkon's, what's in $contentToSave? And maybe you could read a bit about [MySQL Injection](http://www.tizag.com/mysqlTutorial/mysql-php-sql-injection.php), because your script seems not to be as secure as you might think :). | |
Re: A couple of things: - [session_register()](http://php.net/manual/en/function.session-register.php) appears to be a deprecated function. You don't need to use it. Using only `$_SESSION['key'] = 'value';` will suffice if you run a PHP version from less than a long time ago ;). - Should you not start a session using [session_start()](http://php.net/manual/en/function.session-start.php) in the … | |
Re: You want to give the user an alert and then redirect him? Why not redirect him and then give him the alert? :) | |
Re: Well from a first look at it, it seems like your developer built this website for mozilla users only (but I'm not sure, haven't checked it thoroughly. Your website makes use of some CSS3 properties like border-radius and gradiests, at least I think they're CSS3 properties :p, but they're probably … | |
Re: In PHP (using mysql), fetching one result: <?php $q = "SELECT `download` FROM `images` WHERE `owner_un`='$owner' AND `url`='$url' LIMIT 1"; $rq = mysql_query($q); $fetch = mysql_fetch_assoc($rq); echo '<p>Result: ' . $fetch['download'] . '</p>'; Fetching all results: <?php $q = "SELECT `download` FROM `images` WHERE `owner_un`='$owner' AND `url`='$url' LIMIT 1"; $rq … | |
Re: You seem indeed to be using the output buffer while there is nothing you are buffering for output :). What an output buffer does is, shortly explained, this: Instead of writing your output to the screen, it buffers it. It allows you to set headers and do other stuff in … | |
Re: So are you getting an error or are you not getting an error? And if you are getting an error, what is the error you are getting? =) | |
Re: Your <form> element should have an "action" attribute that tells it which page to load and a "method" attribute to define what kind of request is being done. E.g. `<form action="do_action.php" method="post">` Then, on do_action.php, in this example, you should validate the user's input. If it is not valid, you … | |
![]() | Re: You are aware of the fact that you have for($i = 0;$i <= count($info);$i++) { which loops through the info of a user, not through the array of users, and that in your echo's you are trying to access a *user* using the counter of the user info loop instead … |
Re: More info on Javascript timing events can be found [here](http://www.w3schools.com/js/js_timing.asp). I guess you could use the setTimeout() function. E.g.: var timeout_time_in_seconds = 10; var timeout = setTimeOut(function() { //* Type here what needs to happen after the timer times out. }, (1000 * timeout_time_in_seconds)); | |
Re: > I require the text field should contains Alphabets in Upper and lower case, numbers, hyphen, fullstops forward and back slash and commas and spaces in it Try: $regex = '/[A-Za-z0-9\-\\,.]+/'; $is_valid = preg_match($regex, $address); // Becomes true or false. This does exactly what you ask. The following code is … ![]() | |
Re: Hmm well in plain html you can add a maxlength using the *maxlength* attribute. For example: `<input type="text" maxlength="128" ...>` But with the code you provided.. I don't know. You seem to be using a class named ItemForm? You should maybe take a look how that class generates <input> elements. | |
I'm writing a report about public transport, and I'm not English, so I was wondering if anyone could help me with this: what is the correct way to use "public transport" in English? For example: Group x uses public transport to get from A to B Using public transport comes … | |
Re: Well what it says is that you have not defined $id. $id is empty, and therefore you get an error and your script is not working. If you do not define $id in a way such as this: `$id = 'yourvalue';` Then it will be undefined and you will not … | |
Re: Could you post some code from where the insertion into the database happens? | |
Re: Are you sure that mail() doesn't send anything at all if one recipient's email is invalid? If so, you could maybe use a loop to send separate mails to every email address in an array? E.g.: $email_addresses = array( 'email1@email.com', 'email2@email.com', // etc. ); // Fill these in with whatever … | |
Re: Maybe you can open header.php separately and then edit it in the design view? :) | |
Re: If the code you posted is currently all on one the same page, it is logical why it isn't working at the moment: you cannot read your $_GET if it has not been set. That means that if your select is changed right now, it does not set your $_GET … | |
Re: So which fields are the matching fields? Suppose that you have two tables: persons (id, name) addresses (id, person_id, address) Each person can have one or multiple addresses, but each address is bound to only one person. Then you could execute the following query to select a person together with … | |
Re: If you are not allowed to use a SQL database, use a NoSQL database, your teacher won't be happy but you have done as he asked ;). Here's another method: <?php $file_containing_names = 'file.txt'; $file_contents = file_get_contents($file_containing_names); $name_to_search_for = 'annie'; $regex = '/' . $name_to_search_for . '/i'; if(preg_match($regex, $file_contents, $matches, … ![]() | |
Re: So that's the one and only file there is? What happens if you just type `<?php session_start(); ?>` in an empty PHP file and open that? Are you sure it's not your installation that's sending its own header? Are you using XAMPP or something else? | |
Re: Well I can think of at least two things that you could think about: 1. Instead of each <div> refreshing separately, why don't you create **one** file that retrieves all data that needs to be refreshed, and then use Javascript to place the retrieved data in the corresponding <div>s? 2. … | |
Re: Well, I don't know WOWSlider, but the simple and obvious answer to your question would be: check out WOWSlider's documentation and check Google. For if I were to have to search an answer for you now, I would have to do the same ;). But maybe there is someone else … ![]() | |
Re: Did you try: 1. var_dump()-ing your query statement? 2. var_dump()-ing the result object of your query? 3. var_dump()-ing all input to your query, to see if your query is actually executed the way you expect it to be? :) ![]() | |
Re: So does your "OR die(...)" function get triggered, or does it pass that? Maybe your query did not return any results? | |
Re: Then have you checked if there is something wrong with conn.php? Also make sure your error reporting is turned on. In the first line of your root script, put this line to do that: `error_reporting(E_ALL ^ E_NOTICE);` | |
Re: In PHP? Here's a short example. Page 1: <form action="page2.php" method="post"> <input type="checkbox" name="array_name[]" value="true"><br> <input type="checkbox" name="array_name[]" value="true"> <input type="submit"> </form> Page 2: <?php if($_POST['array_name'] && is_array($_POST['array_name']) { // Loop through checked checkboxes. $checked_checkboxes = array(); foreach($_POST['array_name'] as $key => $value) { $checked_checkboxes[$key]; } } else { // Nothing … | |
Re: Well this is some weird shit indeed, there does not seem to be anything wrong with your code. Have you tried echo-ing $limit? E.g.: `echo $limit;` And see what it is? Is it really -5,5? If yes, you could try echo-ing $pn each time its value changes, to see where … | |
Re: Pfew, I'm no expert on working with csv files, but I'd say try: if (($handle = fopen("../uploads/KZNCal.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { $Cal[] = $data; } fclose($data); } // Check if $Cal is what you need it to be: echo '<pre>'; print_r($Cal); … | |
Re: See here: http://php.net/manual/en/function.str-getcsv.php That should speak for itself :). | |
Re: For starts I see at line 14: `$('.messages:last-child')` But in your HTML I don't see anything with a classname of "messages". Should that dot not be a hashtag? In line 14? From a second look at it I would suspect that the error lies in your PHP file. Does it … |
The End.