If i will insert the request in a db I will need to make that cron job run verry offten .
What I want is this, when a user is accesing my site first in the index file will be made an verification if that phone profile alredy exist, I need few infos from the page is stored in the HTTP_PROFILE header (ex. header http://wap.sonyericsson.com/UAprof/T610R101.xml ) I need to parse that file to store in my db the size of the screen in pixels and if it is color or not. I have some doubs about how I'm gonna parse that file, I never used PHP and XML 🙁 .. but this is a diferent story.
So my script is checking in the db for existing phone profile, if already exist I will sckip the cron job , but If there is no phone profile like the curent one than a comand should update the cron job "UAPROFILES" for running in the next minute. The script which the cron job will run will do the xml parsing job and storing the results in the database.
I need this for my photo gallery, now I have only one album but soon I will have many more .. and when a user is chosing to download an wallpaper the image should fit his screen perfectly, if I know the screen size I (PHP) can play with that picture .
And I want to make my wap site with templates, for old phones and for new color phones.
Another question 🙂, I inserted this part of script
if($HTTP_PROFILE){
$actual_profile = $HTTP_PROFILE;
$chk_profile = mysql_num_rows(mysql_query("SELECT * FROM wap_phone_profile WHERE profile='$actual_profile'")) or die(mysql_error());
switch($chk_profile){
case '0' : //INSERT NEW PHONE PROFILE
$q_ins_prf = mysql_query("INSERT INTO wap_phone_profile (`id`, `profile`, `brand`) VALUES ('', '$actual_profile', '')") or die(mysql_error());
break 1;
default: break 1;
}
}
but it is curios because nothing inserted in my db in few hours 🙁 (I have aprox. 100 vizitors/day ) can I take the HTTP_PROFILE by other way ?? .. using other syntax ?
10x in advance
see ya