Uridium Posted November 27, 2022 Share Posted November 27, 2022 (edited) im sure you can use Windows task/event manager or what ever its called that runs the clocks to create crons I recall doing this back in 2013 not sure if its still possible with uptodate windows versions... Also wasnt there a EXE file on here for a Cron runner or you could just read this >> https://www.bugtreat.com/blog/how-to-setup-cron-job-in-windows-using-wampxampp-server/ Edited November 27, 2022 by Uridium extras Quote Link to comment Share on other sites More sharing options...
AlizHarb Posted November 27, 2022 Share Posted November 27, 2022 18 minutes ago, Ob4j4 said: Okay, so everything is more or less working by the looks of it but I still get errors here and there like so A non-critical error has occurred. Page execution will continue. Below are the details: PHP Deprecation Notice: htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated (8192) A non-critical error has occurred. Page execution will continue. Below are the details: PHP Deprecation Notice: htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated (8192) So I changed this by removing the htmlentities etc. <textarea rows='10' cols='50' name='pn_update'>" . htmlentities($ir['user_notepad'], ENT_QUOTES, 'ISO-8859-1') . "</textarea><br /> <textarea rows='10' cols='50' name='pn_update'>" . htmlentities($ir['user_notepad'], ENT_QUOTES, 'ISO-8859-1') . "</textarea><br /> to <textarea rows='10' cols='50' name='pn_update'>".($ir['user_notepad'])."</textarea><br /> <textarea rows='10' cols='50' name='pn_update'>".($ir['user_notepad'])."</textarea><br /> D:\ is my cd/dvd drive? And I don't have an executecron.php You’ve to read more about php injections, might risk you a lot executecron.php Is your cron file and yea C is your drive Quote Link to comment Share on other sites More sharing options...
Ob4j4 Posted November 27, 2022 Author Share Posted November 27, 2022 Yes I assume taking away the htmlentities makes it less secure. But I'm working offline and I don't know how to secure it in a different way. 1. The First thing you should do is to create a cron.php file 2. Open the file cron.php and paste or type the code given below D:\xampp\php\php.exe D:\xampp\htdocs\executecron.php The path may be varies depending upon your xampp folder 3. And now we had to schedule the task to run Click on start > All Programs > Accessories > System Tools > Scheduled Tasks and put a name for the task and in the run text field give the path of the Cron.php file and set the schedule job and its done Also are you sure this is not missing a step? I created a cron.php file In it I added the line C:\xampp\php\php.exe C:\xampp\htdocs\executecron.php Should I make a execute cron file too? If so, what do I put in it? Quote Link to comment Share on other sites More sharing options...
AlizHarb Posted November 27, 2022 Share Posted November 27, 2022 as i said i really have not tried it, i just found it in internet and thought will help you! try to include all cron files inside the cron.php and instead of htmlentities try to use htmlspecialchars Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted November 27, 2022 Share Posted November 27, 2022 For your htmlentities error you could put something like: $ir['user_notepad'] = !is_null($ir['user_notepad']) ? htmlentities($ir['user_notepad'], ENT_QUOTES, 'ISO-8859-1') : ''; Quote Link to comment Share on other sites More sharing options...
Ob4j4 Posted November 27, 2022 Author Share Posted November 27, 2022 Like this? 27 minutes ago, KyleMassacre said: For your htmlentities error you could put something like: $ir['user_notepad'] = !is_null($ir['user_notepad']) ? htmlentities($ir['user_notepad'], ENT_QUOTES, 'ISO-8859-1') : ''; Does not work Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted November 27, 2022 Share Posted November 27, 2022 (edited) It works for me on php 8.0 <form id="notepad" method="post"> <?php if(is_null($ir['user_notepad'])) { print "Notepad is null"; } else { print "Notepad is not null"; } $ir['user_notepad'] = !is_null($ir['user_notepad']) ? htmlentities($ir['user_notepad'], ENT_QUOTES, 'ISO-8859-1') : ''; ?> <textarea rows='10' cols='50' name='pn_update'><?php echo $ir['user_notepad']; ?></textarea> </form> Edited November 27, 2022 by KyleMassacre Added 1 more image Quote Link to comment Share on other sites More sharing options...
Ob4j4 Posted November 27, 2022 Author Share Posted November 27, 2022 (edited) Parse error: syntax error, unexpected identifier "notepad", expecting "," or ";" in C:\xampp\htdocs\index.php on line 58 Edited November 27, 2022 by Ob4j4 Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted November 27, 2022 Share Posted November 27, 2022 You didnt terminate your echo string on line 58 and you can delete lines 59 through 66 Quote Link to comment Share on other sites More sharing options...
ags_cs4 Posted November 28, 2022 Share Posted November 28, 2022 you echo is not closed and you cant have the string opening tags like that, you should have that like like this echo '<hr />Your Personal Notepad:<form id="notepad" method="POST">'; Quote Link to comment Share on other sites More sharing options...
Ob4j4 Posted November 28, 2022 Author Share Posted November 28, 2022 Parse error: syntax error, unexpected string content "", expecting "-" or identifier or variable or number in C:\xampp\htdocs\index.php on line 60 Quote Link to comment Share on other sites More sharing options...
Inveteratus Posted November 28, 2022 Share Posted November 28, 2022 It should be noted that in your error above; you are using a <?php ... ?> statement block within a string, sorry; it doesn't work like that. The simplest option would be to replace line 60 with echo "<textarea rows='10' cols='50' name='pn_update'>{$ir['user_notepad']}</textarea>"; It might be an idea to get yourself some tools to help cleaning up your code-base; PHPStan which is a static analyser, and ideally an editor that really understands the language; ie PhpStorm. Both can help a lot when trying to get a code-base as poor as this is up and running. Out of the box, PHPStan will find around 60 problems with the code at level 0, running it at level 9 will find in excess of 2,000 problems! I find that if you are wanting to make a working product from a legacy code-base, start at level 0, clean up those problems, increase the level; rinse and repeat. By the time you hit level 6 it is potentially ready to open to the world, however with this particular code, there are lots of gotcha's that will bite you without a lot of care. And it doesn't take a lot of time. If memory serves me, I was able to clean a stock mccodes up to level 6 in around 3 hours - okay, I know the code fairly well, but it's not difficult nor overly time-consuming as long as you start small. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.