I need my webpage to clear tempoary internet files when a user visits my web page so that the images in my webpage www.fcestates.co.uk/index.php? actually shows the images all the time for propertys in the MySQL database website above. Does anyone know if i can do this with some special html code that tells the browser to delete the temporay internet files folder contents. Or is there a php code, or does ajax allow you to embed code into your webpage/script. If there is some code can someone paste in thier reply with ins6ructions on where to paste it say in the header or body? Surley the solution cant be just to tell the user to delete the temporary internet files ?
UUUUUUUmmmmmmmmmm
19 1981 MMcCarthy 14,534
Recognized Expert Moderator MVP
You have posted this in the Articles section. I am moving it to the Javascript forum.
ADMIN
iam_clint 1,208
Recognized Expert Top Contributor
when you link an image
<img src="blah.jpg">
do this
<img src="blah.jpg?rnd=(make php or whatever toss a random number here)">
example
<img src="blah.jpg?rnd=123213">
this will stop it from being pulled from cache
when you link an image
<img src="blah.jpg">
do this
<img src="blah.jpg?rnd=(make php or whatever toss a random number here)">
example
<img src="blah.jpg?rnd=123213">
this will stop it from being pulled from cache
OK IamClint
The issue is that i have a php script and when i look at the property_view page in the script, it has an image place holder for the property image and it is called {PICTURE}
and i have below part of the property_view.php script relating to the {PICTURE}
comment, example
<img src="blah.jpg?rnd=123213">
this will stop it from being pulled from cache
below is part of the code is this what i should be editing or is it somewhere else?
if($dbu->f('picture'))
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.UPLOAD_PATH.$dbu->f('picture'));
}
else
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.'img/na_big.gif');
}
$i=0;
if($dbu->f('thumb'))
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
$dbu->query("select * from image where property_id='".$glob['property_id']."' order by image_id");
while($dbu->move_next())
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
if($i > 1)
{
$ft->parse('IMAGES_OUT','.images');
$ft->clear_dynamic('IMAGES_OUT','image_row');
}
}
CAN YOU TELL ME HOW OR what to add this img src extension ?
Sorry if i seem to be daft , its because i am a newbi.
thejobdone
You cannot clear temporary internet files but you can control the caching of your page. Caching Tutorial.
OK Buddy,
It looks like you understood how to help me , so i will study this and get back to you soon.
thejobdone
OK I am back, and after reading the cache tutorial I have to say that my head is hurting me big time.
Is there just some code i can paste into my webpage, and save me from this Abyss. Please look at my website www.fcestates.co.uk and see for yourself, and if possible give me the best code to put in my webpage , including which pages to put it on , like should i put this on the http://www.fcestates.co.uk/index.php?pag=property_view&property_id=17 , page , or just on the home.html page .....which is the homepage .
Any ideas ?
thejobdone
I am using Apache 2.0’s servers configuration , just to add
thejobdone
And also my pages, show the image 1st time you visit but if you ignore the site for 3 minutes then non of the images come up until you clear your cache so i probably want the pages to expire after minutes not days.
thejobdone
ronnil 134
Recognized Expert New Member
this is your location of the image file right?
$site_url.UPLOAD_PATH.$dbu->f('picture')
to this you add what iamclint said, making it look like
$site_url.UPLOAD_PATH.$dbu->f('picture') .'?' . rand()
this way your image will always recache
this is your location of the image file right?
$site_url.UPLOAD_PATH.$dbu->f('picture')
to this you add what iamclint said, making it look like
$site_url.UPLOAD_PATH.$dbu->f('picture') .'?' . rand()
this way your image will always recache
I cannot see the exact same path above on the property_view page. Are you saying that i should put this extension manually on all the images in the upload folder should i be looking in the phpMyadmin. Do please look at the code of each page. Yes i do have an upload folder on the publice_html directory.
I cannot see the exact same path above on the property_view page. Are you saying that i should put this extension manually on all the images in the upload folder should i be looking in the phpMyadmin. Do please look at the code of each page. Yes i do have an upload folder on the publice_html directory.
And tell me what to add where , if i see i can get it
I have the page
http://www.fcestates.co.uk/index.php?pag=property_view&property_id=15
And on there i have a image place holder that says in property inspector of dreamweaver 8, that in source it is {PICTURE} and the thumbnail says {TUBNAIL} so are you saying i add the ? mark bit to this bit or can you tell me which page of the site and rufly what area of the pages code i shoyuld be ammending and to where, as in paste the code into your reply and [paste the url of where that code is in the website
Or should i be adding this comment to phpMyadmin. I think your directing me to edit the webpage but please send my the webpage url and the corrected code and where that code is on the page. . This is a php script.
I think i really have proved i am slow
OK i found the reference to the .'?' . rand() and it is in the property_view.php page,
i have the code in the php page
for references to the path you specifed below, can you edit them and reply with exactely how they should end with the new code, beacause i am not sure where the brackets should end.
$ft->assign("PICTURE", $site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign("PICTURE", $site_url.'img/na_big.gif');
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
Please ammend above list with new code cos i dont know if i am to put it between brackets at end or not.
thejobdone
here is the whole of property_view.php
<?php
$now=strtotime("now");
$dbu=new mysql_db;
$ft = new ft(ADMIN_PATH."");
$ft->define(array('main' => "property_view.html"));
$ft->define_dynamic('images','main');
$ft->define_dynamic('image_row','images');
$ft->define_dynamic('int_feature','main');
$ft->define_dynamic('int_features','int_feature');
$ft->define_dynamic('int_feature_row','int_features' );
$ft->define_dynamic('int_blank_row','int_features');
$ft->define_dynamic('ext_feature','main');
$ft->define_dynamic('ext_features','ext_feature');
$ft->define_dynamic('ext_feature_row','ext_features' );
$ft->define_dynamic('ext_blank_row','ext_features');
$ft->define_dynamic('feature','main');
$ft->define_dynamic('features','feature');
$ft->define_dynamic('feature_row','features');
$ft->define_dynamic('blank_row','features');
$ft->define_dynamic('appliance','main');
$ft->define_dynamic('appliances','appliance');
$ft->define_dynamic('appliance_row','appliances');
$ft->define_dynamic('blank_row2','appliances');
$ft->assign('PICTURE_WIDTH',PICTURE_WIDTH);
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
if($glob['search1'])
{
$arguments="&search1=".$glob['search1'];
}
if($glob['type_id'])
{
$arguments.="&type_id=".$glob['type_id'];
}
if($glob['envirement_id'])
{
$arguments.="&envirement_id=".$glob['envirement_id'];
}
if($glob['s_price'])
{
$arguments.="&s_price=".$glob['s_price'];
}
if($glob['e_price'])
{
$arguments.="&e_price=".$glob['e_price'];
}
if($glob['country'])
{
$arguments.="&country=".$glob['country'];
}
if($glob['state'])
{
$arguments.="&state=".$glob['state'];
}
if($glob['search_key'])
{
$arguments.="&search_key=".$glob['search_key'];
}
if($glob['offset'])
{
$arguments.="&offset=".$glob['offset'];
}
$ft->assign('BACK_LINK', "index.php?pag=".$glob['pagold'].$arguments);
if(!is_numeric($glob['property_id']))
{
unset($ft);
return get_error_message("Invalid Entry.");
}
else
{
$dbu->query("select distinct property.*, type.name as type_name, envirement.name as envirement_name from property
inner join type on property.type=type.type_id
inner join envirement on property.envirement=envirement.envirement_id
where property.property_id='".$glob['property_id']."'");
if(!$dbu->move_next())
{
unset($ft);
return get_error_message("Invalid Entry.");
}
$description=get_safe_text($dbu->f('description'));
if(!$dbu->f('description'))
{
$ft->assign(array(
"S_DESCRIPTION" => '<!--',
"E_DESCRIPTION" => '-->'
));
}
else
{
$ft->assign(array(
"S_DESCRIPTION" => '',
"E_DESCRIPTION" => ''
));
}
if(!$dbu->f('state'))
{
$ft->assign(array(
"S_STATE" => '<!--',
"E_STATE" => '-->'
));
}
else
{
$ft->assign(array(
"S_STATE" => '',
"E_STATE" => ''
));
}
if(!$dbu->f('city'))
{
$ft->assign(array(
"S_CITY" => '<!--',
"E_CITY" => '-->'
));
}
else
{
$ft->assign(array(
"S_CITY" => '',
"E_CITY" => ''
));
}
if(!$dbu->f('zip'))
{
$ft->assign(array(
"S_ZIP" => '<!--',
"E_ZIP" => '-->'
));
}
else
{
$ft->assign(array(
"S_ZIP" => '',
"E_ZIP" => ''
));
}
if(!$dbu->f('address'))
{
$ft->assign(array(
"S_ADDRESS" => '<!--',
"E_ADDRESS" => '-->'
));
}
else
{
$ft->assign(array(
"S_ADDRESS" => '',
"E_ADDRESS" => ''
));
}
if(!$dbu->f('bedrooms'))
{
$ft->assign(array(
"S_BEDS" => '<!--',
"E_BEDS" => '-->'
));
}
else
{
$ft->assign(array(
"S_BEDS" => '',
"E_BEDS" => ''
));
}
if(!$dbu->f('bathrooms'))
{
$ft->assign(array(
"S_BATHS" => '<!--',
"E_BATHS" => '-->'
));
}
else
{
$ft->assign(array(
"S_BATHS" => '',
"E_BATHS" => ''
));
}
if(!$dbu->f('stories'))
{
$ft->assign(array(
"S_STORIES" => '<!--',
"E_STORIES" => '-->'
));
}
else
{
$ft->assign(array(
"S_STORIES" => '',
"E_STORIES" => ''
));
}
if(!$dbu->f('living_area'))
{
$ft->assign(array(
"S_L_A" => '<!--',
"E_L_A" => '-->'
));
}
else
{
$ft->assign(array(
"S_L_A" => '',
"E_L_A" => ''
));
}
if(!$dbu->f('lot_size'))
{
$ft->assign(array(
"S_L_S" => '<!--',
"E_L_S" => '-->'
));
}
else
{
$ft->assign(array(
"S_L_S" => '',
"E_L_S" => ''
));
}
if(!$dbu->f('year_built'))
{
$ft->assign(array(
"S_YEAR" => '<!--',
"E_YEAR" => '-->'
));
}
else
{
$ft->assign(array(
"S_YEAR" => '',
"E_YEAR" => ''
));
}
if(!$dbu->f('materials'))
{
$ft->assign(array(
"S_MAT" => '<!--',
"E_MAT" => '-->'
));
}
else
{
$ft->assign(array(
"S_MAT" => '',
"E_MAT" => ''
));
}
if(!$dbu->f('heating'))
{
$ft->assign(array(
"S_HEAT" => '<!--',
"E_HEAT" => '-->'
));
}
else
{
$ft->assign(array(
"S_HEAT" => '',
"E_HEAT" => ''
));
}
if($dbu->f('sale_rent')==1)
{
$ft->assign(array(
"S_M_PRICE" => '<!--',
"E_M_PRICE" => '-->',
"S_Y_PRICE" => '<!--',
"E_Y_PRICE" => '-->',
"S_PRICE" => '',
"E_PRICE" => '',
"S_TAX" => '',
"E_TAX" => ''
));
}
if($dbu->f('sale_rent')==2)
{
$ft->assign(array(
"S_M_PRICE" => '',
"E_M_PRICE" => '',
"S_Y_PRICE" => '',
"E_Y_PRICE" => '',
"S_PRICE" => '<!--',
"E_PRICE" => '-->',
"S_TAX" => '<!--',
"E_TAX" => '-->'
));
}
if(!$dbu->f('tax'))
{
$ft->assign(array(
"S_TAX" => '<!--',
"E_TAX" => '-->'
));
}
$ft->assign(array(
"PROPERTY_ID" => $dbu->f('property_id'),
"ID" => $dbu->f('id'),
"TYPE" => $dbu->f('type_name'),
"ENV" => $dbu->f('envirement_name'),
"STATE" => $dbu->f('state'),
"COUNTRY" => $dbu->f('country'),
"ZIP" => $dbu->f('zip'),
"CITY" => $dbu->f('city'),
"ADDRESS" => get_safe_text($dbu->f('address')),
"BEDS" => $dbu->f('bedrooms'),
"BATHS" => $dbu->f('bathrooms'),
"STORIES" => $dbu->f('stories'),
"L_A" => number_format($dbu->f('living_area'), 0, ',', '.'),
"L_A_UNIT" => get_unit($dbu->f('living_area_unit')),
"L_S" => number_format($dbu->f('lot_size'), 0, ',', '.'),
"L_S_UNIT" => get_unit($dbu->f('lot_size_unit')),
"YEAR" => $dbu->f('year_built'),
"MAT" => $dbu->f('materials'),
"HEAT" => $dbu->f('heating'),
"TAX" => number_format($dbu->f('tax'), 0, ',', '.')." Euros",
"PRICE" => ($dbu->f('price')!='0'?number_format($dbu->f('price'), 0, ',', '.').' £':'Contact Us'),
"M_PRICE" => ($dbu->f('monthly_price')!='0'?number_format($dbu->f('monthly_price'), 0, ',', '.').' £':'Contact Us'),
"Y_PRICE" => ($dbu->f('yearly_price')!='0'?number_format($dbu->f('yearly_price'), 0, ',', '.').' £':'Contact Us'),
"DESCRIPTION" => $description
)
);
if($dbu->f('picture'))
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.UPLOAD_PATH.$dbu->f('picture'));
}
else
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.'img/na_big.gif');
}
$i=0;
if($dbu->f('thumb'))
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
$dbu->query("select * from image where property_id='".$glob['property_id']."' order by image_id");
while($dbu->move_next())
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
if($i > 1)
{
$ft->parse('IMAGES_OUT','.images');
$ft->clear_dynamic('IMAGES_OUT','image_row');
}
}
//**Build Interior features********************
$dbu->query("select int_feature.name, int_feature.int_feature_id from property_int_feature
inner join int_feature on int_feature.int_feature_id = property_int_feature.int_feature_id where property_int_feature.property_id='".$glob['property_id']."'");
$i=0;
$j=0;
while($dbu->move_next())
{
$i++;
$j++;
$ft->assign('INT_FEATURE_NAME', $dbu->f('name'));
$ft->parse('INT_FEAT_OUT','.int_feature_row');
if($i==3)
{
$ft->parse('INT_FEATS_OUT','.int_features');
$ft->clear("INT_FEAT_OUT");
$ft->clear_dynamic('INT_FEATS_OUT','int_blank_row');
$i=0;
}
}
if($i!=3 && $i>0)
{
$ft->assign('INT_WIDTH', (3-$i)*185 );
$ft->parse('INT_BLANK_OUT','.int_blank_row');
}
$ft->parse('INT_FEATS_OUT','.int_features');
$ft->clear_dynamic('INT_FEATS_OUT','int_feature_row' );
$ft->clear_dynamic('INT_FEATS_OUT','int_blank_row');
if($j!=0)
{
$ft->parse('INT_FEATURE_OUT','.int_feature');
$ft->clear_dynamic('INT_FEATURE_OUT','int_features') ;
}
//**End Interior features**************************
//**Build Exterior Features********************
$dbu->query("select ext_feature.name, ext_feature.ext_feature_id from property_ext_feature
inner join ext_feature on ext_feature.ext_feature_id = property_ext_feature.ext_feature_id where property_ext_feature.property_id='".$glob['property_id']."'");
$i=0;
$j=0;
while($dbu->move_next())
{
$i++;
$j++;
$ft->assign('EXT_FEATURE_NAME', $dbu->f('name'));
$ft->parse('EXT_FEAT_OUT','.ext_feature_row');
if($i==3)
{
$ft->parse('EXT_FEATS_OUT','.ext_features');
$ft->clear("EXT_FEAT_OUT");
$ft->clear_dynamic('EXT_FEATS_OUT','ext_blank_row');
$i=0;
}
}
if($i!=3 && $i>0)
{
$ft->assign('EXT_WIDTH', (3-$i)*185 );
$ft->parse('EXT_BLANK_OUT','.ext_blank_row');
}
$ft->parse('EXT_FEATS_OUT','.ext_features');
$ft->clear_dynamic('EXT_FEATS_OUT','ext_feature_row' );
$ft->clear_dynamic('EXT_FEATS_OUT','ext_blank_row');
if($j!=0)
{
$ft->parse('EXT_FEATURE_OUT','.ext_feature');
$ft->clear_dynamic('EXT_FEATURE_OUT','ext_features') ;
}
//**End Exterior Features**************************
//**Build Location Features********************
$dbu->query("select feature.name, feature.feature_id from property_feature
inner join feature on feature.feature_id = property_feature.feature_id where property_feature.property_id='".$glob['property_id']."'");
$i=0;
$j=0;
while($dbu->move_next())
{
$i++;
$j++;
$ft->assign('FEATURE_NAME', $dbu->f('name'));
$ft->parse('FEAT_OUT','.feature_row');
if($i==3)
{
$ft->parse('FEATS_OUT','.features');
$ft->clear("FEAT_OUT");
$ft->clear_dynamic('FEATS_OUT','blank_row');
$i=0;
}
}
if($i!=3 && $i>0)
{
$ft->assign('WIDTH', (3-$i)*185 );
$ft->parse('BLANK_OUT','.blank_row');
}
$ft->parse('FEATS_OUT','.features');
$ft->clear_dynamic('FEATS_OUT','feature_row');
$ft->clear_dynamic('FEATS_OUT','blank_row');
if($j!=0)
{
$ft->parse('FEATURE_OUT','.feature');
$ft->clear_dynamic('FEATURE_OUT','features');
}
//**End Location Features**************************
//**Build Appliances*******************************
$dbu->query("select appliance.name, appliance.appliance_id from property_appliance
inner join appliance on appliance.appliance_id = property_appliance.appliance_id where property_appliance.property_id='".$glob['property_id']."'");
$i=0;
$j=0;
while($dbu->move_next())
{
$i++;
$j++;
$ft->assign('APPLIANCE_NAME', $dbu->f('name'));
$ft->parse('APPL_OUT','.appliance_row');
if($i==3)
{
$ft->parse('APPLS_OUT','.appliances');
$ft->clear("APPL_OUT");
$ft->clear_dynamic('APPLS_OUT','blank_row2');
$i=0;
}
}
if($i!=3 && $i>0)
{
$ft->assign('WIDTH2', (3-$i)*185 );
$ft->parse('BLANK_OUT2','.blank_row2');
}
$ft->parse('APPLS_OUT','.appliances');
$ft->clear_dynamic('APPLS_OUT','appliance_row');
$ft->clear_dynamic('APPLS_OUT','blank_row2');
if($j!=0)
{
$ft->parse('APPLIANCE_OUT','.appliance');
$ft->clear_dynamic('APPLIANCE_OUT','appliances');
}
//**End Appliances
$ft->assign('MESSAGE',$glob['error']);
$ft->assign('PROPERTY_ID',$glob['property_id']);
$ft->parse('CONTENT','main');
$ft->clear_dynamic('CONTENT','images');
$ft->clear_dynamic('CONTENT','int_feature');
$ft->clear_dynamic('CONTENT','ext_feature');
$ft->clear_dynamic('CONTENT','feature');
$ft->clear_dynamic('CONTENT','appliance');
$ft->fetch('CONTENT');
return $ft->fetch('CONTENT');
?>
PLEASE AMMEND THE CODE AND PASTE IT INTO NEW REPLY BECAUSE I AM NOT SURE IF I SHOULD PUT THE FIX BEFORE OR AFTER THE END OF THE BRACKETS AT THE END. SOME OF THEM HAVE DOUBLE )) BRACKETS AND A ; CLOSE
SOmeone in thescript.com said below:
this is your location of the image file right?
$site_url.UPLOAD_PATH.$dbu->f('picture')
to this you add what iamclint said, making it look like
$site_url.UPLOAD_PATH.$dbu->f('picture') .'?' . rand()
this way your image will always recache
Thius is to solve a problem i am having with images not always appearing on property_view.php page of my website www.fcestates.co.uk,
Now looking at the relvant code area of the php page below;
if($dbu->f('picture'))
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.UPLOAD_PATH.$dbu->f('picture'));
}
else
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.'img/na_big.gif');
}
$i=0;
if($dbu->f('thumb'))
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
$dbu->query("select * from image where property_id='".$glob['property_id']."' order by image_id");
while($dbu->move_next())
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
if($i > 1)
{
$ft->parse('IMAGES_OUT','.images');
$ft->clear
do i paste the .'?' . rand()
at the end of last bracket or betweenm the last 2 brackets ; to install this command correctly, can someone copy and paste the ammened code cos i am not sure to put it where, before the last bracket and close; statment ?
THIS IS FOR iam_clint
In a thread from you you said that
Re: I need my webpage to clear tempoary internet file
--------------------------------------------------------------------------------
when you link an image
<img src="blah.jpg">
do this
<img src="blah.jpg?rnd=(make php or whatever toss a random number here)">
example
<img src="blah.jpg?rnd=123213">
this will stop it from being pulled from cache
and THEN ANOTHER BLOGGER SAID THIS ....
--------------------------------------------------------------------------------
this is your location of the image file right?
$site_url.UPLOAD_PATH.$dbu->f('picture')
to this you add what iamclint said, making it look like
$site_url.UPLOAD_PATH.$dbu->f('picture') .'?' . rand()
this way your image will always recache
--------------------------------------------------------------------------------
Report Reply
And to be honest with you i am baffled with this, I have the part of the code for the php code page property_view.php and i am not sure how to implement this
on the below script, can you amend it with the corrected code and send it back to me, I have also attached below code in text file.
PLEASE COULD YOU amend ATTACHED SHORT CODE AND SEND IT BACK TO ME, I TRIED IT MY WAY BUT I AM SURE I AM DOING IT WRONG , COS THE IMAGES STILL DON'T LOAD, SO IF YOU COULD amend IT THEN SEND IT BACK TO ME I WOULD DEARLY APPRECIATE YOUR HELP.
i PROMISE NOT TO MAIL YOU AGAIN, SO DONT WORRY I AM NOT A SPAM MAN, I HATE THE STUFF, HAHA, THERE ARE 6 REFERENCES TO THE IMAGES DIRECTORY
if($dbu->f('picture'))
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.UPLOAD_PATH.$dbu->f('picture'));
}
else
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.'img/na_big.gif');
}
$i=0;
if($dbu->f('thumb'))
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
$dbu->query("select * from image where property_id='".$glob['property_id']."' order by image_id");
while($dbu->move_next())
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
if($i > 1)
{
$ft->parse('IMAGES_OUT','.images');
$ft->clear_dynamic('IMAGES_OUT','image_row');
}
}
iam_clint 1,208
Recognized Expert Top Contributor
$random = (rand()%200);
$ft->assign("PICTURE", $site_url.UPLOAD_PATH.$dbu->f('picture').'?p='.$random);
Cant someone edit the below code and paste it into the reply ? This answer unfortunately i do not understand, now this is my 3rd solution and all three i do not know how to correct the code, do i do all the 6 refernces to images in below script.
PLEASE EDIT BELOW WITH ABOVE SOLUTION and paste into reply, please copy edit and paste it inot the reply
if($dbu->f('picture'))
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.UPLOAD_PATH.$dbu->f('picture'));
}
else
{
$ft->assign(array(
"S_MAIN_IMAGE" => '',
"E_MAIN_IMAGE" => ''
));
$ft->assign("PICTURE", $site_url.'img/na_big.gif');
}
$i=0;
if($dbu->f('thumb'))
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
$dbu->query("select * from image where property_id='".$glob['property_id']."' order by image_id");
while($dbu->move_next())
{
$i++;
$ft->assign('TUBNAIL', $site_url.UPLOAD_PATH.$dbu->f('thumb'));
$ft->assign('IMAGE',$site_url.UPLOAD_PATH.$dbu->f('picture'));
$ft->assign('THUMBNAIL_WIDTH',THUMBNAIL_WIDTH);
$ft->parse('IMG_OUT','.image_row');
}
if($i > 1)
{
$ft->parse('IMAGES_OUT','.images');
$ft->clear
ronnil 134
Recognized Expert New Member
As i think i stated in the reply, you need to add '?somerandomnumber' to the end of your file path. this can be done with the string concatenator '.' and the function rand().
you first start by placing the '?' sign after your original url (everything before the question mark is treated as an url), afterwards you add the random number.
If I'm reading the code correctly this is the url string of an image
$site_url.UPLOAD_PATH.$dbu->f('picture')
whilst this another
$site_url.UPLOAD_PATH.$dbu->f('thumb')
what you then do is add the question mark and the result of the rand function so the snippets look like this:
$site_url.UPLOAD_PATH.$dbu->f('picture').'?'.rand()
$site_url.UPLOAD_PATH.$dbu->f('thumb').'?'.rand()
say for instance $site_url.UPLOAD_PATH.$dbu->f('picture') equals
$site_url = http://www.example.com;
UPLOAD_PATH = '/uploaddir/'
$dbu->f('picture') = 'image.jpg
your url will then look like this:
http://www.example.com/uploaddir/image.jpg
when you add '?'.rand() to $site_url.UPLOAD_PATH.$dbu->f('picture')
it will then produce something like:
http://www.example.com/uploaddir/image.jpg?23456
Hope you're getting the hang of it now
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tobias Nilsson |
last post by:
Hello,
I'm trying to run a very basic winform dll (just some graphics to show it's
executing) locally on my PC by calling it from a webpage... (not using IIS
or anything else)... I'm used by doing this with java applets for years and
it works fine...
The .dll file is in the same directory as the webpage file...
The problem is that it not...
|
by: regrat |
last post by:
It's possible create a javascript which counts all words in a webpage
until the point in which I click with the mouse.
Any suggests?
|
by: ondeathsdoorstep |
last post by:
Is there any plug-ins for "tempoary link downloads" after purchases using zen cart. I found Master Form V4 but have no idea if its compatible or how to integrate it if it is, which i doubt. Hopefully it would be opensource script but wouldnt mind paying...
Thanks for your help...
|
by: Manfred |
last post by:
Hi,
When I click any link on this page
http://free.pages.at/staudinger/Regest/Regesten/_A1601-02-08-01657.xml
it only "works" with IE 6 but not in IE 7.
I need to know:
1. Does IE 7 throw an error msg?
2. Line number ?
I would greatly appreciate any help.
|
by: M.L. |
last post by:
When loaded from my hard drive, the webpage I'm working on renders fine
on IE6, Firefox 2.0.0.1, and Opera 9.02. However, after uploading it to
the web there are 2 images that fail to display on those browsers. All
the other images and everything else on the page render just fine.
1.) I converted one of the gif images to a jpeg but that made...
| |
by: Lorie0114 |
last post by:
Hello,
We have an issue that I do not know how to resolve. Our website has several hundred reports. There are a handful of them that are causing issues when there is no interaction for a couple of minutes between client and web server. We are using .NET 2005, Framework 2.0 with an Oracle 9i database.
Our application has several hundred...
|
by: Jetus |
last post by:
Is there a good place to look to see where I can find some code that
will help me to save webpage's links to the local drive, after I have
used urllib2 to retrieve the page?
Many times I have to view these pages when I do not have access to the
internet.
|
by: levi2713 |
last post by:
We have IP cameras that we can view by putting the IP address in a web
browser. This is a control panel type webpage, but I can go a step
further and go to http://<ip address>/capture.html and it serves a
webpage with snapshot of what the camera is viewing when the webpage
is served. I want to save that particular image to a file. I looked...
|
by: Studlyami |
last post by:
Hey all, I'm trying to create a simple (I think it should be simple) batch file. I want this file to open Internet Explorer 6 go to the webpage SIRIUS Satellite Radio - The Best Radio On Radio and run the javascript: launchPlayer(",",","); Is this possible? I don't know anything about batch files and i only got to the point where i can open the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |