File Changed Alert
I have a Client Management system, and the client's plain text files financialplan.txt, contactinfo.txt, and projectdesc.txt.
These text files are in the client folder (public_html/clients/george) and they are to be included onto one of the client management pages (not yet created).
I need to know if there is a way to detect if a file has been edited, and alert a user if he or she has not yet viewed the changes. The client files might be edited by myself, and my partner to be alerted of these changes, so he may go view the changes. Then when he has viewed the changes the alert would go away, of course.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Alert Popup Box
I can't find a way to create an alert popup box for debugging, is this possible in php? I guess I'm thinking of visual basic where that was so easy, in php I normally use *print* for this but it can be hard to find.
Making An Alert With Php
i have this code that when the user click it will delete the record: echo' <td bgcolor="'.$color.'" width="40"><font face="Verdana" size="1"> <a href="del.php?id='.$id.'&dbf='.$dbf_new.'">delete</a></ font></td>' i wanted to do a little confirmation before commiting the action. how to do it?
Alert Messag
I have trouble to display an error message when user does not select anything from a drop down menu in the form. What makes my situation different is that the data in the drop down menu is generated from the database. Code:
Alert Function
Would somebody tell me how I use the onmouseover=alert('string') in a PHP script without using of JavaScript?
Alert Boxes
do u know the alert box in javascript? when u write alert("somthing"); well i need that in php what is the alternative function for that in php?
Check Whether A Page Has Changed
I am building a system which is checking remote web pages to see if they have lost the content that is related to me. Does anybody have any suggestions how this is best done? Presuming many pages have dynamic content on them not related to the content I am interested in, would it be best to just do a substr() of the content looking for the bit I am interested in?
Whats Changed Since PHP Persion 4.3.10?
I've not coded php for a couple of years now and, for some reason, I decided to refresh my memory. I opened an old script I had been playing with back then and started editing, and testing on my local machine. I have Apache, PHP Version 4.3.10 and MySQL installed on my machine which I have had installed for what must be two and a half years. When I test locally, the site (what there is of it) works perfectly, correct includes are called, menus expanded and menu items highlighted when chosen. When I upload it to my host (which is apache based and supports both PHP4 and 5 (PHP Version 4.4.7 installed)), the initial page is correct, but when I click on any menu item, includes aren't called, selected menu items aren't highlighted or expanded.
Alert By Clicking On A Link
Is it possible to set a javascript alert before executing a php script when a hyperlink is clicked. i.e. user clicks hyperlink "delete" to execute delete.php?task=del&id=2
Javascript Alert Question
I'm working on an e-mail form (btw many thanks to Philip Ronan for the very cool email address format tester function, best I've seen so far). I've been trying, with limited success, to produce a javascript alert box which shows the user a validation error message. The error message itself is dynamic, i.e., it's contained within a php variable. I seem to be running into two issues: 1. I can raise the alert box, but I can't pass the string contained in the $myerrormessage variable. Clearly I don't quite have the syntax just right. 2. When the alert box does appear, the content of the web page behind the alert box disappears, i.e., the page goes blank. When the user clicks the OK button on the alert box, the blank web page remains, and the user must click the Back button to return to the form. The html that generates the form is wrapped inside a php function (the file itself is php). The 'action' attribute of the form is "<?php echo $PHP_SELF ?>". The form also contains a hidden field called 'action' whose value is 'send_mail'. When the user clicks the submit button, the script calls itself recursively, and the $action variable's value, 'send_mail', is sent to a switch. The switch calls a send_mail function, which performs all the validation checks and generates an html error message if $myerrormessage is not empty. This script was based on models provided in this book: http://www.wrox.com/WileyCDA/WroxTi...0764557440.html Currently I'm rendering the error message via another php function which produces the html containing $myerrormessage. This works just fine, of course, but I'm afraid some wiseguy web developer out there will look at it and proceed to tell me all about how lame it is. Can I add an onclick attribute to the form, to call a javascript function inside the <body> tag of the html which renders the form?
Field Changed Color On Status
i want to be able to have my Listed Feild Change a diffrent Color Depending on if the job is Completed "green" Pending:"yellow" Stalled:"red", So when the user Selects Pending in the dopdown and he lists the Job it will be Colored "yellow" with the words Pending:
Any Ideas How To Read A Url That's Changed By The Server?
I apologize, but I posted this in the php general forum earlier and realized that this is the more appropriate forum. Hopefully there's a coder here who has done this in the past. I've got code that uses CURL to go a web page to read the data. When I type in www.website.com, the server automatically adds a session variable to the url. I need to be able to read that session variable. Then I will use that session variable to input into a new CURL session. Any ideas how I can do this? If I use code like this: // find out the domain: $domain = $_SERVER['HTTP_HOST']; // find out the path to the current file: $path = $_SERVER['SCRIPT_NAME']; It gives me the code for where my script is sitting on my server rather than the values for the web site that I'm trying to read. Any ideas?
Updating Only Fields Which Users Have Changed
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? 1) simply UPDATING the values for all fields in the table, whether or not any particular field has actually changed 2) running a second SELECT statement and comparing the $_POST vars to the returned values, and only UPDATING those that have changed. 3) including a hidden form field for each field with the original values (so for each <input type="text" name="field1" size="10" value="blah"> there would also be a <input type="hidden" name="field1_orig" value="blah">), comparing $_POST['field1'] with $_POST['field2'] and only updating those that have changed. There's very little chance that two users will be updating the same table at the same time with this particular site, but anyone see any particular problems with any of the above three methods? Would doubling the number of $_POST vars (option 3) create a problem?
Mail Function Has FROM Changed By Server?
I am running a simple mail function, and I want to set the FROM header within the function: mail( "mailbox@provider.com", "testsubject", "testbody", "From: Oliver <oliver@mydomain.com> X-Sender: <oliver@mydomain.com> X-Mailer: Test Script Return-Path: <oliver@mydomain.com> Content-Type: text/plain; charset=iso-8859-1" ); However, form my phpinfo I can see that the from_header is: FROM_HEADER provider.com Now, all outgoing emails are changed in the header: From: Oliver <oliver@provider.com> (!) How can I prevent this?
How Is Submit Button Appearance Changed?
Currently designing/building my first class/template driven site. Inside a PHP form a list of article titles are displayed along with the first two lines of the article. When the user clicks on the article title the form with the list of article titles is replaced with the full text of the article selected. Since the article ID for the article title selected determines which article will be displayed it would seems that if each title displayed (on the article title list page) was actually a submit button. Of course I don't want a list of gray submit boxes with titles lumbering down the page. What I'd like to know is: First, is it possible to assign a variable to a submit button. It seems like it would be, but if someone has found a reason for not doing so I'd appreciate hearing it. Second, how do I change the image of the submit button so it appears as a link (without the underline, of course). I've found a couple of tutorials in regards to this issue, but they all had major typos and so far have not gotten any of them to work.
Security Alert! The PHP CGI Cannot Be Accessed Directly.
I have installed php4.2.2 using the windows installer but i am having problem. I get the message: Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.
Empty Field Alert And Go Back
I would like to alert the user that leaves a blank field that it is obligatory. After that return him to the previous page... I tried this code but it doesn't work. I can either alert and continue to the next page, or simply return to the previous page without the alert.. Code:
HTML Forms - Alert To Save Changes
Is there a way in PHP to prevent a user from moving away from a page with an HTML form on when they made changes and didn't click submit? I would like some alert box to confirm if they want to leave or if they want to save the changes. Is that at all possible? I've tried Javascript but with no luck.
Session ID Changed Everytime Go To New Page Or Reload.
I'm new member of this group. I had added new virtual host at my intranet server. The new virtual host configuration on httpd.conf is similar with the old one. At the new virtual host, the session id seems changed every interaction to server (new page or reload). The old one is fine, the session id keeps at the same string. Both are at the same server. I use Apache 2.2.3 (Win32) with PHP 5.2.0. Tested using code below: session_start(); echo session_id(); PHP Configuration : session.save_handler = files ;session.save_path = "/tmp" session.use_cookies = 1 ;session.use_only_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 1000 session.gc_maxlifetime = 1440 session.bug_compat_42 = 0 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = ;session.entropy_length = 16 ;session.entropy_file = /dev/urandom session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 session.hash_function = 0 session.hash_bits_per_character = 5
Converting String To A Format That Be Mathematically Changed?
I am planning on storing usernames and passwords on people's computers, but I would like them to be encypted. Is there a way I can convert a string to a binary/numeric type so I can multiply that value by a number of seconds? (The seconds will be stored in the database) Also, how could I convert the value back to a string when I divide by the number of seconds stored in the database?
Changed To PHP5 Now Script Doesnt Work
I had a dynamic img creation with gdlib and Right Alignment. I 'pinched' this script which worked well until my host upgraded to php5. Any ideas. the following error messages are received. ‰PNG IHDR�2ý~Ê Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error in /home/clearcon/public_html/fonts/title.php on line 40 Warning: imagepng() [function.imagepng]: gd-png error: setjmp returns error condition in /home/clearcon/public_html/fonts/title.php on line 40 Code:
PHP And Java Applet : Instant Alert Problem......
I have a web page entry and a java applet running at the "manager" office. I need to instantly send an alert to the "manager" once the customer had key in their transactions. I'm wondering how should I do this? by using php socket? to use another programming language to develop the server ? anyone with any experience before in doing this. I did manage to come out with something. Here's what I've come out with : a) a php socket server waiting for connection. b) load an applet to connect to the php socket server. c) the socket server will fetch from the database every 'n' seconds to send the latest data. it works.....but the php socket can only allow one connection at a time. And I am trying to make it as real time as possible because a few sec of delay can cause a very big impact.
How To Redirect After (header) After Sending An Alert Message
I have a php script that checks whether the user is allowed to perform an action. If he is not allowed; I display a warning; using the alert function. After clicking away this function, I want to redirect the user to the original page using the header function. However, I get the normal message " headers already sent"... I know what the problem is. But how do you normally deal with this situation? use a html/php for the warning instead of alert message? or is there another way?
Popup Alert Similar To Yahoo Messenger In PHP
I would like to create a pop up something similar to yahoo messenger popup which comes on the right pan of the status bar. This i planned to alert the users via popup when he gets the mail.
To Get A File Name, File Size, File Type...?
Is there a way to get information about a file BEFORE it is submitted to the server? I am trying to make a upload progress bar from scratch WITHOUT THE PRON.C PHP FIX!!! I found the file being uploaded in my NET://WINN01910//TEMP folder and I can outputs its file size in a popup with a one second refrehs, but this makes it so the USER needs to know the full file size to know if its anywehre near done. Is there a way to get the filesize from the clients side? Possibly javascript that uses ajax to submit the values to the server before the file is sent but when it is selected?? Is there an easier way to do this and/or do you have any ajax example code of how it might work? I also have another problem, Althoguh i can echo the filesize of what is recieved so far, I am just glob()ing the temp folder for: "php*.tmp" but is there a way to tell the tmp file so they don't see everyone's uploads?
FIle Uploads: Empty _POST And _FILES Arrays When File Too Large
Uploading of files.. AFAIU from the manual, if a file is larger than the size defined in the form or larger than upload_max_filesize in php.ini, that _FILES['file']['error'] should hold an INT error code. The file upload system is working fine if the file is smaller than the defined size, but if it's larger, then both the _POST and _FILES arrays are completely empty: array(0) { } I can obviously check to see if $_FILES is set and contains elements, but I was hoping for more specific error handling (reason as to why the upload failed). Has anyone else encountered this? Any info welcomed =)
Checking File Existence Through A List Of File Locations Gathered From An Array
I've been trying to wrote a code to check the existence of some files gathered from a field in mySql database. And I am kind a stuck at a point where I get the file locations from the database but when it passes those locations to file exist it keeps telling me the file does not exist. Only first file exists the other 2 file does not exist to test if the code was working or not. Code:
Email With File Attachements - How To Upload File To Server From Browser?
I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. I want to develop a webpage where people can send attachments that are stored on their local PC. I know I can use the <input type="file" > HTML to generate a file box that allows the user to navigate to a file on their PC and product a file path, but how do I then upload this file onto file server to email out with my PHP email script? Is there an easy way to do this? Or can I approach this problem from a completely different angle.
Creating Link To File Or Temp File For User Download
I am designing a document management system (DMS). The files are stored in a directory on the webserver. The filenames for the documents are stored in a MySQL database. The DMS will track revisions from the initial version through the updates. We must have strict permissions set so only authorized personnel can access some documents. All of the documents when uploaded are given totally random names such as "114723fb5422c6bd5ed18f6.doc". Is there a way, without the webserver creating a new file name "document_specs_ver2.doc" to have the file download named "document_specs_ver2.doc". If I must physically create a new file, how do I know when the webserver would be allowed to delete it? Notes: The files will be in several different file formats, not just "doc".
Header Function, File Download, Temp File Disappears
I have the following headers: if (preg_match("/compatible; MSIE/i", "$browser_type")){ header("Content-Tranfer-Encoding: binary"); header("Content-type: ".$assoc["type"].""); header("Content-Disposition: attachment; filename="".$assoc["name"].""");} echo $assoc["file"]; which starts the download of an mp3 file in one particular case. If you do not save target as and just select 'open' the temp file is zero bytes even though the download process took a while and showd how much progress you were making. So something is happening to the temp file.
Open File, Put First 5 Lines Into A Variable, Close File...
1) I want to open a file on my server. 2) I want to read only the first 5 lines. 3) Put the first five lines into a variable. 4) Close the file. 5) Display the contents of the variable. I know how to use the fopen() but I have big problems just trying to read the first 5 lines only? I tried many things. I downloaded some search scripts which displayed the <meta> tag only from html pages... What is this guy doing? Well I have a big site and content is added and changed everyday. I have a dynamic page that reads a directory for files and then puts a link (well it includes the file for reading on my php page). That works great! MY PROBLEM is that I want not only a link but a small description below it (basically the first five lines on the file)... See so far: Quote: if (isset ($content)) { include ("files/$content.html"); echo "<p><A HREF="read.php"><b>Back to index</b></A>"; } else { echo "<b>Opening directory, reading files, and listing them as a link</b><p>"; $handle = opendir('./files'); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo eregi_replace (".html", "", "<A HREF="read.php?content=$file">$file</a><p>"); } } closedir($handle); }
Open .php File With PHP Designer 2007 By Clicking The File In XP
In windows XP, I want to be able to click on a .php file and have it opened in PHP Designer 2007, Or right-click on it and have an "edit" menu option presented to me. I know how to tweak the registry to do this in general, but what would the command line look like in this specific case ? PHP Designer does not do this automatically. It is as if the program does not allow commandline options. It only opens with the last file used or a menu of recently opened files.
PHP File Upload Unexpected Error - File Too Large?
I have a short basic script to upload files. It works fine with small files, but with longer files it gets stuck. Here's the fragment, the input file is loaded in "$file" from an HTML form as usual. .... $img_str = fread(fopen($file, "r"), filesize($file)); $data = addslashes($img_str); // --------------------- up to here the execution is correct and fast (<1 second) $sql="INSERT INTO $table (". " file_name,". " file_type,". " file_size,". " bin_data)". " VALUES (". " '$file_name',". " '$file_type',". " '$file_size',". " '$data')"; // --------------------- it gets stuck here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! mysql_query($sql) or die ("SQL error ..$sql"); I have already set the php.ini variables as follows: memory_limit = 16M upload_max_filesize = 6M I also checked the execution time to max_execution_time = 300 (even though I don't believe it should be necessary). The server is a P4 1.8 GHz, 256MB RAM
Displaying File Path In File Input Field
i have file input field in a form like this: <input name="isbn" type="text" size="25" value="<?php echo $_POST['isbn'] ?>" /> <input name="image" type="file" size="25" value="<?php echo $_FILES['image']['name'] ?>" /> when i press "submit" button, the same page gets loaded... if my $_POST['isbn'] is empty, i want to have the file path on "file input field" to redisplay on that same field... it's possible in text input field but i don't know of a way to do it in file input fields...
PHP/IIS: File Read/Write OK, File Unlink Denied
I've got PHP running fine on IIS (OS: Server 2003, SP1; IIS: 6.0; PHP: 4.3.11). In PHP, the user uploads a file, which is then processed and the contents are inserted into a new file, created in PHP, onto the server. This bit works fine, the new file created by PHP is correctly stored. Later, once the user confirms the upload and PHP inserts the contents of the file into the DB, the code tries to remove the file created in PHP moments earlier, via the unlink() function. What I see on screen is the following: Permission denied I have made sure that the permissions for the Internet account that created (and is trying to delete) the file have full permissions over this particular folder and the files within it. But the user must have permission anyway, because they are able to create this file in the first place. I've looked at the permissions for the file in PHP, which read: 0666. So everthing *appears* ok to me; I can't see where the permission issue is coming from.
Mkdir() How Do I Automatically Make A Index File And A Css File
using mkdir() how do i automatically make a index file and a css file. what i really mean is once the directory has been made how do i make it so i have a index and css file there, its just because im making a forum hosting service and i need all the files automatically set up in the directory. how can i do this?
How Can I Find Out Parent (including) File Of Included File?
How can i find out parent (including) file of included file? Lets imagine that we want to for example auto_prepend file to each file on our server that would write out the name of file its being executed. I know, i can use PHP_SELF but what if i want to write name of file which is already included? I have a web page and i want on it show its name even if it was included, but not the included page itself is showing name but auto_prepend file to each php file, its duty of this auto_prepend_file to write it out i dont want myself to echo it on each page? do you feel me?
Exporting DB Results (or Flat File) To An Excel File
I have two scripts, neither of which have been written, that will need to collect user information. They will either write to a flat file or to a MySQL DB, and I need a way for an administrator to grab an Excel file based on this data. First, no more than 100 people are expected to sign up, so flat file is certainly viable. Do you recommend I use DB or flat file? Second, based on your recommendation, how should I go about exporting the user data to an Excel file? There will be about ten form fields per registration to give you an idea.
File Upload Script - Testing For Existence Of File
i'm having a strange problem when processing some form data. I just want to validate that required fields have been populated, then, if an image has been uploaded, i want to ensure that a description of the image has been provided (for alt tag purposes) before processing the data. For some reason, when a file hasn't been attached, my script interprets it otherwise and prompts the user for the alt tag. I've not come across this problem before, there's a good chance i've done something idiotic but i just can't see it Code:
Write To File Sometimes Deletes EVERYTHING, Leaving Empty File
I've used PHP to save raw data from Flash to an XML in the past. Load the XML into flash, update a couple variables, then send it to PHP to completely overwrite the old .xml file. This works great most of time, but sometimes after a few days, I'll check the .xml and it will be empty (0 bytes). Not sure if this is caused by a user who aborted during the writing process, or simultaneous connections, etc. Been thinking about doing a backup every day using CRON, but that's a mission and I'd like for it not to happen full stop. Any suggestions?
Script For Grabbing An Xml Rss Feed File Into My Server As Xml File Too
How do I copy using a php or cgi script a remote xml rss feed into my server? I.E the rss feed: http://www.lanacion.com.ar/herramie...ex.asp?origen=2 Due to restrictions in flash player 7 I need to load a remote xml rss feed. I am using load.xml( http://www.... but in that way doesn´t work The only way that works is when the rss xml feed is placed on my server. I could upload manually the xml rss feed but I need a php script to be called from flash and then parsed. What I need is the script to make that remote xml being "local" to my flash movie. Trying other stuff Ive found on forums about "proxy scripting" but that only works if you are using flash player 6, flash player 7 even don´t allow redirection scripts at all.
Access Button In HTML File Through PHP File
I’m new to PHP and I’m working on a code and having a problem . The problem is that I’m having an HTML file like this : //////////////////////////////////// <p>some text</p> <form action="/project/myfile.php" method="post"> <input type="button" name="mybutton.1" value=" mybutton "><input type="text" name="aaa" /> </form> <p> some text </p> <form action="/project/myfile.php" method="post"> <input type="button" name=" mybutton.2" value=" mybutton "><input type="text" name="aaa" /> </form> ////////////////////////////////////// I want to open a new HTML file to the user when he clicks on any of these buttons . I want to do this in the file named “myfile.php “ . What should I write in the file “myfile.php “ to get access to each button and open a new page when the user clicks on it? Is it correct to put " action="/project/myfile.php""? Should I put include the HTML file in my PHP file? I want also to remember which button the user clicks on.
Xsl Imports Relative To Current File Instead Of Xsl File
In the directory /var/www/dynamo/xsl is the basic xsl file for xhtml documents /var/www/dynamo/xsl/xhtml.xsl. In this file there is an import statement: <xsl:import href="xhtml/basic.xhtml.xsl" />. This import statement should load /var/www/dynamo/xsl/xhtml/basic.xhtml.xsl as far as I know.....
How To Read A File, Edit And Replace That File With New Changes?
I am making a enhancement to our helpdesk product. So we are using JSON for saving the Language defaults. Now I am Using PHP as a server based language. Now here is the logic of the program. Whenever our product is installed then a parser will create a HTML file which will have all the defaults from the JSON file. Now when a user changes the language then the parser will again Run and make the required changes in the JSON file and again create the HTML file and Replace it in that folder. I am not able to find a good solution for this. Can someone help me building it. I am not able to get how to Open a file, Read it, make the changes and Replace that file.
|