708 Posted Topics
Re: You should post this in javascript forum. Anyway, you can't use 'this' in dynamically. The only way I have found that works is if you attach an event and use the target part of the trigger event to get the value you are wanting. | |
Re: Once its deleted it won't be used again (unless you truncate the table). MySQL will not reassign the ids, as it would defeat the purpose of using them. Once you set an id, it should never change. | |
Re: [QUOTE=ENetArch;1003275]All, Does anyone know if there is a package available to allow PHP programmers to store their PHP Objects / Instances into mySQL, and still allow them to be searchable? ie .. not serialized? Looking forward to your responses, E,[/QUOTE] I don't think so. You have to use serialize to … | |
Re: I use list and explode. [code] list( ,,$value ) = explode( ',','one,two,three,four' ); echo $value; //returns three [/code] | |
Re: Its not great. It just uses a lot of regular expressions and replaces text with php code, writes it to a new file, and executes it. Not very creative, but works. | |
Re: You most likely had a problem with the file being encoded in UTF-8.  is usually the sign of this. For some reason there is a special character that sometimes is put at the beginning of the file. | |
Re: You access class variables with [icode]$this->var_name[/icode] This is whats causing the error: [code] public function connect($host = $HOST, $user = $USER = "root", $passwd = $PASS, $db = $DATABASE ){ [/code] should be: [code] public function connect($host = $this->HOST, $user = $this->USER = "root", $passwd = $this->PASS, $db = $this->DATABASE … | |
Re: On this line: [code] $backupFileName = "Desktop/toy-`date +%d-%m-%Y-%H:%M:%S`.sql"; [/code] You probably are going to need the absolute path to where the file needs to be stored. | |
Re: Don't use * anywhere. Define the columns you need for every query. It will help with performance a little. On your query to get the number of rows for pagination, you are selecting all the data for no reason. Use count(*) it will return a record immediately because mysql caches … | |
Re: [QUOTE=cwarn23;982480]Well I would recommend an advanced system of ajax for best confirmation but if you want to keep it simple the following script will do the job. [CODE=php]$v=get_browser(null,true); $javascript=$v['javascript']; unset($v); if ($javascript) { echo 'Javascript is enabled'; } else { echo 'Javascript is disabled'; }[/CODE][/QUOTE] [icode]get_browser()[/icode] only returns if the … | |
Re: This is how I would do it: [code] $lower = true; //if you want lowercase letters $t = 4; $s = 1; while( $s <= $t ) { $i = ( $lower ? 97 : 65 ); while( $i <= ( $lower ? 122 : 90 ) ) { echo … | |
Re: I wouldn't do that. It would be slower than fetching a few records from a database. ![]() | |
Got bored and made a function that handles filling strings similar to mysqli bind_param. It actually gets used a lot in my code. Figured someone else might find it useful. Example usage: Using question marks as place holders [code] $str = 'Hello, my daniweb user name is ? and my … | |
Re: [QUOTE=cwarn23;983269]Even better yet, use javascript to encrypt the passwords before sending it over $_POST. This way if the post data is hacked the data is still encrypted. This sort of hack attack can happen when a hacker attaches a device to a fiberoptic cable to scan data running past. Also … | |
Re: This: [code] $total = count($children); [/code] should be: [code] $total = count($children) - 1; [/code] | |
Re: So pretty much you are storing the image data in the database, right? You have never stated this clearly enough that we understood what you are trying to do. ![]() | |
Re: You are just setting the value to a variable. You should do something like this: [code] foreach( $_GET as $key => $val ) { $_GET[$key] = htmlentities( $val ); } [/code] | |
Re: Your query would look like this: [code=sql] UPDATE `table` SET `trackdate` = `trackdate` + 1 [/code] | |
Re: Don't use phpbb. Its not very secure. Look into mybb instead. It is better. | |
Re: I doubt that a null value in the database is the same a null in php. Most likely its returning as a string which can be checked like this: [code] if ( $row['log_check'] == 'NULL' ) { [/code] | |
Re: Can you explain your system better? Honestly, I don't see why you need to unset something in the _REQUEST array. There is probably a different way to go about what you are trying to do. | |
Re: This really has nothing to do with OOP particularly, mostly it has to do with your setup. The way I would do it to minimize queries would be to select all data with users that have that guild id. Then I would pass the user data into the person class … | |
Re: Sorry to say, but the code you have won't work no matter what you do. PHP is a server-side language and can't interact with client-side easily. You will need to use the _GET method. You define the file you want in the url and then php can read it from … | |
Re: Line 9: [code] echo "no"; [/code] is the problem. You can't echo anything to the browser until after headers are sent. | |
Re: This line: [code] $fiction_articles = mysql_fetch_assoc($mysql_result1); [/code] is your problem. mysql_fetch_assoc() only returns 1 row. | |
Re: You need to use a template class that will allow for repeatable template sections. That is the proper way to seperate php and html. | |
Re: You can do: [code] $array = array_filter( explode( '\_1',$charstring ) ); $data = array(); foreach( $array as $part ) { list( $key,$val ) = explode( '=',$part ); $data[$key] = $val; } //edit skill here using $data['SKILL'] = 'something.....'; $array = array(); foreach( $data as $key => $val ) { $array[] … | |
Re: Since you are not using a database, where is your data coming from? | |
Re: You could have a php page on their server request information from a php page on your server with a unique key only assigned to one site. Not sure if thats what you mean. | |
Re: Use google and search for bbcode classes. | |
Re: Just wondering, why are you writing 10000 lines into a file? | |
Re: Good idea, but in practice I fear that it will be very difficult to make and have it work properly. Why not just create a bot that uses premade solutions that can be trusted. It can analyze the words in the question (kind of like what you have) and post … | |
Re: The easiest way I know is to install the files into the directory where extensions are suppose to be and add the extension to the php.ini file. Worked for my install on a Kubuntu box. | |
Re: You aren't understanding how an activation script works. As of right now yours makes no sense. The values you are passing via get are not even being used in your queries. The point of an activation script is to send a unique random number that is hard to guess (md5 … | |
Re: change MYSQL_NUM to MYSQL_ASSOC. you are trying to use the names of the fields to get their respective values and its not working because you are getting a numeric array. in the if statement at the end, change the greater than to less than. | |
Re: [code] RewriteEngine on # Forces a trailing slash to be added RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ //this line I don't know about. You might just want to check if a . exists as it would be easier. This is what the Internal Server error is from … | |
Re: There is a free thumbshot service created by one of the daniweb members. [url]http://happythumbs.samrudge.co.uk[/url] EDIT: I guess the site is down. Nevermind. | |
Re: Thats not sql injection. It's called xss. You need to run the data through the php function htmlentities(). | |
Re: You can't have anything echoed to the page before the setcookie call, not even a newline. How hard is it to read the manual? It has the answer to pretty much every question. [url]http://us3.php.net/setcookie[/url] (notice how the description has your answer, it would of taken a minute to find the … | |
Re: You are running mysql_fetch_array only once, which means the code will only be run for one row. Is this what you are wanting? I see that you have queries that update multiple rows based on the value of the first row returned. I am not sure of how the data … | |
Re: What are you using to generate the forms? Just a guess here, but by looking at the formatting you could probably do: [code] $form['submit'] = array('#type' => 'image', '#src'=>'sites/all/themes/MathsLeaderTheme/images/submit_up.gif' ); [/code] | |
Re: <?=...?> is short-hand syntax for echoing data to a page. I personally don't use it, but its pretty common. | |
Re: Please search for information before posting. [url=http://www.google.com/#hl=en&source=hp&q=mysql+vs+mysqli+php&aq=f&aqi=&fp=c9fe100d9e542c1e]Google it first[/url] All the info you need to answer your question can be found via that link. | |
Re: Look at this again: [code] content="' .$meta_keywords' . "> [/code] You should see the error. | |
Re: If you have any classes, functions, ect. you need to move them behind the document root (same folder as public_html on most hosts). Then you just included them. You need to add a php.ini file and protect it with .htaccess. This means you put your php configurations in the php.ini … | |
Re: Don't use .htaccess to configure php. Thats what a php.ini file is for. That error looks to because by a mysql connection. Check your database credentials. magic_quotes_gpc should be off. | |
Re: You didn't escape the " characters. Example: [code] $property_link = "<a href="listingstest.php?category=property">Property</a>"; [/code] should be [code] $property_link = "<a href=\"listingstest.php?category=property\">Property</a>"; [/code] |
The End.