4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 mod_rewrite conundrum
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
php4ever
Junior WebHelper
Junior WebHelper


Joined: 10 Oct 2002
Posts: 49

PostPosted: Thu Aug 21, 2003 10:46 pm (14 years, 2 months ago) Reply with QuoteBack to Top

I have a .htaccess file that has the following:

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^making_tables/item([0-9])$ making_tables.php?tablenum=$1

This only partially works in that the url is correctly rewritten but then it's as if the php script loses its connection to the PHP engine as the script is dead in the water. Yet when I run the php script with its normal url everything works.

Any ideas why this might be happening? Confused

Thanks,
php4ever
OfflineView User's ProfileFind all posts by php4everSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sat Aug 23, 2003 12:07 am (14 years, 2 months ago) Reply with QuoteBack to Top

I'm not sure I quite understand you....what exactly happens with the php script?

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
php4ever
Junior WebHelper
Junior WebHelper


Joined: 10 Oct 2002
Posts: 49

PostPosted: Mon Aug 25, 2003 10:47 pm (14 years, 2 months ago) Reply with QuoteBack to Top

OKay, here's the php script making_tables.php

<?php

$LIMIT = $_GET['tablenum'];

if ($LIMIT > 10) {
$LIMIT = 1;
}else if ($LIMIT < 0) {
$LIMIT = 1;
}


function MakeTable($bgclr,$i,$txclr) {
?>
<TABLE border=0 style="border:3px solid lightgrey;background:<?php echo $bgclr ?>;color:<?php echo $txclr ?>" width="70%">
<TR align="left"><TH><B><?php echo $i ?>.</b>
</tr>
<TR>
<TD align="right" width="25%">Image</td><TD><input NAME="IM[<?php echo $i ?>]" type="text" SIZE="40" MAXLENGTH="100">
</td>
</tr>
<TR>
<TD align="right">Width</td><TD><INPUT NAME="WI[<?php echo $i ?>]" SIZE="40" MAXLENGTH="100">
</td>
</tr>
<TR>
<TD align="right">Height</td><TD><INPUT NAME="HI[<?php echo $i ?>]" SIZE="40" MAXLENGTH="100">
</td>
</tr>
</table>
<p></p>
<?php }// end MakeTable()

for ($num=1; $num<=$LIMIT; $num++) {
$clr = ($num % 2)? 'lightsteelblue' : 'silver';
$tx = ($num % 2)? 'maroon' : 'black';
MakeTable( $clr, $num, $tx );
}
?>

and I've slightly modified my .htaccess and it is as follows:

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^making_tables/([0-9]+)$ making_tables.php?tablenum=$1

However, this still doesn't work right. The url with the query string is rewritten but the php seems to just die. Any help you can offer I'd greatly appreciate!

--php4ever
OfflineView User's ProfileFind all posts by php4everSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.061274 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme