PHP - Fi Alternative For Windows In Php
Hi
i need help with this Code: [Select] read -p "Enter a password" pass if test "$pass" = "jerry" then echo "Password verified." else echo "Access denied." fifi works in unix only. Is there an alternative for windows ? Thanks in advance Similar TutorialsSo the server that host my website is not accepting .php files at the moment. I have a form mail in .php format, can anyone recommend an alternative form mail that will not use .php extension? Thank you kindly Hi i learnt today hard way that die(); can kill of loading the rest of your html page if you place it in the middle of your html after a few hours of trying to work out what was wrong and wondered what alternatives there are i have tried a few like "E_USER_ERROR" and "trigger_error" but none halt the script and display a message or do it without loading the rest of my page, There must be another way i just havent found it and would be really grateful if someone could tell me it. Thanks, Blink359 I want to encode a long string, and wish to make it shorter. base64_encode is very handy but it makes the string length longer. Is there an alternative to do the encoding/decoding with shorter encoded string length? Is there a function which will allow me to throw the values into an array and post them into the DB as separate records? If so a little help would be appreciated! Code: [Select] if(empty($row)) { //Need a better way. $sql = "INSERT INTO phpbb_user_items VALUES (13, '$user_id', '0'), (12, '$user_id', '0'), (11, '$user_id', '0'), (9, '$user_id', '0'), (27, '$user_id', '0'), (15, '$user_id', '0'), (16, '$user_id', '0'), (22, '$user_id', '0'), (21, '$user_id', '0'), (23, '$user_id', '0'), (24, '$user_id', '0'), (26, '$user_id', '0'), (29, '$user_id', '0'), (30, '$user_id', '0'), (31, '$user_id', '0'), (32, '$user_id', '0'), (33, '$user_id', '0') "; $result = $db->sql_query($sql); } So to stop third-party traffic on certain media files my site does, I did a download.php type script that just took in the media id, and found the filename and did a readfile on it for the user. The problem is that when you start doing massive amounts of traffic with it, I think the readfile stream is taking up a lot of cpu. Is there any alternative to readfile that creates a direct link between the user and the file, instead of it having to go through the php? I'm afraid that this is something I need to do on the server end, and not in PHP, but I figured I'd ask. Hey everyone, So I'm a complete PHP noob and have very basic knowledge of PHP - everything I learn is from tutorials online. I created a website which monitors Stock Exchange data for a particular stock exchange by downloading a CSV file from the Stock Exchange's website containing all the stock data - as this is the only way this particular exchange provides its data to 3rd parties. Now, my PHP system takes this CSV file, reads it and inserts the data into a MySQL database. Then, the function of my site is that users can create alerts for particular stocks that they are watching, and my website will send them an email when the stock price of the stock that they are watching goes above or below a particular value that they specify. Simple! However, since my MySQL database always needs the most recent version of the stock prices, the way I did this in the past was by using Cron every minute to download the file off the exchange's website, and insert the data into my database. I realise that this is quite inefficient, but my main problem is actually that the only way I can do cron every minute is by paying for my own Virtual Dedicated Server as normal shared hosting won't let me run a script that frequently. What I am here to ask is if any of you know an alternative way that I can constantly update the price data in my database i.e. an alternative to cron. I hear that you can run PHP scripts as 'daemons' but I'm not sure how this works nor whether I can do this with normal shared hosting. I cannot afford a Virtual Dedicated server any longer and so need a solution which is compatible with normal, cheap shared hosting. Any help would be much appreciated! i need to read a pdf and convert it to raw text (with line breaks - but that's as fancy as i need it)... pdflib does way more than i need, and it's super expensive, and i don't really see the need to install an app on my server just to read a simple pdf... there must be an alternative out there, but i can't seem to find it... and when all of php.net seems to reference pdflib, i start to get a little discouraged... it seems like a simple pdf reader class/package would be open source somewhere... any suggestions? thanks I am running a script that uses curl to fetch an image and then pass it through to a user. It works well but is consuming a large amount of bandwidth. Is there another way that I could pass the url to the user directly, bypassing my host? Hi. I am coding a project, and ability to browse other websites through a frame in this site is central to the project. However, I need to be able to have the href of the frame's current location which I can't do using an iframe. Does anyone know of any techniques using server-side php in which one can view other sites and keep track of the location of the other sides? Thanks, Phil Hey guys. I currently have my website set up 'generating' php pages, rather than simply getting data off the database. Which is silly. I have no rectified that issue but end up with ugly urls such as http://www.worldwidelighthouses.com/Lighthouses/English-Lighthouses/Trinity-House-Owned/Lighthouse.php?Lighthouses=Beachy-Head Whats the best way to translate that into http://www.worldwidelighthouses.com/Lighthouses/English-Lighthouses/Trinity-House-Owned/Beachy-Head Im hopeless with apaches mod_rewrite... Many many thanks in advance. Danny I am validating a registration form. If there is an error on the form it adds 1 onto the variable 'iserror'. The form will only submit if there are 0 errors. However, I have a function within this function that checks the database to see if the username is available or taken. When 1 is added to the variable within that function it doesn't work. After researching it a bit I have come to the conclusion it is not possible to use the variable within another function. So what could I do to validate this function as well?
Thanks
function buttonFunction(){ var iserror = 0; v=$("#txtusername"); $.post('../action/checkusername.php',{user:v.val().toLowerCase()},function(d){ if(d=='available'){ $("#usernamemessage").html("<span style='color:green;'>Username is available</span>"); }else if(d=='not-available'){ $("#usernamemessage").html("<span style='color:red;'>Username is not available</span>"); iserror = iserror + 1; } }); if(document.getElementById('selaccounttype').value == "AccountType") { $("#accounttypemessage").html("<span style='color:red;'>Select Account Type</span>"); iserror = iserror + 1; } else { $("#accounttypemessage").html("<span></span>"); } Edited by slj90, 18 August 2014 - 12:46 PM. I want a free alternative to 000webhost. I don't want to use something like xampp because eugh I don't get on with it. Thanks Is there a way to do get_called_class for versions lower than php 5.3? Hi Everyone Does anybody know if there an alternative to preg_match? I cant get my head round regex so im having difficulty setting different preg matches. Is there an easier alternative? Thanks Is there a call_user_func_array() alternative other than eval()? With the shear genius of some of the individuals on this forum, I'd expect that if there is an alternative, someone here would know it. Any tips or insight greatly appreciated. Thanks Background (blah blah blah) I'm being kinda picky on efficiency and performance since I will be looking at possible hundreds of executions a request... so I'd like to avoid using the above mentioned functions since they take ~3x and ~10x longer (according to a this comment). Hi all - I have a PHP form which allows users to submit data multiple times - in other words then can submit multiple records into the database using the same form over and over again. So currently how it works is once they've entered data and hit submit, the form refreshes and all fields get emptied, allowing the user to again enter more info. My client wants some sort of confirmation that data has been entered. I originally thought a simple pop-up/alert box saying 'Your data has been successfully entered' would do the trick since the user could then click 'ok', closing the pop-up to go about entering more data. However I hear a lot of disagreement on using javascript pop-ups due to pop-up blockers, javascript being turned off, etc. What alternatives exist to notify the user that their data has been submitted, while also allowing them to then continue entering more data? thanks! Steve I have four check boxes that will determine how a search is conducted and I have retrieved the data through _POST[] The problem I have is how can I act upon the data returned? Each of the four text boxes could independently start a search but if I use an If statement the first choice will block the rest of the options eg. Code: [Select] if ($clientValue == "on"){ echo "perform a search based on above"; } I need to use something else than cURL to create the code to login to myspace accounts, I have to be able to enter postfields, Thanks Hi folks, I'm trying do a system like a queue, but doesn't work like i expected. OS: Windows (IIS) PHP: 5.2 So, let me tell you, what i'm doing. 1º Click in one button and insert the entry into database $stmt = odbc_prepare($conn, 'INSERT INTO queue (ask_date, run_date, executed, user_id) VALUES (GETDATE(), NULL, 0, ?)'); 2º After that i will run a script to check values executed = 0 $handle = new COM('WScript.Shell'); $handle->Run("php generate.php", 0, false); 3º Check values executed = 0 and update de column executed to 1 (generate.php) $sql = "SELECT * FROM queue WHERE executed=0;"; $rsQueue = odbc_exec($conn, $sql); while (odbc_fetch_row($rsQueue )) { //code here } My problem is, when i click in button it will open always new process (php.exe). (2 clicks - 2 processes; 3 clicks - 3 processes; etc..) My ideia is, first button click execute the script (2º) but the other times if script is running, only add the content to queue table to be executed in current process. Someone have any ideia? Thank you! Is this possible? i want to create a two colored table of records. And one got any idea's? |