Jump to content
MakeWebGames

Installer not working


Ob4j4

Recommended Posts

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 by Uridium
extras
Link to comment
Share on other sites

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 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

It works for me on php 8.0

image.png.6098a04335dafe47f544d02d480b1e9c.png

image.thumb.png.7f090a43a4a52cd9ff8ce390e402b110.png

<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 by KyleMassacre
Added 1 more image
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...