RussellReal
Members-
Posts
1,773 -
Joined
-
Last visited
Everything posted by RussellReal
-
you need == ((value == value) && (value == value)) is called if nesting, or thats what I call it.. its used to GROUP conditionals together for example if (((value4 == value1) && (value1 == value3)) || (value2 == value4)) { } && = and || = or
-
how can we stop copying of videos from website
RussellReal replied to revathi_srikrishna's topic in PHP Coding Help
when you stream a video, that video is actually being sent to the clients as they're watching it.. so either way you're sending the video file for the world to have access to.. -
#1 $SQL = "SELECT * FROM users WHERE username = '{$username}' "; $result = mysql_query($SQL) or die(mysql_error()); $row = mysql_fetch_array($result); $pin = $row["pin"]; $user = $row["username"]; $level = $row["level"]; $active = $row["active"]; is not needed.. get all that data from the second query #2 do the checks for if user is invalid or w\e BEFORE you do queries.. #3 on your localhost you probably have the database set up.. on the server your database probably has errors.. like wrong types.. no table at all, misspelled table name.. etc etc
-
for str replace you don't need to match the number of TO-REPLACE strings with WITH-REPLACE for example echo str_replace(array("abc","def"),"","abcdefghi"); // ghi
-
[SOLVED] I need help with this recursive function.
RussellReal replied to takato's topic in PHP Coding Help
also bro, not to contradict you.. but globals are very much unneeded.. there is a much better way with referencing the variable in the function call $omg = "lmao"; whatever($omg); function whatever(&$geeze) { // $geeze will be a variable accessing $omg, instead of just handling teh VALUE of $omg.. meaning any change you do to $geeze in here, affects $omg.. } -
what? pagination is really easy, particularly if you are paginating sql results.. LIMIT works wonders
-
*** RussellReal extracts foot from mouth *** *** And then inserts directly up the rectum of mjdamato ***
-
creating a multi-level category search/navigation system
RussellReal replied to cali_dotcom's topic in PHP Coding Help
ok for example: you have a table `menu_table` now.. the construct on this table is: int `id` auto_increment text `page` text `options` a fake entry of this table: `id` = 1 `page` = index.php `options` = a:3:{i:0;a:2:{i:0;s:4:"HOME";i:1;s:9:"index.php";}i:1;a:2:{i:0;s:8:"SERVICES";i:1;s:12:"servives.php";}i:2;a:2:{i:0;s:9:"DOWNLOADS";i:1;s:13:"downloads.php";}} how we arrived at the options to look that way is rather simple to manage: <?php $arr = array(); $arr[] = array("HOME","index.php"); $arr[] = array("SERVICES","services.php"); $arr[] = array("DOWNLOADS","downloads.php"); $options = serialize($arr); ?> to undo the serialization is simple.. <?php //do your mysql stuff here and read from the table for the current page $arr = unserialize($row['options']); $arr[] = array("PAGE TO ADD","PATH/TO/PAGE.php"); $options = serialize($arr); I'm sure you could bridge something off of this to simplify the means of building menues for each of your pages -
hes trying to round to .5 intervals.. not like 1.5 to 2.0 1.5 would be 1.5 1.6 would be 1.5 1.4 would be 1.5 1.2 would be 1.0 thats why I wrote the function, everybody knows about round() EDIT:: oo I see what sasa did
-
[SOLVED] Setting array to one variable to display later
RussellReal replied to ratgurrl's topic in PHP Coding Help
the MSN add is always on the table incase you need any help in the future that way you don't need to rip your hair out for 10 hours -
oh sorry bro it should be greater than instead of less than for the second if.. <?php $page = $_GET['page']; $rpp = 4; $c = 0; $handle = opendir('comments/'); if($handle) { while(false !== ($file = readdir($handle))) { if(preg_match("/\w+(.gif)/",$file)) { $c++; if ($c > (($page * $rpp) + $rpp)) break; if ($c >= ($page * $rpp)) { echo "<div class='update_pics_frame'>"; echo "<div class='update_pics'>"; echo "<a href='comments/$file'><img src='comments/$file' width='200'border='0'></a>"; echo "</div>"; echo "</div>"; } } ?>
-
if you disabled auto increment your rows will require you to send an ID along with the INSERT, now, you could do without the ID row all together, however, that will lead to optimisation problems as you will have more than likely many results for 1 SELECT query, where as with an `id` you have unique rows throughout the table,, If you'd like you could add me to MSN RussellonMSN[at]hotmail.com
-
<?php $page = $_GET['page']; $rpp = 4; $c = 0; $handle = opendir('comments/'); if($handle) { while(false !== ($file = readdir($handle))) { if(preg_match("/\w+(.gif)/",$file)) { $c++; if ($c > (($page * $rpp) + $rpp)) break; if ($c <= ($page * $rpp)) { echo "<div class='update_pics_frame'>"; echo "<div class='update_pics'>"; echo "<a href='comments/$file'><img src='comments/$file' width='200'border='0'></a>"; echo "</div>"; echo "</div>"; } }
-
[SOLVED] Setting array to one variable to display later
RussellReal replied to ratgurrl's topic in PHP Coding Help
I was tryna help her figure it out on her own -
and id is probably auto increment so you probably wouldn't want to.. what you should do... is ORDER BY and order it by PID
-
creating a multi-level category search/navigation system
RussellReal replied to cali_dotcom's topic in PHP Coding Help
make a menu table use serialize to group values together.. in pairs OPTION -> VALUE $opt = serialize(array("option","value")); then store that into a db with all the other option serialisations seperated by \x01 or something unconventional then when you're going to place the next level in call that menu from the db and unserialize all the options and then place the options where they belong.. then you just need a menu table instead of a hundred text files for each menu.. and its easier to work with in terms of coding the admin panel -
[SOLVED] Setting array to one variable to display later
RussellReal replied to ratgurrl's topic in PHP Coding Help
<?php print_r($propExterior); ?> you will get something like.. Array ( [KEY] => VALUE [KEY] => VALUE [KEY] => VALUE ) -
You're probably looking for ALTER TABLE
-
[SOLVED] Setting array to one variable to display later
RussellReal replied to ratgurrl's topic in PHP Coding Help
add me to MSN I actively help most of the people on my friends list with PHP and MySQL so you would fit in nicely.. I also have done few tutor jobs for money but I prefer to help for free. My name is Russell and my MSN is RussellonMSN [AT] hotmail.com also: try <?php print_r($_POST); ?> to see if your values r being sent, and the construct of the print_r will tell you how you should reference the values -
well yes if you use a font with fixed widths but there is another way that I just found out recently aswell for images.. the function is imagettfbox
-
imagecopyresampled