408 Posted Topics
Re: get rid of the ' ' around $checkUsername There should only be 1 result if the user/pass combo exists. No one will have the same username, right? So change line 20 to: if($Username_exists == 1) { header("Location: indexma.php"); exit();//all header redirects need to kill the script or it will continue … | |
Re: This is, by far, my favorite site for regex testing. Make sure you use the Preg radio button, and have fun: http://www.regextester.com/ | |
Re: You need to combine PHP and HTML tables and CSS, and figure it out. PHP has wonderful Date() functions. Check them out! http://php.net/manual/en/function.date.php | |
Re: Try hard coding session_start() as the first thing on each page, and not as part of the include. If you are redirecting, you may have to session_write_close() before the header change. It may be something to do with the way you are accessing variables, as well. As a last bit, … | |
Re: Best way to learn any programming language - find something you are interested in, see what you can do to become involved. Like photography? Make a program that sorts images by name or, for more fun, common pixel hot spots (like, pictures that have over 2000 pixels that are red … | |
![]() | Re: There are also ways to obfuscate the salt, by storing it outside the html/ftp root, and telling php where to look with includes. On top of that, the salt could be appended to the front or back of the password, making it a bit harder to rainbow hack the passwords, … ![]() |
Re: If I understand the manual right, the crypt function is based on the box running PHP, not PHP itself. If they are on different computers, you are likely to get different results. Anyone know for sure? | |
Re: I believe you are missing a colon on line 36 - C:\documents | |
Re: Line 2 of your php script is asking to include a file called "funck.inc.php" Assuming you wrote this yourself, you may have meant to do include("funck.inc") or, alternatively, include("funck.php") Whatever it is, the error message is saying that the file you are asking to include does not exist. Find the … | |
Re: You can make a website about anything, especially academically. Make a page about cats, and how different cats make dogs bark differently. You are proving functionality, concepts, and reiterating all the things you have learned in your class. Content, for the most part, is secondary. PHP is about making frames, … | |
So, maybe this is a concept out of the domain of programming... but I think not. Lets say we have a 400MB video file that we want to either send somewhere, or stream. Can we use python to break it into binary, break the binary into chunks, and then send … | |
Are there any open source/free to use, commonly updated... either dumps or APIs that will let someone have zip codes and addresses validated? Think monster.com or careerbuilder.com's location search, or something similar. Thanks Ryan | |
Re: Probably the simplest way to make it a .bat is to make an exe that will write a .bat, execute the .bat, then delete the .bat. In short, if you plan on distributing in windows, make it an exe. py2exe is the standard from what I understand. Your other options … | |
Re: I cant suggest O'Reilly's python course enough. It is broken down into 4 courses, and you have a mentor who is very professional and knowledgable the whole way. It is self paced, and the projects are relevant and usable after you are done with the class (and, as a perk, … | |
Which module would I look into to capture things like disc read/write speed, as well as possibly capture what the disk is reading/writing at the time. I would like to make a diagnostic module to check if my disc speed is taking a hit, as I rebuilt a PC and … | |
I have taken up the Python Challenge and I am stuck on challenge 6, which requires PIL - and sadly I am using 3.2 and there is no PIL support. Yes, alternatively I could simply download 2.7. However, I know there are some differences between 2.x and 3.x and I … | |
Re: I think what youre asking is for this: This is assuming your text document is split by "." as you have above, so... Joe Cren(.)Ryan Troop(.)Eddie Vedder(.)Led Zepplin(.) //or something similar if you do: $array = explode("(.)", fread($fp, filesize($filename))); //this array is populated ['Joe Cren', 'Ryan Troop', 'Eddie Vedder', 'Led … | |
Re: I love eclipse with the PHP extension. If you are looking for a testing platform, you will not find many good ones (and quite frankly, you are more than likely using the language wrong). Best platform to test - get a cheap/free web host, turn on error reporting, use eclipse … | |
Re: There is this example on Daniweb: http://www.daniweb.com/software-development/python/threads/22312/get-posted-form-data-in-python Hope I don't get in trouble for sharing a stackoverflow link: http://stackoverflow.com/a/11353284/1481486 There are some other fine examples of how to use python on the web there, as well. All depends on how you plan on using the data, and how you want … | |
Re: using select you are not affecting any rows. You should use mysql_num_rows() on line 22 instead, and you want it == 1 (because each username should only have 1 assciated password, and if you are getting more than 1 you're in trouble. Also, sanitize your variables (learn about [mysql_real_escape_string()](http://php.net/manual/en/function.mysql-real-escape-string.php)) | |
Re: Im not sure why you want to redirect away from your site 80% of the time, as that would pretty much ensure 80% of the people would not want to visit your site because it's useless. However, if you wish to pursue this you have 2 options. 1 - pure … | |
Can we possibly get a checkbox, or an optional write in so we can know why our posts are voted down? Some of them seem so random, it would just be nice to know why they are voted down. I like coming here to try and help, and it's not … | |
Anyone know any good online.. I guess.. challenges or tutorials that will teach the fundamentals of the automated QA process using Python? Is it simply TDD? Or is there more to it? If it is TDD, can anyone suggest where to practice this more, other than "come up with a … | |
Re: So this was a fun exercise for me... I think this should get you at least started... import sys import re import os try: #open our document and read it as a string doc = open(os.path.abspath(sys.argv[1]), 'r').read() #declare and compile our pattern as raw string regex = r'<!--content-->' reg = … | |
Re: I would think that the google suggestion for search is based off a custom dictionary, and if an item is not in the dictionary it offers the closest match as a suggestion. What the closest match is will depend on your algorithm. Also, google has been mining search queries, and … | |
So, in an exercise in futility, I decided to write a script that will take either a file or a string and find patterns in the words, and display the results for a nice friendly human use. Right now, it simply searches forwards and backwards(ish), but Im wondering if there … | |
Re: because of this very awkward (to me) behavior, I much prefer .format() you could easily have done: `cursor.execute("""INSERT INTO staff (FIRST_NAME, LAST_NAME) VALUES (r{}, r{})""".format(first_name, second_name)` You can even format by place holder, if you have a list, tuple, or parsed dictionary: names = ['firstname', 'lastname'] cursor.execute("""INSERT INTO staff (FIRST_NAME, … | |
![]() | Re: Another vote for PEAR. Simple and straight forward. ![]() |
Re: If you're going to be salting the password, salt it using a stored global in .htaccess http://www.besthostratings.com/articles/php-variables-htaccess.html Or from an include that is stored above http access. This makes a private salt that can only be accesed with root FTP access. On top of that, your added "pepper" should be … | |
Re: I would recommend you turn off all your error suppressions (@) and see if you raise any errors... Line 1 is missing a closing ; While I can't say it's improper, I have never seen a while loop in PHP using while($mycontingency): ... endwhile; I would encourage you to use … | |
![]() | Re: never trust your users. End of story. At the very minimum, $keyword = mysql_real_escape_string($keyword); should be used. With the limited code you have given, it's difficult to say. Without knowing how $siteurl is populated, or how $url3 is populated, it's difficult to see where you are failing. |
Re: looks like a spelling/case error with your DB columns. As above, make sure that 'ID' is the actual name of the column, and not something like 'userID' or something similar. You don't need to stripslashes if you're using real_escape_string(). Don't give idiots who try to hack your page more room … | |
Re: So first, Robot is not a defined variable anywhere, so Robot.population means nothing. Second, the way you are using population wont work. Every time you make a new robot, the population will reset to 0, and only that robot will have a population of 0. You will need to rethink … | |
Re: Erm.. all isntances of mysql_numrows should be mysql_num_rows() <-notice the extra underscore Line 50, 85, 113, 126, 164.... that should get you started... I saw a few more below it, as well.. 184, 197... there's more. | |
Re: $uploadResponse = "File Upload Complete!<br /> The file has been saved as Â¥".$_REQUEST['listname']."Â¥ and will be displayed as Â¥".$listnameNice."Â¥<br /><br />"; proper formatting for concatenation is: $var = "my string starts here and I will only use one quote to break it ".$add_this_var." and now I can continue with my … | |
Re: Assuming your form has the names right from the HTML submitting page... try capitalizing POST so $_POST['gt'] Im pretty sure globals are case sensitive. | |
So, I would like to start working on a python module to support RFC 2326 (RTSP), in an effort to work on a larger application that I will probably need help with later. I am unsure how to go about making software that is meant to adhere to a specific … | |
Re: would need to see the code to see what you are trying to accomplish. | |
![]() | Re: the proper syntax for else is: else { ... } <- you need open and closing brackets just like an if statement. |
Re: Nothing wrong with using both. What is the problem you are having? | |
Re: Ugh.. lets try again.. just did a long explanation, hit delete, and I lost the page... fun fun... I shall shorten it... iterate over your post instead of calling them directly... mysql_connect('localhost', 'foo', 'bar'); $expected = array('check', 'lote', 'val' ....); $inserts = array(); foreach($_POST as $key => $value) { if(in_array($key, … | |
Re: try preg_replace() instead. http://www.php.net/manual/en/function.preg-replace.php | |
![]() | Re: You would do well to understand what SESSIONS are COOKIES are, and how to use them. Basically, as you are using them, a permission file is a php page that can be accessed when the user is logged in, and their session data is available to the server. Sessions are … |
Re: get rid of the concatenation... mysql_query("UPDATE member_info SET tel='33333339' where id='$update_id';"); You can do inline variables, as long as you are using " " instead of ' '. In your particular case, however, it looks like you have double quotes twice at the end of your statement, which basically ruins … | |
Re: In all honesty, I would like to know how to simply begin with a project like this... Im still rather new to Python and I read all over the place "Python is GREAT for prototyping!" And then fails to expand on that... Perhaps it is my lack of experience with … | |
Re: Most (if not all) email systems will ignore PHP (it has no meaning to the mail protocol), and JavaScript, as far as I know, will not transfer over through email. You would have to click links and go to pages and interact with the malicious page. It sounds like you … | |
Re: unless you're talking about country codes, in which case you need to register your domain with a country code (there are probably some limitations.. like.. you have to find a server in that country to host your data) Like, in your example, co.nz would be new zeland http://www.godaddy.com/domains/searchresults.aspx?ci=54814 (assuming their … | |
Having a little trouble getting my "pre-loader" to show properly... I would assume, what this script would do is that once xmlhttp is invoked, JS would make a div with an ID called 'preload' and it will persist until we get a 400 response from the server, and then destroy … | |
Re: If you want the field name directly, simply don't use an alias. By defining FIRST_NAME as NAME you are asking to return "NAME" with the contents (the alias is there to lessen the amount we have to type). If you don't want them, dont use them. If that wasnt clear, … | |
Hey all, Im hoping this isnt too out of line to ask - it is genuinely out of a desire to learn and improve, but sadly it is not necessarily code based. I am working on getting "experience" so I can persue a career in programming, either web, platform, or … |
The End.