premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
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
-
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.
-
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.
-
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.
-
So...is it not working or what? And please change <code> to
-
<?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']
-
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
-
Get contents of a dir, and echo the contents of the .htm files..?
premiso replied to ripkjs's topic in PHP Coding Help
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. -
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
-
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.
-
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.
-
i'm a newbie having a problem with 'mysql select'
premiso replied to karnegyhall's topic in PHP Coding Help
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. -
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.
-
That's what they "want" you to think. When in essence it was as simple as dividing by zero.
-
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.
-
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.
-
$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.
-
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.
-
So what issue are you having? You failed to mention that bit.
-
Select 40 results, and make a second page if more?..
premiso replied to cs.punk's topic in PHP Coding Help
Basic Pagination -
<?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.
-
Just an fyi. mysql_numrows they both work, as it is an alias of mysql_num_rows.
-
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.
-
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.
-
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>';