hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : php code help
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

php code help

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 02-11-2003, 12:19 AM
tsanghan tsanghan is offline
Newbie
 
Join Date: Nov 2002
Location: United States of America
Posts: 11

php code help


i wrote the basics can any make it so it like u define the number in brackets "[1-10]" so its imagesgrabber.php?uri=someothersite.com/images/something[1-25].jpg
instead of script.php?txt=siteurl.com/%i.jpg
PHP Code:
<html>
<head>
<title>PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php
$file_name 
$_GET['uri'];
$temp "";
for(
$i =0$i 70$i++)
{
$temp =  str_replace("%i"$i$file_name);

echo 
"<a href=\"$temp\" target=\"_blank\"><img src=\"$temp\" border=\"0\"></a>\n";
}
?>
</body>
</html>
so the varible in "[ ]" can be defined instead of
PHP Code:
for($i =0$i 70$i++) 

Reply With Quote


Sponsored Links
  #2  
Old 02-11-2003, 02:55 AM
luxline luxline is offline
WHT Addict
 
Join Date: Jan 2003
Posts: 108
php and post/get variables - they dont like square brackets.

You could use points, and php converts them to underscores

?uri=someothersite.com/images/something.1.25.jpg

or my suggestion would be to use two variables

?img_x=1&img_y=25

Dont know if that helps???

Reply With Quote
  #3  
Old 02-12-2003, 07:05 AM
Ntel Ntel is offline
Junior Guru Wannabe
 
Join Date: Feb 2003
Posts: 82
why don't just use underscore straight away

__________________
http://www.skadult.com - SK Adult Entertainment

Reply With Quote
Sponsored Links
  #4  
Old 02-12-2003, 02:25 PM
jonasf jonasf is offline
Junior Guru Wannabe
 
Join Date: Jan 2003
Posts: 82
I needed a while to understand what you're doing, or want to do, but i would suggest luxline's idea.
But if you wanna stick to your idea, you would have to replace the stuff between the [] with the i, at least if I understand the format of your pictures right...

Hope I could help

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Cloud Industry Forum Establishes Cloud Service Provider Code of Practice Web Hosting News 2012-09-21 12:38:23
DigiCert Launches Extended Validation Code Signing Certificates Web Hosting News 2012-08-15 15:30:28
Non-Profit New Zealand Computer Society to Develop Cloud Code of Practice Web Hosting News 2011-09-02 17:22:36
SSL Certificate Authority Comodo Providing Intel Application Certification Web Hosting News 2011-08-12 15:51:28
Web Host DreamHost Contributing Code for Ceph File System to OpenStack Web Hosting News 2011-06-23 20:40:32


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?