- PC Specs
- It's great
29 Posted Topics
Re: When using passwords, make sure you encrypt it. Saving raw passwords is not only bad practice, it's wrong. An extra security measure would be to encrypt the password before sending it VIA POST. This is easily done by using javascript, you never want to submit the raw password. Just some … | |
I have no issues with setting up the mod_rewrite and having it create the clean URLs. My question is for more experienced htaccess users and I am wondering if there is a simple solution to my dilemma. My URLs without the cleanup look like: index.php?ctrl=portal&mode=main or index.php?ctrl=portal&mode=edit&id=2 I want my … | |
Re: That's debatable. I use foreach on $_POST/$_GET but i use a white list to prevent injection. clever works as long as you cover all angles. Saying, "Clever may be fun but it's usually not the correct solution." is just plain wrong. Usually clever works, sometimes it can backfire. The foreach … | |
Re: There is no copyright infringement on iframes. As long as you are not stating that the content is yours there is nothing they can legally do. | |
Re: No SQL injection prevention; not a smart idea. Someone could delete your entire database. PHP should be using single quotes instead of double quotes, but that's just me being picky. HTML is a little sloppy and it seems that CSS would be able to fix your spacing issues. You major … | |
Re: Are you sure that $result has a value at this point? Do you have any checks to ensure that $result is defined and has a value? I normally only get this error when the variable being passes is NULL | |
Re: PravinBhat is correct, try removing the parenthesis. Other issues you may want to address when you get this working: When using a variable in a function you don't need to include the "". See below for changes [code=php]$con=mysql_connect($host, $username, $password); mysql_select_db($db_name, $con);[/code] Use single quotes over double unless you need … | |
Re: Replace this: [code=php] $sql_res=mysql_query("$sql_query"); $row=mysql_fetch_row($sql_res); [/code] With this: [code=php] $sql_res=mysql_query($sql_query); if (!$sql_res) { echo 'Could not run query: ' . mysql_error(); exit; } $row=mysql_fetch_row($sql_res); [/code] The die method(above post) could be used instead of the if statement, its a matter of personal preference, tho the die may be milliseconds faster … | |
| |
Re: I have a few suggestions if you don't mind. I have just written a script a lot like this (if you want to see an example pm me, since my employers site). To make it easier to insert, i set the field names as a array with the id as … | |
Re: for a debugger i would suggest using the zend debugger. In my opinion, it is one of the best debuggers out there. Setting up the debugger is easy. I am not sure how to integrate it into the IDE you are using tho. I use zend IDE so it works … | |
Re: By reading the first post. The code below should work and meet the criteria asked in the first post. There are some checks in play that will not allow an empty email to send, also if an empty ID is passed the script will just step over it. Also the … | |
Re: Another way to achieve the same effect without using CSS is to do item.style.display = 'none'; // Hides or item.style.display = ''; // Shows you can get the collapse effect with jquery or any other library for that matter. That would be the easiest. To get the effect so it … | |
Re: I already wrote something like this. [code=js] function moveText(text, dispField, defaultText) { if (text.length < 2) { text = defaultText; } document.getElementById(dispField).innerHTML = text; } [/code] usage: [code=html] <input type="text" name="fname" id="fname" onkeyup="moveText(this.value, 'result', 'First Name')" onblur="moveText(this.value, 'result', 'First Name')" /> [/code] the 'result' is the ide of the div … | |
Re: Yes, it is possible. If i was to do this I would use AJAX. It can do exactly what you want. | |
Re: Every time you call the function you are resetting i. put i outside of the function to keep the value and have in increment. try this: [code=js] var i = 3900; function hit( f ) { f.vaule = i; } [/code] | |
Re: There are a few different ways you can approach this. You can still use your original concept, when validating the data for display, if the close value is less than the open, then obviously it is the next day. That seems to be the easiest, as long as the data … | |
Re: Using phpmailer is an opinion not a solution. The first step is to identify the issue. Take the $headers out of the mail function and test the script again. Does it work? If so, your headers need to be correct. These headers will work for plain text, no attachement. Don't … | |
Re: It is called a carriage return. You can check out google for the full description. In a nutshell, it is the return/enter key. For the script it seems useless. a <br /> would be more beneficial. I use the \n when I build HTML in my PHP code and I … | |
Re: Looking at your script. There are a few minor edits to prevent some php warning and errors. First, $header starts off as [code=php]$header .= "From: $naam <$mailadres>\r\n";[/code] try changing it to [code=php]$header = "From: $naam <$mailadres>\r\n";[/code] I am not seeing how the script fetches the variabels for the email. I … | |
Re: Because the example at w3schools is transitional, not strict. All form elements should be used in container tags. w3schools show examples, these are meant to help get you started but they are not the best when used straight from their site, at least not with strict. If you used transitional … | |
Re: Umm... This is already posted here... [url]http://www.daniweb.com/forums/thread207428.html[/url] | |
Re: Since you are new to PHP you should get into good practices now. NEVER use " unless you are using a variable. Use ' instead. On small files this isn't so important but on heavy servers or heavy scripts that can save you a lot of page load time. As … ![]() | |
Re: For? email? forum post? private messages? Form submissions? Needs some more info to help. | |
Re: Have you tries using htmlspecialchars(); when displaying? Not sure if it's the best way but it works. Or you can use the HTML purifier which can fix these issues but thats a little heavy. | |
Re: To be honest I skimmed your php files. If you don't mind could you use the PHP code tag. Makes reading them much easier. In my opinion I think you are over complicating this. I have done the same concept off of 1 database class i wrote. Mind you, yours … | |
Re: If you don't mind, is the purpose of this for debugging? If so this is not something you should even get into. It's wrong, dirty, and unprofessional. If not then just ignore this post tho reading below won't hurt ;) You should use a debugger. I prefer the zend debugger. … | |
Re: This is simple. After the db has been successfully updated run a simple mail command. In you code, where you submit the data to the database, add this below the success check. [code=php] $msg = 'blah blah blah'; mail('your@email.com', 'New user registration', $msg); [/code] This should send a plain text … | |
Re: Try this instead. This should save you some headaches later down the road as well as save your error log. textareas are suppose to have cols and rows set to properly validate. isset will make sure not to load the var if it isn't set, thus saving your error log … |
The End.