Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. I would suggest reading up on Variables Scope And make sure your form POST as the method and that isntead of $submit you use if (isset($_POST['submit'])) { isset to see what that does. EDIT: Dang it Dan. Well I have a bit more info so still posting
  2. Someone docked notepad++ I thought it was just notepad? (Maybe I missed a post of someone dissing NP++) Notepad++ is a great utility, it lacks for big projects but works for simple scripting. Notepad is just a bonehead move, grow up and join the world of syntax highlighting.
  3. Your error message is pretty self explanatory. Your class does not have the method "prepare". Simple as that. I do not know why you are using globals with a class. If you are and think that is right you need to read more up on OOP. For the global $con to work I believe you also have to define it as global at the start of the script. <?php global $con; // rest of code below The better alternative is make the PDOMySQL class have a constructor and pass the DB info to that and establish a connection in that constructor and store it as a class variable and use $this->con instead.
  4. I believe you would have to setup a str_replace have an array of special characters then another array of their counter parts (the indexes must match for what you want replaced). I do not know of any function that will do it, but you may be able to find one via google that someone else had made.
  5. So...is it not working or what? And please change <code> to
  6. <?php ob_start();//not sure why this is here, but ok. include("config.php"); if(isset($logged['username']) && ($logged['level'] == 3 || $logged['level'] == 5)){ // you should encase array associative keys in single or double quotes echo "Welcome Mod!"; }else{ header( 'location:http://speed-racing.netau.net/main.php' ); } ?> See comments for suggestions/changes. EDIT: Added isset to $logged['username']
  7. Inline css is suggested against doing not recommended. Mainly because in order for you to modify the style you manually have to change the page. Whereas with CSS being in a file, you can change the values of that file and have easy portability to a new theme, new color scheme etc. It is better to keep it in an external CSS file due to that. You want to make it easier for you to modify your script's scheme later on, not harder
  8. An alternative, and maybe easier method would be to use glob Just thought I would throw that in there. Too lazy to provide an example however since the above worked.
  9. Hmm, wonder what happens when you do 1 2 3 4 (could it be a list issue) 0. [0] 1. [1] 2. [2] 3. [3] 4. [4] Just felt like testing it, figured this was the post to do it! I do not know if it is a "bug" but that is interesting
  10. Do you have any code? It sounds like you want us to code this for you. Show us you at least put effort into trying or post in the Freelance section.
  11. Not to mention unix timestamps have a date range. After 2037, unix time cannot calculate the date thus is obsolete. MySQL time will do just fine from now till the next 0 is added on. I prefer the DATETIME in MySQL as not only is it readable, it will not become obsolete for sometime.
  12. mysql_connect The first parameter should be the host, not the db. The DB comes when using mysql_select_db Since it looks like you are trying to define the database name inside the connect, that is why I posted it. If your code does indeed have the server. Please disregard. A side note: $select = mysql_select_db(("MY_db"), $conn); // should be $select = mysql_select_db("MY_db", $conn); As that may also effect it.
  13. Back in my day we used a chizel and stone. Man those were the good old days That was the "Psuedo-Code" days. But yea, I always hated writing out code. It is like dude why not let me write it out on the computer, come on now. So I always made my handwriting sloppy and wrote the code the most inefficient way I could think of and made a note, "Yes, it is inefficient. But I felt it was suitable given the manner you were having me write the code." My teachers all liked me though, so they just thought I was being funny, when I was dead serious.
  14. That's what they "want" you to think. When in essence it was as simple as dividing by zero.
  15. If a user can see the video...they can download it. Simple as that. The video file, whether streamed or not, can be downloaded. Google YouTube downloader etc. If they cannot figure out how to prevent their videos from being downloaded, it is not possible. The issue is, the user, in order to see the video has to have that video sent to his computer and can hence capture it in some way. The only true way to make sure it is not downloaded.
  16. My calculator can divide by zero, but alast I got it from Bed, Bath and Beyond. The secrets to dividing by zero are not to be taken lightly as they reveal the truth about the world. You figure out how to divide by zero, then you understand the world and "reality" in full. In essence you become Neo from the Matrix. That is how he learned the truth.
  17. $to = ".$email.";// syntax error // should be $to = $email; As far as why it is not sending emails, this can be because of spam filters. I know Yahoo, Hotmail and GMail have some intense filters and sometimes if the domain name does not have a registered mail server to that ip they will not deliver the email. This may very well be out of your control, and I do not know how to fix the issue of the mail server being if it is indeed the issue.
  18. I thought the Zombies would take care of that...I mean if they take over the world the computing part would be "automated" by mindless people poking keys....oh wait...that already happens. The computers have turned us into Zombies...FAIL! The overlords have won.
  19. So what issue are you having? You failed to mention that bit.
  20. <?php function convertLinks($text) { $in=array( '`((?:https?|ftp)://\S+[[:alnum:]]/?)`si', '`((?<!//)(www\.\S+[[:alnum:]]/?))`si' ); $out=array( '<a href="$1" >$1</a> ', '<a href="http://$1" >$1</a>' ); return preg_replace($in,$out,$text); } $string = "This is some text http://www.google.com and www.google.com and http://google.com but google.com does not work as clickable."; $string = convertLinks($string); echo $string; ?> Should work. It is nearly impossible to do the google.com without the www. or http:// so yea. Hopefully that works for you. EDIT: As an fyi, I did not write that, I found it in the comments at preg_replace I just removed certain portions and renamed it.
  21. Just an fyi. mysql_numrows they both work, as it is an alias of mysql_num_rows.
  22. I bet Oracle keeps MySQL as they are both functioning great and both can be used for different reasons. It would be Interesting if they did combine them to be... MyOracle ? Either way I do not think that Oracle would turn MySQL into pay to use, I think it will stay the same, or if they combine they would offer the non-enterprise version for people. At least I hope so, if no I guess we still have MySQL 5. I just fail to see how they could take it away given how many servers run off of MySQL.
  23. You are closing mysql in the loop. You do not need to use mysql_close in your code as it is closed automatically upon the script finishing. But that is probably your issue. An error is being thrown cause the resource is no longer valid once you have closed the mysql connection.
  24. function changeCssScore($score=0) { if ($score > 100) { $return = "gold"; }elseif ($score > 80) { $return = "silver"; }else { $return = "bronze"; } return $return; } $score = 79; echo '<tr class="' . changeCssScore($score) .'"><td>Score was ' . $score . '</td></tr>';
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.