Jump to content

Lamez

Members
  • Posts

    1,686
  • Joined

  • Last visited

    Never

Everything posted by Lamez

  1. May I ask, are you doing this for a RS server?
  2. turn off safe mode, your webhost has that information.
  3. it is because the database has nothing in it.
  4. as a novice as well, here is what I used Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteRule ^([A-Za-z0-9-]+)/?$ user/profile.php?user=$1 [L] what is say is this: it allows the string to contain numbers and letters, it uses the file under the user directory called profile.php then it takes the ?user=username, so it all comes out to site.com/username
  5. 1.Post in the right board 2.Find the mod_rewrite cheat sheet, which is located in the right board. HUGE HINT: http://www.phpfreaks.com/forums/index.php/board,50.0.html
  6. ah, I found the problem, I put the wrong .htaccess file in the wrong folder, so the one that needs to be in my root folder, was in another folder, and the one for the root was in the wrong folder, I switch the two, and it works great!
  7. I do attempt everything on my own. I have a .htaccess file, but the code I put in made me redirect to my 500 error page.
  8. change: echo "<td bgcolor='#FF0033'>"; to: echo "<td>";
  9. <?php $num = $over_num; $page = isset($_GET['page']) && is_numeric($_GET['page']) && $_GET['page'] >= 1 ? $_GET['page'] : 1; $per_page = $num; $count_q = mysql_query("SELECT COUNT(id) FROM home ORDER BY id DESC"); $count_r = mysql_fetch_row($count_q); $count = $count_r[0]; if($page > ceil($count/$per_page)) $page = 1; $limit_min = ($page-1)*$per_page; $query = mysql_query("SELECT * FROM home ORDER BY id DESC LIMIT {$limit_min}, {$per_page}"); $sql = mysql_query("SELECT * FROM home ORDER BY id DESC"); $num_rows = mysql_num_rows($sql); $limit2 = $per_page; $q = "SELECT id FROM home"; $r = mysql_query($q); $num = ceil(mysql_num_rows($r) / $limit2); if($num != 1) { for($i = 1; $i <= $num; $i++) { /*if($page / $limit2 != $i)*/ echo "[<a href='?p=list&page=".$i."'>Page ".$i."</a>] "; //else echo "[<b>".$i."</b>] "; } } echo "<br /><br />"; //while($row = mysql_fetch_array($sql)){ while($row = mysql_fetch_assoc($query)) { //echo out DB info here } $limit2 = $per_page; $q = "SELECT id FROM home"; $r = mysql_query($q); $num = ceil(mysql_num_rows($r) / $limit2); if($num != 1) { for($i = 1; $i <= $num; $i++) { /*if($page / $limit2 != $i)*/ echo "[<a href='?p=list&page=".$i."'>Page ".$i."</a>] "; //else echo "[<b>".$i."</b>] "; } } ?>
  10. http://www.phpfreaks.com/forums/index.php/board,58.0.html
  11. ok I have something like this site.com/user/profile?user=Lamez how can I change that to site.com/Lamez ? -Thanks Guys!
  12. <?php ob_start(); $img_path = "img"; if(empty($_GET['s'])){ //$q = mysql_query("SELECT * FROM `table_name`"); //$r = mysql_fetch_array($q); $o_stat = $r['stat']; if($o_stat == (1)){ echo '<a href="?s=in"><img src="'.$img_path.'/in_green.bmp"></a> <a href="?s=out"><img src="'.$img_path.'/out_red.bmp"></a>'; } if($o_stat == (2)){ echo '<a href="?s=in"><img src="'.$img_path.'/in_red.bmp"></a> <a href="?s=out"><img src="'.$img_path.'/out_green.bmp"></a>'; } echo $o_stat; }else{ if($_GET['s'] == ("in")){ //mysql_query("UPDATE `table_name` WHERE `stat` = '1'"); header("Location: ?"); } if($_GET['s'] == ("out")){ //mysql_query("UPDATE `table_name` WHERE `stat` = '2'"); header("Location: ?"); } } ?>
  13. Woot! Topic Solved? If so click the "Topic Solved" button!
  14. I figured it out! Thank you for the suggestion on the foreach loop! code: <?php $HTML = $_POST['html']; $HTML = explode(" ",$HTML); $result = preg_replace_callback('%\b((?:www\.|http://www\.|http://).*)\b%si', 'UpdateDB', $HTML); echo "<br>Final Output<br>"; //echo $result; //print_r($result); foreach($result as $val){ echo $val; } function UpdateDB($Add) { $id = md5($Add[1]); $url = $Add[1]; //DB Con... $sql = mysql_query("SELECT * FROM `url_list` WHERE `url`='".$url."'"); if (!mysql_num_rows($sql) >= 1){ mysql_query("INSERT INTO url_list (ID, URL) values ('$id','$url')"); }else{ $r = mysql_fetch_array($sql); $id = $r['id']; } return " <a href=\"http://links.krazypicks.com?url=$id\">Link</a> "; } ?>
  15. USE THE CODE TAGS! Also, what is your question?
  16. well I am always learning something new, this however is really really new to me, I can code a php page with no problem, but somethings like this are completely new to me. So you are saying to look at a foreach loop. I will do that tomorrow! Thank you very much for your time.
  17. That is not what I am saying, but sometimes when you code a new page using short tags, you might run into some problems. Also could you post the error message you are getting, if any. If not add or die.
  18. I sure can, will only take about ten minuets, but nothing bad can come out of practice !
  19. here is an idea. create a new php page, set the images to links, and make the links like so: page.php?stat=in or out. Then create a if statement, state weather the get variable is in or out, after you stated it has been set, if the variable is in, create a query to update the database, same with out, redirect back to the previous page. Now create another if statement, ask weather in the database the user is in, echo out green in image. Same for out, I can code this for you, but it will have to wait till tomorrow.
  20. so, what is your question?
  21. databases, can you gives the reason why you cannot use session variables?
  22. always use the long tags <?php
×
×
  • 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.