
Alex
Staff Alumni-
Posts
2,467 -
Joined
-
Last visited
Everything posted by Alex
-
Use RAND() Ex: SELECT col_name FROM table ORDER BY RAND() LIMIT 10
-
You can just do: file_put_contents('details/horselistfile.txt', $horsearray . file_get_contents('details/horselistfile.txt')); file_get_contents() and file_put_contents() do the same thing as fopen(), fread()/fwrite and fclose(), they just make things easier for you.
-
Probably because of the syntax error, a missing ), try: $allowedTypes = array( "image/jpeg", "image/jpg", ); if(!in_array($uploaded_type,$allowedTypes)) { echo "You may only upload jpg picture files.<br>"; }
-
Use substr() echo substr($id, 0, 10);
-
[SOLVED] Looking for Some Clarification Regarding My Php Files
Alex replied to Modernvox's topic in PHP Coding Help
If public_html was your previous root directory then the contents of public_html should be placed into htdocs/ -
[SOLVED] Looking for Some Clarification Regarding My Php Files
Alex replied to Modernvox's topic in PHP Coding Help
The undefined functions could be the result of a lot of things, like forgetting to include files. As for the other undefined function, unless that's a custom function there is no built in function called MySQLError(), it's mysql_error(). -
[SOLVED] Looking for Some Clarification Regarding My Php Files
Alex replied to Modernvox's topic in PHP Coding Help
Just upload the contents of your previous root directory into your new root directory. In your specific case public_html was your previous root, and C:\xampp\htdocs is the root dir for xampp. -
Are you actually running the query (mysql_query())?. If so, double check your column names. It's also usually not a good idea to preform functions like strip_tags() on passwords that will be encrypted. If users decide to use tags in their passwords (don't know why they would..) it would confuse them by changing their password, and although this scenario is unlikely there is no disadvantage because anything possibly malicious would be rendered harmless after an md5 encryption. Another good security measure is utilizing a salt.
-
You can only do the latter if you're trying to access a static method, meaning that you can't just do $instance::method();. So the circumstances in which either would be used are totally different. Assuming that static methods are properly named so the speed of execution will be about the same, if they're not properly marked the execution time will be ~double (Note: This is referring to just calling a function, not taking any additional processing into account).
-
Np Happens to everyone. Just make sure to mark the topic as solved, there's a button on the bottom left to do so.
-
While this is true and perhaps somewhat hypocritical it's not like we actually trace back and understand much of our ancestry. If you go back just 20 generations there are over 1,000,000 people that make up your DNA, do you know even a small fraction of them? There's a point where it becomes unnecessary to track back where your ancestors are from and just consider yourself a natural citizen of that location (most people do it just by where they were born, not even referencing ancestors). Otherwise technically we're all just African immigrants.
-
if(empty($rname)) should work. Are you sure you're using the correct name to access the value? You're telling us something is wrong, but you're not telling us what's happening.
-
What is happening then? empty() should work.
-
Whoops, forgot to address your second problem You're gonna want to use echo html_entity_decode(). Ex: echo html_entity_decode($clean_content[0]); Because if you look at their source they use html entities for the quotes inside the a tag.
-
I'm not really familiar with the structure, and it's hard to decipher someone else's code but the easiest solution would be just to use strip_tags. $super_clean_name = strip_tags($super_clean_name_1[1]);
-
Looks like you want to do something like this? if(isset($_POST['submit'])){ for ($i = 0; $i < count($_POST['box']); $i++){ ${'box_' . $i} = $_POST['box'][$i]; echo ${'box_' . $i}; } Variables will then be like $box_0, $box_1, etc..
-
Or $savelocation="./upload/{$horseid}test.jpg";
-
Being discriminated on for any reason would surely vary for different areas in the US, it's really too large to consider it as a whole. The US is pretty diverse and in general you really don't have much to worry about in that department. However, communication skills are another thing. Although depending on the specific job, good communication skills are usually an essential.
-
You're looking for mod_rewrite
-
-> is used to access methods and properties of an object in PHP OOP. There are plenty of examples there to help you understand. The reserved variable $this is used to access methods and properties of a class from within one of it's methods.
-
I have a plan to reduce the "tl:dr" count!
Alex replied to PugJr's topic in PHPFreaks.com Website Feedback
Actually, you're limited by the size of a TEXT field in a MySQL database. That's 65534 bytes, I think. Of course you're gonna be limited by something.. but I was referring to small limits, like the 1000 character limit he was referring to.. Who's going to write a 65534 byte post?