- Joined
- Nov 28, 2004
- Messages
- 2,236
- Reaction score
- 0
Need help from advanced php coders.
Situation: I got 1 PHP script and 1 BAT script.
The script.php contains:
script.bat contents:
so here what my script do, or it should do...
I execute script.php. It gets the current day and hour values, some text and generates such var, i.e.:
2210tomas
the problem is that dos outputs the var into file not like this:
but like this
not goint into details I will tell that I wouln't fix this, so do not bother to tell me how to do smth bout this.
ok, so we continue.
then I use md5sum.exe and generate MD5 of
then I extract the MD5SUM from the file and submit the script:
but here's where the problem comes. if I generate MD5SUM (in BAT part) of the single line with no [enter]s I get the correct code and the PHP script works. I tried to add "\n" in the php to act as the line break, but the MD5SUM of my TXT file and the one in PHP script don't match. moreover, if I try to make the complex string to be calculated with md5 command, the sums does not match (I mean when I link variables/text with ".").
So how sould I fix the PHP so the sums would match? I was thinking on making the txt file in WWW server within php script so then the structures would meet (since I can't get rid of line break in DOS)
I think I made it very complex to understand what I want
.
Please ask if it isn't clear what I want..
Situation: I got 1 PHP script and 1 BAT script.
The script.php contains:
PHP:
<?php
$str = ($_REQUEST['sid']);
$pwd = date(d).date(H)."tomas"."\n";
$secret = md5($pwd);
if ($str === $secret ) {
// I'll know what to do when everyting is OK
echo "MD5SUM is OK!\nMD5SUM is: ".$secret;
exit;
**
else {
// Will add 'die', I guess...
echo "wrong md5. md5sum is:".$secret."<BR>";
echo "DEBUG: "."PARAM: ".$str." PWD: ".$pwd." SECERT PWD MD5SUM: ".$secret."<BR>";
**
?>
Code:
set currentday= 00
rem (i'll generate the current day. dont remember syntax. doesnt matter. this gives 2 digit code)
set currenthour= 00
rem (i'll generate the current hour. dont remember syntax. doesnt matter. this gives 2 digit code)
echo %currentday%%currenthour%tomas>output.txt
md5sum output.txt> the_code.txt
rem then I extract the the_code.txt and get 32 MD5SUM code and give it to the php script. don't go into details how
so here what my script do, or it should do...
I execute script.php. It gets the current day and hour values, some text and generates such var, i.e.:
2210tomas
the problem is that dos outputs the var into file not like this:
Code:
2210tomas
Code:
2210tomas
(one empty line)
ok, so we continue.
then I use md5sum.exe and generate MD5 of
Code:
2210tomas
(one empty line)
Code:
http://..//..//script.php?sid=<the md5 sum>
So how sould I fix the PHP so the sums would match? I was thinking on making the txt file in WWW server within php script so then the structures would meet (since I can't get rid of line break in DOS)
I think I made it very complex to understand what I want
Please ask if it isn't clear what I want..

