Jump to content

[SOLVED] Url problem


beboo002

Recommended Posts

Hello All,

<?php $sql2="select * from tbl_cat where sub_cat_id='$a' ";
$res2=mysql_query($sql2,$link);//$query=mysql_fetch_row($res);
$COLS_PER_ROW = 2;
$colCount = 0;
$numRows = mysql_num_rows ($res2);
while ($row2=mysql_fetch_array($res2))
{  $am=str_replace(" ","-","$row2[cat_name]");$am2=rtrim($am,"-");
// Start a row whenever our count is divisible by the number of items in each row
   if ($colCount % $COLS_PER_ROW == 0)
   { 
      echo "<tr >";
   } 
   $totlink=$row2[id];//number of link
  $sql50="select cat_ID from addlink where cat_ID='$totlink' ";
$res50=mysql_query($sql50,$link);
$totnum=mysql_num_rows($res50);
echo "<td><td><td><td><img src='Images/folder.jpg' width=14 height=12>";
  echo"<a href=$at49/$am2-$row2[id].html class=bluelinkfont>$row2[cat_name]</a><span class=count>($totnum)</span></td></td></td></td>";
   // End the row when the last space in the row has been filled, or when there are no more items in the result set.

   if ($colCount % $COLS_PER_ROW == $COLS_PER_ROW - 1 || $colCount == $numRows - 1)
   {
      echo "</tr>";
   }
   $colCount++;
}?>

 

ON line this

echo"<a href=$at49/$am2-$row2[id].html class=bluelinkfont>$row2[cat_name]</a><span class=count>($totnum)</span></td></td></td></td>";

 

when i click the link then page will be open when i request to get value via url then it gives

 

for example

my url look like art/comics-123.html

and get  value by $_REQUEST['main_id'] and $_REQUEST['main_cat_id'].it gives $_REQUEST['main_id'] =art/comics-123 and $_REQUEST['main_cat_id']="".

 

but i want to  value like

 

$_REQUEST['main_id'] =art/comics and $_REQUEST['main_cat_id']=123.

 

Thanks

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/107751-solved-url-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.