[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 10-11-2006, 01:47 PM   #1 (permalink)
www.randypendleton.com
 
Archangel's Avatar
 
Join Date: Jan 2004
Location: Southern Ohio, USA
Posts: 3,819
99.00 NP$ (Donate)

Archangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant future


Small bug in my .htaccess / mod_rewrite

I run a small script that I built up to run a small image gallery. For this thread, let's assume I'm using the domain site.com. I ran the script on an old domain; I figured I'd put the script back online, using a different domain.

With mod_rewrite, the URL to the page that display the appropriate image looked like this:

http://www.site.com/2006/02/11-2/13.html

The full mod_rewrite looks like this:

PHP Code:
RewriteEngine on
RewriteCond
%{REQUEST_URI} ^/([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).html$ [NC]
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).html$ image.php?picset=$4&date=$3&fulldate=$2$3$1&pic=$5.jpg [L,NC]
When I type in one of my mod_rewritten links, I'm taken to the proper page but the image variable doesn't pass. This error didn't occur with the last time the scripts ran, although I'm using a different variable for the images this time. I haven't even touched PHP/.htaccess in a long time and I'm not sure where the problem lies, although I'm sure it has to be a problem with the variable. The variable I use to display the images (the one I need to pass) is $picturename[$x] Could anyone help me solve this problem?
__________________
Randy L Pendleton, author -- www.RandyPendleton.com Will Be Back Soon!
cPanelHosting.com-cPanel Experts For 8 Years Hosting From $4.99 And 2 Months Free
Australia Web hosting | Political Cartoons | Social network of blogs
Archangel is online now  
Old 10-11-2006, 02:23 PM   #2 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
 
Join Date: Aug 2004
Posts: 3,794
47.60 NP$ (Donate)

stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of


Possibly in the image path

That would be the simple solution

-Steve
__________________
Follow Me on Twitter:
stscac is offline  
Old 10-11-2006, 08:14 PM   #3 (permalink)
www.randypendleton.com
 
Archangel's Avatar
 
Join Date: Jan 2004
Location: Southern Ohio, USA
Posts: 3,819
99.00 NP$ (Donate)

Archangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant future


I've tried to change image info but I failed. I've tried:

PHP Code:
RewriteEngine on
RewriteCond
%{REQUEST_URI} ^/([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).html$ [NC]
RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)-([0-9]+)/([0-9]+).html$ image.php?picset=$4&date=$3&fulldate=$2$3$1&pic=$picturename[$x] [L,NC]
And as well, I tried it with $picturename alone (minus [$x]) -- neither work. Any suggestions?
__________________
Randy L Pendleton, author -- www.RandyPendleton.com Will Be Back Soon!
cPanelHosting.com-cPanel Experts For 8 Years Hosting From $4.99 And 2 Months Free
Australia Web hosting | Political Cartoons | Social network of blogs
Archangel is online now  
Old 10-11-2006, 08:22 PM   #4 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
 
Join Date: Feb 2006
Posts: 2,801
56.00 NP$ (Donate)

Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future

Autism Autism Autism Autism Autism Autism Autism
I could help you, but I'd need to see the PHP file to see what you're trying to do with $picturename[$x]. $picturename and $x don't exist in the .htaccess.
Dan is offline  
Old 10-11-2006, 09:21 PM   #5 (permalink)
www.randypendleton.com
 
Archangel's Avatar
 
Join Date: Jan 2004
Location: Southern Ohio, USA
Posts: 3,819
99.00 NP$ (Donate)

Archangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant futureArchangel has a brilliant future


Quote:
Originally Posted by Dan
I could help you, but I'd need to see the PHP file to see what you're trying to do with $picturename[$x]. $picturename and $x don't exist in the .htaccess.
Check your PM.
__________________
Randy L Pendleton, author -- www.RandyPendleton.com Will Be Back Soon!
cPanelHosting.com-cPanel Experts For 8 Years Hosting From $4.99 And 2 Months Free
Australia Web hosting | Political Cartoons | Social network of blogs
Archangel is online now  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 02:07 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85