Jump to content

Search the Community

Showing results for tags 'PHP'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 17 results

  1. I make plugins for WordPress and am dissatisfied with the built-in editor. I'm now looking for a way to format the PHP code like TIDY does in AU3-Editor. I've already tried some online tools but they are buggy or have too few formatting options. Buggy: http://www.phpformatter.com/ Missing options: https://homepage-kosten.de/php_beautifier.php Here is the code to check if the beautifier is buggy: <?php /* Version: 2021.08.08#1 */ exit ( ' Version is: ' . chop ( substr ( file ( __FILE__ ) [ 2 ] , 9 , 13 ) ) ) ; /* Output from PHP Formatter: Format Error on line 5: parse error, unexpected '['([), expecting ')'! Output in Browser: Version is: 2021.08.08#1 */ ?> It would be great if you showed me a link to another beautifier that is not buggy and has options for compression. e.g. do not put comments in a new line. Or even better, a hint as to which PHP editor in WordPress meets these requirements. TIA Exit
  2. I've made this HTTP lib to simplify HTTP requests, mainly when dealing about POST data or file uploads. Three functions are available: string _HTTP_Get ( string $sURL ) string _HTTP_Post ( string $sURL , string $sPostData ) string _HTTP_Upload ( string $sURL , string $sFilePath , string $sFileField , string $sPostData = '' , string $sFilename = Default) Additionaly, two helper functions are also available: URLEncode($sStr) URLDecode($sStr) Full documentation: https://github.com/jesobreira/HTTP.au3/blob/master/README.md Fork me on Github: https://github.com/jesobreira/HTTP.au3 Download lib + docs: https://github.com/jesobreira/HTTP.au3/archive/master.zip
  3. here's some PHP code to access AutoIt functions from php: https://github.com/divinity76/autoit_php - as of writing, only 5 functions are added: MouseMove and MouseClick and _ScreenCapture_Capture and WinWaitActive and Send, it also has support for running in Cygwin (which is where i've developed it, but it *should*, in theory, run on normal php-cli for windows as well.), is there any community interest for this? example usage <?php require_once("autoit.class.php"); $au = new AutoIt(); $au->MouseMove(10, 10, 5); $au->MouseClick("left"); echo "waiting up to 5 seconds for notepad window.."; if($au->WinWaitActive("[CLASS:Notepad]","",5)){ echo "found notepad!\n"; $au->Send("hello from autoit_php"); }else{ echo "timed out while waiting for notepad.\n"; } $imageBinary = $au->_ScreenCapture_Capture(); var_dump(strlen($imageBinary), imagecreatefromstring($imageBinary)); (i wanted to use some autoit functions from php-cli, and google wasn't of much help this time..)
  4. Here is a complete example of combining Autoit with PHP and MySQL was written by me. Include: Sign in, sign out.Create, read, update and delete data between client (AutoIt) and server (PHP/MySQL).Only allow user to log into a client at the same time. Video demo: https://www.youtube.com/watch?v=gQyfXLO0pls Screenshot (Main GUI) Usage If you want to test on your computer, you will need to create a localhost. I recommend to use WAMP or XAMPP. First, create a new database by importing from SETUP.sql file (see video for more info). Then, edit your path to SERVER in AutoIt-PHP-MySQL.au3: Global Const $SERVER = 'http://localhost/AutoIt/index.php?act='Make sure you have copied all files in the folder "PHP + MySQL" into a folder named AutoIt in your Localhost (www or htdocs directory). Yeah, now you can open the file "AutoIt-PHP-MySQL.au3" and try it yourself! Default username and password is: admin Download: Tutorial-AutoIt-PHP-MySQL-v1.0.rar[Tutorial] AutoIt - PHP - MySQL v2.0.zip (Thank @JohnOne for having suggested using zip format)Changelog ----- Hope you enjoyed it!
  5. Hello guys! I changed my website's login page yesterday. In that file, i used header() function to redirect user from login page to error page. But now my script (use WinHttpObj library) can't work. But if i change the login page to old page (without redirect) then my script works How can i fix that?
  6. Hey all, I've been away for a while, working on one thing or another... Recently it's been StyleCI, The PHP Coding Style Service. StyleCI connects to your GitHub repositories and watches for commits or pull requests, with the ability of automatically fixing the code standards if it hasn't matched your settings. The likes of Laravel and Graze are using StyleCI now, among many other projects. Yesterday we hit a massive milestone, we analysed the 100,000 commit! I'd love to hear your feedback Cheers, James
  7. MrTheDzam

    PHP Helps!

    Hey guys! I have a register page. when i click register, it's will insert information to database. But if i refresh the page, the script just continues and insert the information to database again How can i fix it?
  8. Hi everyone This is not a request for sample code. I was looking at one of my AutoIt projects, and my browser was open on a WordPress site we use and a thought occurred: Has anyone tried to use AutoIt as a front end (GUI), with the data read to/from WordPress and the result displayed in the AutoIt GUI? Simple example would be a kind of online calendar. Would require a WordPress plugin. Kind of thing Outlook has. Except, all the calendaring is done in the background by WordPress, and the result read/modified/written by AutoIt using PHP to the WordPress database (MySQL). I suspect in addition to AutoIt, one needs substantial HTML, SQL and PHP skills. Has anyone perhaps attempted this? Am I wasting my time? If I can get the calendar working, I have the simplicity and speed of AutoIt available immediately, with the online database/calendar capabilities of WordPress. All thoughts and comments very welcome.
  9. Just came across this library on GitHub and just thought how awesome it was that I had to tell the community. PHPJS: https://github.com/kvz/phpjs
  10. You're going to need Beege's Base64 UDF and Ward's AES UDF. Beege's Base64 UDF - Base64.au3 Original Thread: https://goo.gl/H1QqEG Ward's AES UDF - AES.au3 Original Thread: https://goo.gl/zQdASR Ward's UDF is amazing, but I felt the need to make a few "Helper" functions to make things easier. _Encrypt() and _Decrypt(), accepting 1 parameter and using a randomly generated IV for encryption, making the end encryption string dynamic and never the same. It pulls the IV from the first 16 characters of an encrypted string for the _Decrypt() routine. EncryptionExample.au3 Now for the PHP goodies! First, we have a required include Encryption.php which was compiled by me. And, finally, an example of the PHP side of things. EncryptionExample.php /EncryptionExample.php?Action=Decrypt&Text=W4NAKRzuuTOfl9pAE8kSUgMYcuosvbUy58GR9w46U8w= Should output something like this:
  11. Hello! I am currently facing a problem which I can't seem to be able to solve. What do I want to do with the script ? Extract all the links of the hotels on this website: http://www.yelp.de/search?cflt=hotels&find_loc=Berlin%2C+Germany For example the first link to the first hotel would be: http://www.yelp.de/biz/novum-hotel-city-b-berlin-zentrum-berlin - changes sometimes, so the link will be different. To start off, I tried to export only one hotel at first. I am using this code to read the content from the source and then get the content between two "functions" or whatever these are called: #NoTrayIcon #include <Inet.au3> #include <Array.au3> #include <String.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Global $url = "http://www.yelp.de/search?find_desc=Hotels&find_loc=Berlin&ns=1" Global $content = _INetGetSource($url) Global $string_A = _StringBetween($content, '<div class="media-avatar">', '</div>') MsgBox(0,"",$string_A[0]) It's part of an older project, which did almost the same thing, with the exeption that this one is not as easy The link is saved differently, and I can't find a way to export it. After it's saved into an array, I am going to save the links into a variable with a do - until function. But first I need this step working. Please, if anyone has an idea how to solve this, even the smallest help is appreciated!
  12. So I'm trying to build a function into my script which will verify someone's copy of the program online somehow. I first looked up a MySQL UDF however I see this requires a driver to be installed, and I assume that the user themself would also have to install this driver on their own computer? That's way too much of a hassle, so i'm wondering if there is a way to have an autoit script connect to a php script in any way and use the PHP to do the MySQL verification process, then read the result back into the autoit script? I don't need a complete answer just wondering if this is possible and if so does anyone know of any examples of this? I've been searching for a while now but haven't come across anything. It should also be noted that I'm looking for this to be a completely behind the scenes type of verification, within the script itself only and not having a browser open or anything like that. Thanks. As a simple example all i need is the autoit script to connect to example.com/example.php, and this page displays a simple "yes" or "no" text on a blank page which the script can then read into a variable for use. Hope this clears things up.
  13. Hello, I've created a script for a Bingo / Lottery kind of game in PHP. Now I want to make this a standalone application in AutoIT. I really dont know how to do that as i´m just a Autoit-beginner. Can you help me with it? In general I have the following files: data.csv - the "database" where the bingo-numbers are stored, together with the name of the candidate index.htm - to show the 'program' in a browser input.php - to take care of input results.php - to show the winners numbers.txt - the winning numbers to compare with I have the following files: Input.php: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> body { font-family:Times New Roman, Verdana,Geneva; font-size:12px; color:#000000; margin-left:20px; background:#F7F5DF; width: 300px; } H2 { font-family:Times New Roman, Geneva; font-size:16pt; color:#840018; text-align:center; } </style> <link rel=stylesheet href="style.css" TYPE="text/css"> <title>Input</title> <?php $sepsign = '/;/'; $text = ''; $wnumbers = ''; $counter = 0; $filed = "data.csv"; $fileg = "numbers.txt"; $in_numbers = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $name = $_POST['name']; $in_numbers = $_POST['$in_numbers']; } $fd = fopen($fileg,"r") or die ("Unable to open $file."); $text = fread($fd,filesize($fileg)); $wnumbers = preg_split($sepsign,$text); // wnumbers is an array with winning numbers Fclose($fd); for ($j = 0; $j < 10; $j++) { for ($i = 0; $i < 10; $i++) { if ($wnumbers[$i] == $in_numbers[$j]) { $counter++; } } } // $counter will contain the number of matches on the input # Append and write the line in a file <number of matches>;<name>;<number 1>;<number 2>; etc $fdb = fopen($filed,"a+"); fwrite($fdb,$counter . ";" . $name); for ($i = 0; $i < 10; $i++) { fwrite($fdb,";" . $in_numbers[$i]); } fwrite($fdb,"\r\n"); fclose($fdb); ?> <h2><br>Your input has been stored successfully!</h2> </body></html> Results.php: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <HTML><head> <meta http-equiv="Content-Type" content="text/HTML; charset=iso-8859-1"> <style> body { font-family:Times New Roman, Verdana,Geneva; font-size:12px; color:#000000; margin-left:20px; background:#F7F5DF; width: 300px; } H2 { font-family:Times New Roman, Geneva; font-size:16pt; color:#840018; text-align:center; } </style> <title>Result</title> </head><BODY> <h2>Result of the draw</h2><hr><br> <?php $sepsign = '/;/'; $text = ''; $filed = "data.csv"; $fileg = "numbers.txt"; $fd = fopen($filed,"r") or die ("unable to open $file."); $text = fread($fd,filesize($filed)); $lines = preg_split("/\r\n/",$text); // Will split the file data.csv in lines $count_reg = count($lines); fclose($fd); sort ($lines); reset($lines); for ($i = ($count_reg - 1); $i>($count_reg-4); $i--) { // The three highest scores are showed $collums = preg_split($sepsign,$lines[$i]); print "<b>Name: " . $collums[1] . "<br>"; print "Number of matches: " . $collums[0] . "</b><br>"; print "Input: "; for ($j = 2; $j < 12; $j++) { print $collums[$j]; if ($j <> 11 ) { print ", "; } // to prevent the "," to appear after the last number } print "<br><br>"; } $fd = fopen($fileg,"r") or die ("Unable to open $file."); $text = fread($fd,filesize($fileg)); $wnumbers = preg_split($sepsign,$text); Fclose($fd); print "<br><b>Bingo numbers</b><br><hr>"; for ($j = 0; $j < 11; $j++) { print $wnumbers[$j]; if ($j < 9 ) { print ", "; } // to prevent the "," to appear after the last number } ?> </body></html> Index.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> body { font-family:Times New Roman, Verdana,Geneva; font-size:12px; color:#000000; margin-left:20px; background:#F7F5DF; width: 300px; } H2 { font-family:Times New Roman, Geneva; font-size:16pt; color:#840018; text-align:center; } </style> <title>Bingo game, input numbers.</title> </head><body> <form action="input.php" method="post" name="form"> <center> <h2>Input numbers</h2> lines &nbsp; <input type="text" name="lines" size=20 maxlength=50><br><br> Number &nbsp;1 &nbsp;<input type="text" name="$in_numbers[0]" size=4><br> Number &nbsp;2 &nbsp;<input type="text" name="$in_numbers[1]" size=4><br> Number &nbsp;3 &nbsp;<input type="text" name="$in_numbers[2]" size=4><br> Number &nbsp;4 &nbsp;<input type="text" name="$in_numbers[3]" size=4><br> Number &nbsp;5 &nbsp;<input type="text" name="$in_numbers[4]" size=4><br> Number &nbsp;6 &nbsp;<input type="text" name="$in_numbers[5]" size=4><br> Number &nbsp;7 &nbsp;<input type="text" name="$in_numbers[6]" size=4><br> Number &nbsp;8 &nbsp;<input type="text" name="$in_numbers[7]" size=4><br> Number &nbsp;9 &nbsp;<input type="text" name="$in_numbers[8]" size=4><br> Number 10&nbsp;<input type="text" name="$in_numbers[9]" size=4><br><br> <input type="submit" value="Submit..."></FORM> </center> <p />&nbsp;<p /> </body></html>
  14. Hi guys found this on a blog today and i was just wondering how this works as ive tried the example but i cant get it to work for myself ? Here is the blog entry http://www.sadeghi85.info/articles/using-php-functions-inside-autoit/#more-189 If anyone has any ideas or pointer id appreciate it.
  15. Hello, For sharing screenshots with my friends I'm using uploadscreenshot.com. I noticed they have a useable API, so I thought I could create a neat little program which will upload screenshot with a single button click. After reading their documentation I started to play some with WinHTTP, but unfortunately I have zero experience with WinHTTP. API documentation: www.uploadscreenshot.com/api-documentation What I've tried: #include "WinHTTP/WinHttp.au3" Global Const $sAPIKey = "*snip*" Global Const $sAPIURL = "http://img1.uploadscreenshot.com/api-upload.php" Global Const $sIP = "209.105.243.66" ; pinged from 'uploadscreenshot.com' Global $hOpen = _WinHttpOpen() Global $hConnect = _WinHttpConnect($hOpen, $sAPIURL) Global $hRequest = _WinHttpOpenRequest($hConnect, "POST", "C:\Users\Lyker\Desktop\Other\Untitled-1.png") _WinHttpSendRequest($hRequest) _WinHttpReceiveResponse($hRequest) MsgBox(0, "", _WinHttpReadData($hRequest)) _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) I have no idea how I should use the WinHTTP UDF to connect with their API and send images & fill in variables. Any pokes in the right direction? Almar
  16. I don't know where to post this... I'm trying to get autoit to be able to uploade files larger than 20 mb, if I use my sites default upload script~ if (isset($_POST['_submit'])) { for ($i = 0; $i < $num_files; $i++) { if ($_FILES['_file']['name'][$i] == '') continue; $File = strtr(stripslashes($_FILES['_file']['name'][$i]), ''" |/?!*#', '__________'); $dotpos = strrpos($File, '.'); $length = strlen($File); $ext = strtolower(substr($File, -($length - $dotpos - 1))); $noext = substr($File, 0, -($length - $dotpos - 1)); if (!in_array($ext, $flat_allowed)) { LogErrors("{$txt['extension']} <b>$ext</b> {$txt['not_allowed']}"); continue; } switch($_FILES['_file']['error'][$i]) { case 0: break; case 1: LogErrors($txt['PHP_file_size']); continue 2; break; case 2: LogErrors("$txt[file_size] $txt[exceded_limit]"); continue 2; break; case 3: LogErrors($txt['partial_upload']); continue 2; break; case 4: LogErrors($txt['no_file']); continue 2; break; } if ($_FILES['_file']['size'][$i] > (_MAXSIZE * 1024)) { LogErrors($txt['file_size'].' ('.round($_FILES['_file']['size'][$i]/1024, 2)." $txt[KB]) {$txt['not_allowed']}"); continue; } $fullname = _REALPATH.$File; if (!isset($content)) $content = ''; if (_OVERWRITE == false or !isset($_POST['_overwrite'])) { if (file_exists($fullname)) { LogErrors($txt['file_exists']); continue; } if (isset($allowed['exec']) and in_array($ext, $allowed['exec'])) { if ($ext == 'php' and $highlight_php == true and file_exists(_REALPATH.$noext.'html')) { LogErrors($txt['exec_file_exists']); continue; } elseif (file_exists(_REALPATH.$noext.'txt')) { LogErrors($txt['exec_file_exists']); continue; } } } if(@move_uploaded_file($_FILES['_file']['tmp_name'][$i], $fullname)) { if (isset($allowed['image']) and in_array($ext, $allowed['image'])) is_image(); elseif (isset($allowed['text']) and in_array($ext, $allowed['text'])) is_text(); elseif (isset($allowed['exec']) and in_array($ext, $allowed['exec'])) is_exec(); elseif (isset($allowed['package']) and in_array($ext, $allowed['package'])) $uploaded[] = $File; if ($change_mode == true) @chmod($fullname, $mode)or LogErrors($txt['chmod_fail']); } else { LogErrors($txt['move_failiur'].'<br />'.$txt['try_again']); if (!file_exists(_REALPATH)) echo '<span style="color:red; font-size: 12pt;"><b>'.$txt['doesnot_exist'].'</b></span><br />'; elseif (!is_writable(_REALPATH)) echo '<span style="color:red; font-size: 12pt;"><b>'.$txt['unwritable'].'</b></span><br />'; } } if ($show_error_log == true and isset($errors) and count($errors) > 0) ShowErrorLog($errors); if ($show_uploaded_list == true and isset($uploaded) and count($uploaded) > 0) ShowUploaded($uploaded); if (isset($content)) echo $content; if ($show_upload_form == true) PrintForm(); if ($notify_admin == true) MailUploaded(); if ($log_upload == true) FilesLogging(); } else PrintForm(); clearstatcache(); I can uploade files up to 130+ mb from anywhere. But using this code~ <html><body><form action="" method="post" enctype="multipart/form-data"><input type="hidden" type="file" name="file" multiple="multiple" /><input type="hidden" type="submit" /></form><?PHP if($_FILES){move_uploaded_file($_FILES['file']['tmp_name'],'C:/place/'.basename($_FILES['file']['name']));} ?></body></html> [/HTML] I can't upload anything past 10+ mb except if I'm on the actual machine that hosts the server, what is going on? I was making an app that archive music and uploads it to my server but as I discovered, it wont let me upload anything past 10mb from any of my friends places and I have to make a bunch of smaller archives in order to do it, which is not cool at all.. Edit: Got it too work..
  17. I've been working on this php script based off of tinyib to work just like 4chan, yeah.. you heard right. I came to a problem when I noticed how 4chan interprets page requests as so~ <a href="1">1</a> Now the above is obviously a request for the second page on almost any board at the place and when you click it, the url changes from ~ http://boards.4chan.org/g/ to the url http://boards.4chan.org/g/1 And if you add a trailing backslash to the url as so~ http://boards.4chan.org/g/1/ you will get an error which should mean the request is not a directory but an argument sent over the url like the typical forum values you see like ~ forum.net/forum.php?Page=1 Some one told me that moot uses mod_rewrite to interpret the request, I couldn't get the said module to work under uniserver for some reason, even though "server-info" screams at me that the module is loaded and ready to go, but when I add a rule, it gives me a server error or apache fails to run when restarted. I'm basically very close to replicating 4chans script. but I cannot figure out how to interpret the url in my script so I can deliver the right page. Heres how 4chan uses the page ref ~ <a href="1">1</a> Very simple looking but I don't know how to catch this and not get a 404 error because of the "1" which apache thinks is a directory.
×
×
  • Create New...