492 Posted Topics
Re: You will need another table for users, and in that table you will need a column for their permission level. Then in your PHP script, check the users permission from the DB, and only give them the options they are allowed to use. | |
Re: To set the value of the textbox, use .value, not .innerHTML | |
Re: Try using like instead of = in the query. [code] $result = mysql_query("SELECT * FROM `some_table` WHERE `some_column` like '%some_value%'"); [/code] I was beaten by the post above :), that suggestion takes into account the commas too. My suggestion will match anything with that number in, so if $test was … | |
Re: [QUOTE=tearose49;1171685].I think it's not connecting to the database, as we added a couple echo statements that should tell me if if got to the db, then to the table. It doesn't print them, so I guess that's the first problem.[/QUOTE] Would you mind posting said code here for review? We … | |
Re: Disable the ads? No ads here and the site loads in a decent time, not quite instant but it doesn't have a noticeable delay either :) | |
Re: In XHTML 1.0, you cannot use a table tag within a p tag. When using p, any other block-level element will effectively close the p. Does it work if you remove the paragraph tag? | |
Re: Your syntax is incorrect. Try this: [code] if (mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); while ($row = mysql_fetch_assoc($result)) { print_r($row); } } [/code] | |
![]() | Re: Make sure you have PHP installed from [url]www.php.net[/url] otherwise the server will treat the php file as any other unknown file and ask to download it. ![]() |
| |
| |
Re: Almost right., the -4 needs to be -1 though. A positive number will start from beginning of the string and return the number of characters specified, while a negative number to start from end of string. In this case, you want to start with the last character(-1) and read 4 … | |
Re: From the jQuery site: [code] $.post("test.php", { name: "John", time: "2pm" }, function(data){ process(data); }, "xml"); [/code] Try wrapping your if statement in a function, then calling this function and passing 'data' to it within the success function in the .post: [code] $.post(script_location, {data : some_value}, function (data) { my_function(data); … | |
I was thinking about the DaniWeb badge earlier, and the possibility of putting it onto my site, but it really doesn't fit in with my sites colour scheme :( I would like to suggest customisation options for the current purple background. You are already generating the image from post counts … | |
Re: [QUOTE=virspy;1164332]I require a crawler in php[/QUOTE] How nice, what do you want us to do? Make it for you? I very much doubt that will happen. Show us the script you have now and we can suggest improvements or changes. Other than people who want an ego boost, you won't … | |
Re: May help to post some more of your code. But I assume you are running an empty() check on the POST vars? From the PHP manual: [CODE] Returns FALSE if var has a non-empty and non-zero value. The following things are considered to be empty: * "" (an empty string) … | |
Re: What is going on with these lines? [CODE] z-index:3; then >?php info ?>[/CODE] Doesn't really look right. You have not closed the [icode]<style type="text/css">[/icode] or [icode]<!--[/icode], you are missing a } to indicate that you have finished the styles for #footer and PHP is opened with [icode]<?php[/icode] not [icode]>?php[/icode] I … | |
Re: This cannot be done in PHP, you will need to edit a htaccess file and use RewriteRules in there. | |
Re: [QUOTE=Ancient Dragon;1155178]I certainly hope it is NOT Charles's wife -- she is such an ugly (female dog). There was a picture of William's girl in the tabloid and she is a very good looking woman, one that might be worthy to be Queen.[/QUOTE] It is pretty much a given that … ![]() | |
Re: That's what we are here for :P :D Don't forget to mark as solved. | |
Re: Please tell me that was intended as a joke.... I can see some poor student coming across it and taking it to hand in as part of an essay :P Would serve them right, mind :D | |
Re: You should do as other people have suggested and take pride in your work. Personally, if what I produce matches what the client has asked for then it was a good job and I am happy. Never mind that the client is always changing what they want and that they … | |
Re: Perhaps read the sticky in the forum? [url]http://www.daniweb.com/forums/thread191031.html[/url] And try to use code tags. | |
Re: You do not have a function called 'write_log' within the class in the above script. If the function 'write_log' is defined outside the class, you cannot reference it as you are trying as it is not registered in the class. Take a look at [URL="http://www.pixel2life.com/forums/index.php?showtopic=24205"]this[/URL] Also, use code tags. | |
Re: I am also fairly happy with my PC: Dual boot - Novell openSuSe 11.2 x64 / Windows 7 Ultimate x64. Processor - AMD Phenom X4 9650 RAM - 8 GB DDR2-1066. Hard Drive - 2 x 750 GB SATAII (RAID0). Optical Storage - Blu-Ray reader & DVD Combi. Graphics - … | |
Re: The [icode]BrowserDetect.browser[/icode] and [icode]BrowserDetect.version[/icode] are what you are looking for, these will tell you the name and version number that the browser is reporting. | |
Hi All. I think this is the right place for this post. Finally got around to connecting the HDMI cable between my PC and Monitor today, about time I got rid of the VGA. When reading the below, bear in mind that on VGA, there were 0 problems at 1440*900) … | |
Re: [QUOTE=apegram;1154726]For $45 you can avoid that ad for a whole year![/QUOTE] Or $25 for 6 months :P I would say that paying is better than ABP or NoScript. Makes you feel good :D Unlike ABP which makes me feel like I am stealing... | |
Re: Use relative values such as % for width and height rather than fixed pixel values. | |
Re: There are many scripts available online which will do what you are looking for.. You would need to look into security and many other areas to get this working correctly, it would be easier to use a pre-made script. | |
Re: You probably have either deleted or altered your .htaccess file. You can disable directory/file listing and specify the DirectoryIndex globally in the /conf/httpd.conf file to prevent this. | |
Re: You are using classes, but you do not include the class files... you call [icode]$objDB[/icode] and [icode]$objStatement[/icode] but at no point in the code above do I see these being declared. If someone came across this script and tried to use it, they will not have much success. | |
Re: darkagn is correct, looks like you are missing multiple commas in the values of the query. Also, may I suggest that you sanitize the input from the form.. Entering unchecked POST data into your database is asking for trouble. ![]() | |
Re: [QUOTE=ardav;1155839]You want to post that again with code tags?[/QUOTE] Might also help if he tells us what the problem is... 'Cant connect and retrieve from database' is not very specific. Post the error message you are getting, and what you have tried to resolve it. | |
Re: Possibly the most useless idea since the pizza fork ([url]http://www.kitchencontraptions.com/archives/004593.php[/url])... What happened to wallboards displaying the latest trains and clocks hung around platforms... | |
Re: What urtivedi said, although I prefer print_r() as this is much easier to look at and read (IMO) Also, you check the ID is numeric which is a start, but you also need to sanitize all of the POST data before entering it into the database, if someone entered an … | |
Re: You can check the User Agent using the $_SERVER super global. If the User Agent is that of a mobile device, display alternate content. Quite easy to do in PHP. | |
Re: The first thing I posted was a response to someones question: [URL="http://www.daniweb.com/forums/thread122400.html#post599350"]This post![/URL] My first question was almost a month after joining [URL="http://www.daniweb.com/forums/thread127208.html"]here[/URL], but that never got a response :D | |
| |
Re: Is the '$_SESSION['permissions']' value set? Change your query to this: [code] $result = mysql_query($query,$con)or die("Error: " . mysql_error()); [/code] Does it output any errors with that in place? | |
![]() | Re: Instead of putting a password hash in the URL (Not a very good idea) why not generate a random string when the user is created and just put this (and possibly the username) in the URL. Then, check that the string in the URL matches the one in the database … ![]() |
Re: Well, these messages are obviously not so secret anymore... But, IMO promotion of any single religion by any government is not right. | |
Re: Your write function has a name which looks familiar. Try not to use names of actual JavaScript functions. What is happening is that you are saying: [code] onclick="write(document.getElementById('words').getAttribute('value'));" > [/code] Which is doing the same as if you have put: [code] onclick="document.write(document.getElementById('words').getAttribute('value'));" > [/code] See the problem? | |
Re: Take a look at the onmouseup and onchange attributes for the input fields. Also look at regex (regular expressions) to check the field contents for only numbers. | |
Re: I use the same password for everything (nearly everything anyway) it contains part of the WPA2 key for my router, part of the phone number at my previous address and part of my name :P It is not a dictionary word, is 16 characters long has a mix of alphanumeric … | |
Re: [URL="http://lmgtfy.com/?q=php+calendar+database"]Try searching?[/URL] | |
Re: What code are you using at the moment and what errors (if any) does it return? | |
Re: [url=http://lmgtfy.com/?q=ubuntu+open+source+php+editor]Google is your friend[/url], there are a multitude of editors available, people will have preferences. Just because someone likes an editor does not mean you will. | |
Re: You should be using $result in the mysql_fetch_array() function, not $sql as this expects to receive the result of an SQL query. | |
Re: mysql_real_escape_string() will escape data for database entry. But you don't tell us what you are doing already, show code examples or really give us any idea of what you have done so far, but I assume this will work. |
The End.