-
Posts
194 -
Joined
-
Last visited
Never
Posts posted by czukoman20
-
-
THANK YOU soooo much!
-
Ok i'll give that a try
-
Thats exactly what happened when i tried the question in other forums.. I posted the code, and then Nothing.....
anybody out there?
-
Ok.. I'll post the entire code
Warning.... Its big..
<?php if (!(isset($pagenum))) { $pagenum = 1; } $data = mysql_query("SELECT * FROM users WHERE category LIKE '%$category%' ORDER BY rand()") or die(mysql_error()); $rows = mysql_num_rows($data); $page_rows = 10; $last = ceil($rows/$page_rows); if ($pagenum < 1) { $pagenum = 1; } elseif ($pagenum > $last) { $pagenum = $last; } $max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows; $data_p = mysql_query("SELECT * FROM users WHERE category LIKE '%$category%' $max ") or die(mysql_error()); while($values = mysql_fetch_array( $data_p )) { echo "";; $user = $values['username']; $company = $values['company_name']; $fname = $values['contact_firstname']; $lname = $values['contact_lastname']; $position = $values['contact_position']; $address = $values['address']; $city = $values['city']; $state = $values['state']; $zipcode = $values['zipcode']; $desc_mini = $values['description_mini']; $phone = $values['contact_direct_phone_normal']; if($session->logged_in) { $sub = "submit2.php"; }else{ $sub = "submit2.php"; } $types = array("jpg","gif","png","swf"); $dir = dirname(__FILE__)."/site-images/searchlogos/"; foreach($types as $type) { if(file_exists($dir.$user."_logo.".$type)) { {?> HTML PAGINATED DATA I removed due to the bulk of the listing. <?php} } } } echo ""; echo " --Page $pagenum of $last-- <p>"; if ($pagenum == 1) { } else { echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=1'> <<-First</a> "; echo " "; $previous = $pagenum-1; echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=$previous'> <-Previous</a> "; } if ($pagenum == $last) { } else { $next = $pagenum+1; echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=$next'>Next -></a> "; echo " "; echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=$last'>Last ->></a> "; } ?>
mmm...are you like, pulling the results from the db and storing them in an array and paginating based on the array (array being stored in a session or flatfile)? Because if you are calling that on every page load, there's no reason it should not be returning different orders every time. Post more code.Its basically an array, i am not sure if its a session or flat file because one of my friends helped me write this code.
-
Well.. From what i understand.. There is inconsistency with your Redirects.. it works.. or doesn't work..
What i do for redirecting anywhere is
printf("<script>location.href='http://www.yoursite.com'</script>");
Hope that helps..
-
I dont care if it gets hacked lol... its only used to randomly display listings on a pagination system, not to hide poker cards.
The problem is .. ITS NOT ALWAYS RANDOM
Its random once.
For some reason my listings will display in a random order... but the exact same random order every time.
thanks though .. it baffles me
-
I've had this issue for a year now.. but finally went back to trying to fix it.
RANDOM
here is what i have
$data = mysql_query("SELECT * FROM users WHERE category LIKE '%$category%' ORDER BY rand()") or die(mysql_error());
The problem I HAVE ALWAYS had was .. The ORDER BY rand() sux... What it does is it generates a random Order... but it will never generate a different random order after the first one..
its as if I am missing a refresh code that refreshes the rand() command.
Help is greatly appreciated
-
It worked thanks a ton!
-
Problem is.. when i try
mysql_query("UPDATE users SET category = 'implode($input);' WHERE username = '$user'");
it inputs
implode(Array)
into the database?
-
I am trying to figure out how to put my array into a mysql database.
echo implode($input);
I would like if there was a way to not serialize it.
Thanks
-
Nevermind I figured it out... I had to put it on the outside of the Brackets... Ok
Thanks a ton for your help!!!
Nice site btw
Have a good one!
-
interesting
the output is now
F_FP_AL F_FP_AL ,F_FP_HI F_FP_AL ,F_FP_HI ,F_FP_MA F_FP_AL ,F_FP_HI ,F_FP_MA ,F_FP_NM
Wierd, I bolded the States to make it easier to read
The code I am using is
<?php <input type="checkbox" name="states[]" id="list" value="AL" /> <input type="checkbox" name="states[]" id="list" value="HI" /> <input type="checkbox" name="states[]" id="list" value="MA" /> <input type="checkbox" name="states[]" id="list" value="NM" /> //output $states =$_POST['states']; if ($cat1 == "FP_"){ $input = array(); foreach($states as $state){ $input[] = "F_FP_$state "; echo implode(',',$input); } } ?>
-
SWEEET!!
Thanks a ton..
Just one final question.
The only way i know how to "echo" this is throught another foreach statement.
Also there is print_r();
Would I have to say
print_r($input[1,2,3,4,5,etc..]);
or is there a more simplified way?
Thanks for your help!!
-
Yes it does.
Now the output shows
ALHINAMH
thanks
Cool
Now for the categories... It wouldn't be as hard, but the page changes according to what the input in the url is..
Here is what i have so far
<?php if ($cat1 == "FP_"){ $input = "F_FP_$state"; } // of course that doesn't work lol ?> I'm thinking array, but idunno how to do that.
-
Thanks, But for some reason when i did that.. it only echo's the last state that I selected.
<?php <input type="checkbox" name="states[0]" id="list" value="AL" /> <input type="checkbox" name="states[0]" id="list" value="HI" /> <input type="checkbox" name="states0]" id="list" value="MA" /> <input type="checkbox" name="states[0]" id="list" value="NM" /> // output $states =$_POST['states']; foreach ($states as $state){ echo "$state"; } // it echos NM when those 4 are selected? ?>
also the twist to this is.. there are categories.. so each state needs its own Category Information
F_ = Financial
FP_ = Subcategory of Financial
So those need to be F_FP_$state But it needs to repeat itself like that for however many states are selected.. If they didn't select a state I dont want the database to have a bunch of blank "F_FP_ "
Thanks for the help so far
-
Hi all, I am working on a project that uses checkboxes to select all or some of the 50 states.
I was wondering if there was an easy route to making them a variable that would be like.
F_FP_$state and then that would show all the states they selected and nix all the states they didn't select.
Examples of what i have already.
<?php <input type="checkbox" name="AL[0]" id="list" value="AL" /> // That repeated 50 times with different state values. // When the user submits the checkboxes $AL =$_POST['AL']; foreach ($AL as $st_1){} // That repeated as well for each state. ?>
-
It says Null... What does that mean?
If i put the info in there it says.
String(52) then the info
-
I am trying to make the match
preg_match('/<span id=HIL_c><font color="(.*?)"><b >\(.*?)<\/b>/', $contents, $output); $output2 = $output[0]; echo $output2;
when it does this... I get nothing.. but if i were to put the color and the info in the other area... It will display it no problem, so the preg match is seeing the match. I'm pretty sure it has something to do with my output, but i'm out of options .. so please help. much appreciated
-
Hi, all
Thanks in advance.
I am having trouble .. I am currently redesigning a forum
I was wondering if anybody would know why when
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $base_url.'/style/'.$forum_user['style'] ?>/Oxygen.css" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo $base_url.'/style/'.$forum_user['style'] ?>/Oxygen_cs.css" /> <!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="<?php echo $base_url.'/style/'.$forum_user['style'] ?>/Oxygen_ie6.css" /><![endif]--><!--[if IE 7]><link rel="stylesheet" type="text/css" href="<?php echo $base_url.'/style/'.$forum_user['style'] ?>/Oxygen_ie7.css" /><![endif]-->
That code is initiated, Anything else on the page/ html, appears above it.. and not below the actual forum
I just dont understand how the process works when you link code to initiate external files to create a page... and what i want to do is add HTML below the actual forum link rel.
thanks
Please if i am not clear.. tell me
-
I have this dropdown menu that i am working on.
http://www.adworld-online.com/newlayout/demo.htm
If you open that up in Firefox, and then in Internet Explorer, it will work.
But if you go to
http://www.adworld-online.com/newlayout/index4.php
If you open that up in Firefox, IT WORKS
If you open it in IE, The dropdown menu's appear below the button.
Here is the CSS
.dropmenudiv{ position: absolute; top: 0; border: 1px solid #BBB; border-bottom-width: 0; font:normal 12px Constantia; line-height:18px; z-index:100; background-color: white; width: 200px; visibility: hidden; }
I honestly have no idea what could be wrong. But IE sucks
There is more CSS, but i believe that is the only portion that has to do with the menu's
Help is greatly appreciated
-
This will not work.. Because php_self stops after .php leaving the ? and rest out.
$path = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$_SERVER['REQUEST_URI'];
Yep, that is what i wanted, but i caught that and added the REQUEST_URL into it, and it worked fine.. all i needed to know is how to use those different areas and send it to a variable.. Thanks a ton guys
-
Thanks for the help... how do i make this solved lol
-
See. thats what i got confused about before..
here
the code comes out wierd. if you just go to the link at the bottom. Then you will see what is in the code box better
Array ( [HTTP_HOST] => zukodesign.com [HTTP_USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5 [HTTP_ACCEPT_ENCODING] => gzip,deflate [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7 [HTTP_KEEP_ALIVE] => 300 [HTTP_CONNECTION] => keep-alive [HTTP_REFERER] => http://zukodesign.com/fl-studio.php [HTTP_COOKIE] => PHPSESSID=133aec482283bdb54f482a6015b3e724; __utma=47647532.2123832240.1233461987.1233461987.1233461987.1; __utmz=47647532.1233461988.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); CP=null*; rsi_ct=2009_1_31:1; rsi_segs=; __utmc=47647532 [HTTP_CACHE_CONTROL] => max-age=0 [PATH] => /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin [sERVER_SIGNATURE] => Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.6 Server at zukodesign.com Port 80 [sERVER_SOFTWARE] => Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.6 [sERVER_NAME] => zukodesign.com [sERVER_ADDR] => 97.65.128.24 [sERVER_PORT] => 80 [REMOTE_ADDR] => 63.250.232.43 [DOCUMENT_ROOT] => /home/zuko/public_html [sERVER_ADMIN] => webmaster@zukodesign.com [sCRIPT_FILENAME] => /home/zuko/public_html/FL_vidtutplayer.php [REMOTE_PORT] => 51904 [GATEWAY_INTERFACE] => CGI/1.1 [sERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => vid=BEk4MMS0ZBQ&wid=425&ht=344&desc=How+to+use+the+vocoder+in+FL-Studio&link=WarBeats.com [REQUEST_URI] => /FL_vidtutplayer.php?vid=BEk4MMS0ZBQ&wid=425&ht=344&desc=How+to+use+the+vocoder+in+FL-Studio&link=WarBeats.com [sCRIPT_NAME] => /FL_vidtutplayer.php [php_SELF] => /FL_vidtutplayer.php [REQUEST_TIME] => 1233541856 [argv] => Array ( [0] => vid=BEk4MMS0ZBQ&wid=425&ht=344&desc=How [1] => to [2] => use [3] => the [4] => vocoder [5] => in [6] => FL-Studio&link=WarBeats.com ) [argc] => 7 ) WarBeats.com How to use the vocoder in FL-Studio.
Thats what i got.. when my url is.
-
I'm currently using a scrip that needs the Exactly URL of the document to work. How would i make a variable that reads what is in the address bar. I got a clue kind of withe the $_SERVER... but i'm lost after that
Help is greatly appreciated thanks
gzip compression... and file downloads
in PHP Coding Help
Posted
I am trying to gzip compress my site... I did the simple php.ini way first (zlib.compression) .... then I did the script like this.
both of those work fine... but when I am in magento, the download module reads the downloadable file in a .BIN type script rather than a .zip download.
Is there something I can add to the above script in order to exclude certain pages.. or files from the script?
Thanks much appreciation