php - How can I extract the value of a variable and re-use that value until it is overwritten -
i have website acts blog / photo gallery. comprises php , mysql. objective able set image on homeimage dynamically. have set form posts variable (which contains relevent image filename) homepage file. pick using $_post method. works fine, until refresh homepage @ point variable no longer there , so, understandably, image no longer called. can explain how can store variable value i.e. image filename, can used until such time overwritten new image. have tried setting function returns value, can't seem hold on it!! guidance appreciated.
well, can multiple things :
- store using mysql. create table named "configuration" example, 1 field named "homepageimage" example. when want modify image on homepage, update field. when want image, query table , fetch field.
- store in file on server. have overwrite file new filename inside when want change image. fetch content of file when want display image
- create symbolic link (pointing right image), , update link every time want change image. when want display image, put name of link in img tag
Comments
Post a Comment