492 Posted Topics
Re: More info is needed for an accurate response, speaking generically, you need a database, which will store a username, user ID and a password at minimum (A user ID isn't actually essential, but indexing a text field takes more time than indexing an integer field) Further than that, depends entirely … | |
Re: What is the actual error you are getting? | |
Re: Are you using 'bbcode' or something similar to allow the users to add their messages? This would be one of the simplest ways to do it. My example here uses 'bbcode', the PHP for quotes is this: <?php function bbcode($Text) { // Check for Quotes $numquotes=substr_count($Text, "[quote="); for ($i = … | |
Re: Are you asking how to check for only numbers in a string? if so is_numeric would do this: [code=php] if (is_numeric($password)) { echo "Password is numeric"; } else { echo "Password is not numeric"; } [/code] Or for alpha-numeric strings: [code=php] if (preg_match('/^[A-Za-z0-9]+$/', $password)) { // Do something } [/code] | |
Re: [QUOTE=mschroeder;813341]On the basis of an 8 character password, where each letter can be 1 of 62 possibilities (a-zA-Z0-9) that is 9.807971461541689e+55 possibilities.[/QUOTE] Or 62^8, or 218,340,105,584,896 possibilities... [QUOTE=samarudge;813558]i was able to get 650 attempts per second with my laptop alone and I have 5 exactly the same[/QUOTE] Ok, 5 of … | |
Re: This may not be the best way to do it, but it should work [code=php] $thisYear = date('Y'); $nextYear = $thisYear + 1 $nowdate = $thisYear "-" $nextYear; [/code] I really need to go to sleep :D | |
Re: Number 5 had me laughing for a minute there :D | |
Re: PHP would not be the best way to do this, not only due to the fact that page load times need to be taken into consideration (as already mentioned) but also because alot of the typing speed tests also take into account accuracy of the words typed. The code by … | |
Re: Served with a side of fried bread and beans that could be the tastiest (and possibly unhealthiest) breakfast ever:$ Probably not good on a daily basis, but all that grease should clear out your insides in a matter of hours :P | |
Re: Ideas/Suggestions: 1. Read up on XML 2. Read up on PHP (especially Multidimensional and associative Arrays - they will help no end on this sort of project) 3. Look at other peoples (open source) work for ideas 4. Design 5. Find flaws in design 6. Start coding 7. Ask Daniweb … | |
Wasn't sure what to put as the title, but what is happening is this: I have div elements on a HTML page, when they click on the div it is replaced with a textarea containing the div contents in order to edit this (eventually there will be a form/submission button … | |
Re: :) It'll be a long time before this happens, they'll find some story the credit crunch to further depress people if nothing else :( Good find (even if it is fake :D) | |
Re: The lines you want to change are [icode]opendir(".")[/icode], this tells it to look in the current directory (where the script is located) May be worth adding a variable for directory at the top with the attributes and replacing the "." with it, there are 2 instances of opendir, so replace … | |
Re: Post the lines around line 101, it may be one of the preceding lines causing this problem. | |
Re: I believe [code=php] // if your email succesfully if($sentmail){ echo "Your Confirmation link Has Been Sent To Your Email Address."; } else { echo "Cannot send Confirmation link to your e-mail address"; } [/code] should come after [code=php]$sentmail=mail("$email",'Registration Conformation',"$message"); [/code]. At the moment, you are using the mail() and then … | |
Re: If you decide to do that you will need to use Session/Cookie/POST data to tell the server what the product is, as you have have 2 or more products with the same name - this will cause issues if you just have the product name. Send the product id as … | |
Re: We cannot see your PHP code, so there is no possible way we can tell you what is wrong, please post up some code so that we can look at it. | |
Re: What error is returned? Add [icode]or die(mysql_error());[/icode] to the closing bracket of the query as so: [code=php] mysql_query("....")or die(mysql_error());[/code] | |
Re: Something along the lines of: [code=php] $check_name = mysql_query("SELECT `username` FROM `users` WHERE `username` = '$requested_name'"); if (mysql_num_rows($check_name) != 0) { // Error, username taken } [/code] Do not rely on Javascript for validation, build your code assuming your users have Javascript disabled, you can always add things like alerts … | |
Re: That and explode is supposed to execute faster due to the lack of regex, although for what the OP wants, I doubt it will make much difference which is used. | |
Re: The first line you posted will run the query, so the if statement will always return false as the row is already deleted, change [code=php]$sql1 = mysql_query("DELETE FROM spider WHERE url='$addtolist'");[/code] to [code=php]$sql1 = "DELETE FROM spider WHERE url='$addtolist'";[/code] | |
Re: !Unreal's suggestion is best, you haven't said [I]what[/I] you want in index.php, you haven't said [I]what[/I] the table structure is... You aren't giving us anything to work with. Once you have a file, post here asking questions if it doesn't work, but we aren't here to do your homework for … | |
Re: Announcements are in the forums for a reason..... [url]http://www.daniweb.com/forums/announcement6-20.html[/url] | |
Re: Whats with the lack of quotes on there? Try this: [code=php] $strSaveTD = "<input type=\"button\" id=\"btnSave\" value=\"Save\" onclick=\"checkform($iMode, $iLevel, 1)\">"; [/code] As long as you escape the quotes it will work, the above will print the code as you would expect it to be in HTML (without the backslashes) | |
Re: Try [code=php] mysql_query("INSERT INTO `list` (`title`, `url`, `description`) VALUES ('$title', '$addtolist', '$description')"); mysql_query("DELETE FROM `spider` WHERE url='$addtolist'"); [/code] | |
Re: The code posted by ShawnCplus would show the image and scale it down to 32x32. Do you get the image path from the database? or are you storing the image itself in the database? I am not sure exactly what you are asking, but I see no reason why the … | |
Re: Your title tag should be within the head of the document ;) Rather than re-inventing the wheel, you may want to look at [www.smarty.net]Smarty[/url], it does everything you are looking for, you can get an array of data and have it auto output as a table - if you understand … | |
Re: Whats with the [code=php] session_start(); ?> <?php if[/code] You dont need the ?> and <?php there, it is likely that the line break after the ?> is causing the issue, remove the closing and opening tags altogether. Also, you will want to look at your query, never put POST values … | |
Re: If you are having issues with installation, post on the phpBB boards directly, probably get a faster response. | |
Re: The MySQL query would look something like this, also basic starting point: [code=php] // Basic query to find a relationship $result = mysql_query("SELECT `status` FROM `relationships` WHERE `friend1` = '$user_id' AND `friend2` = '$friend_user_id' OR `friend1` = '$friend_user_id' AND `friend2` = '$user_id'")or die("Cannot select relationship, error:".mysql_error()) if(mysql_num_rows($result) != 1) { … | |
Re: Think of it as a duplicate table to the forums, its similar - just a few changes: Heres a very basic table: message_id: int(10), auto_increment, primary - Message ID message_from: int(10) - ID number of the user the message is from message_to: int(10) - ID of the user the message … | |
Re: Since this would probably be against Adsense Policies, I doubt you will get any help. [QUOTE=Adsense Policies]Encouraging clicks In order to ensure a good experience for users and advertisers, publishers may not request that users click the ads on their sites or rely on deceptive implementation methods to obtain clicks. … | |
Re: Looks like you are trying to use PHP as a client-side script, not possible. You will need to add Javascript or buttons to new pages to reload the questions as PHP is server-side and is compiled to HTML before being sent to the client. | |
Re: Surely[code=php]$j = $rows+1;[/code] should be [code=php]$j = $count+1;[/code] | |
Re: Not sure exactly what you are asking, but in PHP redirection can be done as follows: [code=php] <?php header("Location:http://www.somesite.com"); ?> [/code] and Meta: [code] <meta http-equiv="refresh" content="5; url=http://www.somesite.com">[/code]this goes in the <head> tag | |
Re: Have you tried sending to another email address? I assume you are using the standard mail() function. Also, check the host has RDNS correctly configured for the IP address(es) of the server. | |
Re: Make another column in the database and store a timestamp in it when the user logs in (much better than a formatted date anyway) and then work out this time yesterday [code=php]<?php // Find out the timestamp for yesterday $yesterday = time()-86400; if($timestamp_from_db >= $yesterday) { // User logged in … | |
Re: This will really depend on whether you can restrict what the user enters into the textarea. You need to decide where you will expect a new item (newline, comma-seperated, space seperated...) and then make sure the user follows the system, but people are known for not reading instructions. Anyway, the … | |
Re: First it looks like you just lifted the javascript function from the website you quoted. You have not defined a function called trailOn() or hidetrail(). There alot of scripts online you can download for free which will do what you are looking for, infact I have found a fair number … | |
Re: As above, please use code tags and running the same query twice is pointless. A few tips: Do not trust your users, always check their input. Never use POST values directly in the database query, thats just asking for problems - look into mysql_real_escape_string() for starters. There is a handy … | |
Re: Seeing as you have the username already in a session [icode] $_SESSION['MM_Username'] = $loginUsername;[/icode], why not just use this in the query? | |
Re: You should always check the data just before it is entered into the SQL query, especially with POST and REQUEST values, so it is not a bad idea to check this twice (even though you are using sessions). It may also be a good idea to restrict the characters in … | |
Re: You can use regex in sql queries, although with what you are trying to do it may be simpler to keep this in PHP.. See this for regex in mysql: [url]http://dev.mysql.com/doc/refman/5.1/en/regexp.html[/url] ![]() | |
Re: I use NuSphere PhpED, one of the best programs I have ever used. Also, shouldn't the title be 'editor' not 'software' :) | |
Re: I really can't be bothered to read your code fully if you can't be bothered to use [code] tags. (It does have a 'watermark' in the post boxes which tell you about the code tags) But a quick glance shows this on your last lines: [code=php]?<? include "layout/header.php" ?>[/code] Whats … ![]() | |
| |
Re: Try using an array: [code=php] foreach( $raw as $key ){ $final[] = $key; } [/code] This will put each result into the array. | |
Re: [QUOTE]When it goes to the transaction, the shopping cart has to be cleared so that when another user enters the website, the shopping cart will be empty for that user.[/QUOTE] This does not look like a good idea, if I am understanding you then it would mean that everyone on … | |
Re: If you were using the full MD5 hash then there would be a small chance for repition, however since you are only using the first 6 characters, this chance is greater. You must the uniqe product ID be in the format you suggest? Would it not make more sense to … |
The End.