Spartan 117 Posted May 2, 2007 Share Posted May 2, 2007 Hello, I am doing something with php and I needed some help. I would like to know if there is a script or something that will automatically upload a file in a static directory (the file is a .txt with a nuber written in it, ie: 14). I would then like the script to check a file on the server (which is another txt with another number, ie: 16). I would then like to know if the first number is lower than the second one, and if so redirect to a new page, and if not it will do nothing. I have no clue how I would do this or even if it is possible. Could someone please help me? Thanks Link to comment https://forums.phpfreaks.com/topic/49578-solved-php-compare-two-numbers/ Share on other sites More sharing options...
clown[NOR] Posted May 2, 2007 Share Posted May 2, 2007 you need to read both files storing the number in each file to 2 separate vars and compare them you want to use: - fopen() - fread() Link to comment https://forums.phpfreaks.com/topic/49578-solved-php-compare-two-numbers/#findComment-243054 Share on other sites More sharing options...
Spartan 117 Posted May 2, 2007 Author Share Posted May 2, 2007 Ok, thanks I will look into that. Link to comment https://forums.phpfreaks.com/topic/49578-solved-php-compare-two-numbers/#findComment-243078 Share on other sites More sharing options...
Spartan 117 Posted May 2, 2007 Author Share Posted May 2, 2007 Thanks for pointing me in the right direction, I found what I was looking for Link to comment https://forums.phpfreaks.com/topic/49578-solved-php-compare-two-numbers/#findComment-243102 Share on other sites More sharing options...
clown[NOR] Posted May 2, 2007 Share Posted May 2, 2007 glad I could help... remember to mark the topic as solved Link to comment https://forums.phpfreaks.com/topic/49578-solved-php-compare-two-numbers/#findComment-243152 Share on other sites More sharing options...
Spartan 117 Posted May 3, 2007 Author Share Posted May 3, 2007 0oops. The solved button isn't where I am used to seeing it. Link to comment https://forums.phpfreaks.com/topic/49578-solved-php-compare-two-numbers/#findComment-243912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.