premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
I think...if I am not mistaken that SHA1 is a 1 way hash. So no, not unless you had it setup as an encryption with a key to decrypt it.
-
Any language would require something like that if you do not want them to mess up, ASP, PHP, Perl(CGI). HTML is probably the only one that wouldn't, however, HTML would still need image paths updated. That and HTML really is not a programming language more of a Hyper Text Markup Language
-
Problems with chars: ' and " (single and double quotes)
premiso replied to Mr.n's topic in PHP Coding Help
Magic Quotes Turn them off in your php.ini file and you will be gravy. EDIT: Once they are turned off, if DB entry, use mysql_real_escape_string on data you want secured to be entered into the DB. -
@CV, very valid point. In my opinion, if they want to digitize text and the ocr cannot read the print, they are better off having a monkey in a cubicle and have him randomly push buttons. Using this, as pointed out, you can enter anything. So what is the point of having that report back with what the word is. Especially since I bet 85% of all internet users can no longer spell due to spell check. At least that is my opinion on reCaptcha. Go Monkeys!
-
Then it is basically a hard deal to do. Without changing to do Subversion control, or a development server. The folder idea may work, but you have the issue that if that file uses paths etc they have to be updated before put onto production. So unless they are willing to learn Subversion Control, or buck up the money for a dev server there is nothing you can do.
-
Mmm, thats a pitty. I do not use IIS, I tested your script on my apache server and it worked like a champ....but I was using a 284x156 button1.png image, whether that has something to do with it I do not know.
-
Not with 60mbps Fiber Optic, or a local network. But that also depends on, if non-network, the speeds his server allows The other issue though is browsers tend to timeout after 2-5 minutes of no data being received, which will prematurely kill your script.
-
You would have to either put it in a DIR and re-do all your static links/variables or register another domain and create a development site. Or just tell him to install WampServer 2.0 on his box, copy all the data and work off of that. He just has to be wary that differences in PHP versions can effect the files and to backup and production files before committing.
-
Sounds like you got some other issues, maybe with Apache....I do not know why it would show the url inside the page... ??? Anyhow did you checkout the phpinfo?
-
Do a phpinfo I bet you that PNG Support is not enabled. And as far as my statement, sorry to implicate that, but you linking to it saying "It only displays this" sounded to me like you expect us to be able to click on it and see what you mean.
-
Note, localhost is local to your computer. We cannot see that. Copy what it displays, make sure you have the GD library installed. If it is an image that is displaying on the localhost take a screenshot and post it here.
-
echo $_SERVER['REMOTE_ADDR']; Will be the correct way to get a user's IP address.
-
I was the same way when I was shown the light. Glad you could learn something new
-
To do a cleaner version without the fopen junk, I prefer this method: $YourFile = "sql.txt"; $Data = file($YourFile); // if it gives you a sql error uncomment this line: // array_pop($Data); #remove the last common. $values = implode("' , '", $Data); #run query mysql_query('INSERT INTO table (columnName) VALUES ('.$values . ')'); At least I think that's a bit cleaner
-
Insert different arrays into a MySQL table
premiso replied to Arsenelupin's topic in PHP Coding Help
Ummm, then you take the same logic I gave you and use it: $acheckbox=$_POST["acheckbox"]; foreach($acheckbox as $key => $bcheckbox) { $sql="INSERT INTO table (column1, column2) VALUES ('$bcheckbox', '{$_POST['atext'][$key]}')" ; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } } Should work. -
Insert different arrays into a MySQL table
premiso replied to Arsenelupin's topic in PHP Coding Help
Either add a 2nd column or concat the two values: $acheckbox=$_POST["acheckbox"]; foreach($acheckbox as $key => $bcheckbox) { $sql="INSERT INTO table (column1) VALUES ('$bcheckbox::{$_POST['atext'][$key]}')" ; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } } That would work, given that they have the same array index. -
Whoa, sorry I was not thinking of reCaptcha. I cannot find the original site I was looking at or even thinking of. So here is my example: <?php if (isset($_POST)) { if (isset($_POST['somerandomname']) && $_POST['somerandomname'] != "") { echo 'Thank you.'; // this is just a friendly display cause they filled in the bad stuff. }else { // good they are not a bot process the form } } ?> <html> <head> <script type="text/javascript"> function process() { var elem = document.getElementById('somerandomname'); elem.style.display = "none"; } </script> <form action="" method="POST"> <input type="text" id="somerandomname" name="somerandomname" /> <input type="text" id="fname" name="fname" /> <input type="submit" id="submit" name="submit" value="Submit!" /> </form> <script type="text/javascript">process();</script> That code will work for most bot spammers given that they have no Javascript functionality. A human spammer will still pass as long as they are using a browser with javascript capabilities. But this stops about 95% of spam on most of my sites. Questions about that let me know, if I find the original creator I will post that information here. EDIT: http://freshervisions.com/articles/an-alternative-to-captcha-honeypot-forms/ Not the original as far as I know but a good article explaining it. EDIT EDIT: Found another site that has some other ideas and methods to help thwart spam: http://nedbatchelder.com/text/stopbots.html
-
I believe using the DATE_FORMAT in MySQL in the where clause would allow for this. WHERE date_format(`depart_dttm`, '%Y-%c-%d') = '2009-01-22'
-
Agreed, it all depends on if the date format will always be that. If not then yes, the strtotime is better for extended functionality
-
It can, but you really do not care. The only users to see this box will be bots parsing the page. Regular users should not see this box at all, which is essentially the point. The bots will fill it in not knowing it should not be filled in, which is your check.
-
Maybe simpler, but about 8-10x slower.
-
[SOLVED] How to get all parents in a hierarchical category structure?
premiso replied to sallieann's topic in PHP Coding Help
I assume he has it some what working with the DB from this statement: If it is not working, yea he will have to put in the right DB information. I do not know what class it is, but given the code he originally posted, the code I posted should work just fine, unless that class does some weird stuff. -
reCaptcha all the way. Down with captcha images! To fix mchl's link reCaptcha
-
To help you provide us with more information. How would grab the specific city? Is it part of the form, as I do not see that there. This is probably both PHP and MySQL. To limit a MySQL query even further use the AND keyword in the WHERE clause: WHERE type = 'Architects' AND city = 'My City' That is a rough example, you will have to replace it with your code. Be more descriptive and you might get a more descriptive answer.