Forum Moderators: phranque
http://example.com/index.php?page=about
http://example.com/about
index.php?page=to
http://example.com/$GETvariable name.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1
<li><a href="index.php?page=about">About</a></li>
http://example.com/index.php?page=about
http://example.com/about
[edited by: phranque at 2:24 pm (utc) on Jul 23, 2013]
[edit reason] Please Use Example.com [webmasterworld.com] [/edit]
glob("http://exaplesite.com/Images/*.*");
Note: This function will not work on remote files as the file to be examined must be accessible via the server's filesystem.
[php.net...]
You'll need something like:
glob($_SERVER['DOCUMENT_ROOT']."/Images/*.{jpg,jpeg,png,gif}",GLOB_BRACE);
You can shorten it if you know only images are in the directory:
glob($_SERVER['DOCUMENT_ROOT']."/Images/*");
You can shorten it if you know only images are in the directory:
glob($_SERVER['DOCUMENT_ROOT']."/Images/*");
$files=glob($_SERVER['DOCUMENT_ROOT']."/Images/Example/".$row['title']."/photos/*");
for ($i=0; $i<count($files); $i++)
{
$num = $files[$i];
echo '<a class="example-image-link" href="'.$num.'" data-lightbox="example-set" ><img class="example-image" src="'.$num.'" alt="" width="50" height="50"/></a>';
}
[edited by: nevski at 11:24 pm (utc) on Oct 12, 2013]
Still there is no change except that browser doesn't process this.
what's that _SERVER['DOCUMENT_ROOT'] even doing there?
The <img src...> tag in the final HTML isn't supposed to say
<img src = "http://www.example.com/long-complicated-physical-filepath-here/Images/Example/name-of-file"
It should only say
<img src = "/Images/Example/name-of-file"
This is echoed patch and it matches with desired location
/Images/Example Folder/photos/*
Nothing wrong with it.
But I don't know maybe this empty space Example Folder makes problem?
I would guess it's either that or a difference in the setting of the $_SERVER['DOCUMENT_ROOT'] where locally it's not set with a trailing slash, but on the testing server it is for some reason.
. DIRECTORY_SEPARATOR . echo $_SERVER['DOCUMENT_ROOT'];
result-/usr/local/apache/htdocs
$files=glob($_SERVER['DOCUMENT_ROOT']."/photos/*",GLOB_ERR);
/home/my-username a123456/public_html/
$files=glob("/home/a123456/public_html/photos/*");
print_r($files)
Array ( [0] => /home/a123456/public_html/photos/1.jpg [1] => /home/a123456/public_html/photos/2.jpg [2]
$files = glob("/home/a123456/public_html/photos/*");
$cnt=count($files); $link='';
for ($i=0; $i<$cnt; $i++)
{
echo '<img src="'.$files[$i].'"/>';
}
?>
$files = glob("/home/a123456/public_html/photos/*");
$cnt=count($files); $link='';
for ($i=0; $i<$cnt; $i++)
{
echo $files[$i];
echo '<img src="'.$files[$i].'"/>';
}
/home/a123456/public_html/photos/1.jpgin that way.But it could not load the image,and path and everything is ok,just I'm puzzled why it doen't echo image and echoes the path to it on proper way...
[edited by: nevski at 12:31 pm (utc) on Oct 13, 2013]
echo '<img src="'.$files[$i].'"/>';
But it doesn't echo any image
<?php
$files = glob("/home/a5734697/public_html/photos/*");
$cnt=count($files); $link='';
for ($i=0; $i<$cnt; $i++)
{
echo $files[$i];
echo '<img src="/photos/1.jpg"/>';
}
?>
$files = glob("/home/a123456/public_html/photos/*");
$cnt=count($files); $link='';
for ($i=0; $i<$cnt; $i++)
{
echo $files[$i];
echo '<img src="photos/'.$files[$i].'"/>';
}
$files = glob("/home/a123456/public_html/images/".$row['title']."/photos/*");
Your browser can't "walk the internal file-path" of your server, so you need to use two different paths. One is internal [for PHP]. One is external [for browsers] -- The glob() needs to be /home/a123456/public_html/photos/1.jpg. The src and href need to be /photos/1.jpg
That's what I was trying to say earlier, but was hampered by not speaking php :(
I guess that the horns started to grow ot JD's head over the process of helping me)))On mine they appeared to after 2 days for sure))
I'm sure somehow you'll be fairly fluent someday, but it takes a ton of time to get there