[PHP] Gotta learn asp.net...
*sigh* I'm a hardcore PHP programmer.. I've been using it for over five years now, and would consider myself fairly advanced. I have a project where I'm being forced to do some ASP.NET development, which I've never touched. I need to learn it fast. I'm thinking there must be some other folks around here who have been in similar situations. I'm looking for some pointers on good learning resources, specifically for someone who is an experienced PHP programmer, but who knows nothing about .NET. What helped you most in adapting your PHP skills for .NET? Hope this is an appropriate question here. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Beginner amazes self with image gallery script!
My question is, I'm updating the pages by creating a url back to the same script with some differing $_REQUEST settings for the page number (PAGE=2) and on a smaller screen this bumps the page back to the top. Is there a better way to do this with some kind of update image function without getting into incompatible javascript or CSS or am I following normal procedure? Paul, You're in luck. A List Apart just published yesterday a great article on displaying images without refreshing the entire page. http://www.alistapart.com/articles/imagegallery It works as expected on IE5+ and Netscape 6+ on Windows and Mac. It also works in Safari and all the various flavors of Mozilla like Firebird and Camino. It might be a bit tricking making thetechnique dynamically driven with PHP, but it's doable. Have fun. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stripping out all illegal characters for a folder name
Folks, I'm taking some user input, and creating a folder on the server. I'm already replacing with _, and stripping out a few known illegal characters (', , /, \, etc). I need to be sure that I'm stripping out every character that cannot be used for a folder name. What's the best way to do this? Do I have to manually come up with a comprehensive list of illegal characters, and then str_replace() them one by one? There's gotta be a better way to do this... Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Email forwarding from SendMail to PHP
See if this helps: http://www.evolt.org/article/Incoming_Mail_and_PHP/18/27914/ Joseph Donald Tyler [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Anyone know of a place to get some good tutorials on how to forward email from SendMail to PHP for processing? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP code beautifier?
Jacob, http://www.tote-taste.de/X-Project/beautify/ http://www.semdesigns.com/Products/Formatters/PHPFormatter.html http://www.trita.com/features/php-beautifier.jsp http://www.bierkandt.org/beautify/ http://www.trita.com/ http://www.beautifier.org/ This should get you started. I think PHPEdit has a code beautifier feature too. Btw, I found all of these on the first two pages of a simple Google search. Might be worth trying in the future. :-) Joseph Jacob Vennervald Madsen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi List Does anybody know any good PHP code beautifiers/formaters? Preferably one which is configurable so I can specify the exact format I want. Cheers, Jacob Vennervald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Red Hat 9, Apache 2, and PHP
Folks, I'm just getting ready to built a webserver this weekend and was planning on using RH9, so this thread especially caught my eye. The website that the server will be hosting is pretty simple, some basic DB queries, no special Apache modules. Is Apache 2.0 still not a good choice for something simple? If I really should use Apache 1.3, then which route would be easier... 1. Install RH9, remove Apache 2.0 and manually install Apache 1.3 (from tarball). The only problem with this is that I will no longer be able to use the Red Hat Network's up2date tool to download and apply patches (from what I understand). Up2date is a huge time saver for me. 2. Install RH7.3, and manually install the latest version of PHP (I simply can't use the version that comes with RH7.3). Of course then I still have the older version of MySQL, and everything else. Comments? Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Ticketing System?
Andreas, I haven't used this one, but it looks really good. http://www.innovatehelpdesk.com/ Joseph Andreas Cahen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello List :) Is there any usefull ticketing system (Hotline/Support/etc.) written in PHP? I have found some on hotscripts.com, but I don't know which one is really got or not.. Any suggestions? Cheers, Andreas Cahen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Securing PHP code
A safer architechture would be to use two machines. One to act as the Web server and the other to process transactions. The Web server would take the orders and request the transaction server to process them. The transcation server can only be accessed from the Web server. Nobody should be able to reach the transaction server from the Internet. The transaction server machine should have the database server too. The database server should not accept network connections. Manuel, Having never setup a multi-server web environment before, I'm a bit curious. How would the public server communicate with the private server, passing in database queries and getting results, if it can't connect directly to the database? Are we talking about building a SOAP interface between the two? Thanks, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Are there any PHP functions for creating graphs and/or charts?
http://www.aditus.nu/jpgraph/ Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to get the date of this Saturday all the time?
date(Y-m-d,strtotime(next Saturday)); That would give the Saturday for next week (2003-07-05). Try this Saturday or just Saturday. date(Y-m-d,strtotime(this Saturday)); // Currently returns 2003-06-28 Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ?xml version=1.0 encoding=UTF-8
I believe this is because the PHP engine thinks that the ?xml is a PHP opening tag. 1. Turn off short PHP tags (short_open_tag in php.ini) -OR- 2. Use this instead: ?php echo '?xml version=1.0 encoding=UTF-8?'; ? Joseph Doug Essinger-Hileman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] When I include ?xml version=1.0 encoding=UTF-8? in my html code, I get a parse error. The version is 4.1.2; phpinfo() reports that XML support is turned on. Can anyone help with this? Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MAIL( ) - Send mail using another SMTP
Here is a class that you could use. http://phpmailer.sourceforge.net/ Joseph Chinmoy Barua [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello Everybody, I don't have sendmail/qmail on my web server where i installed PHP. But I want to send mails from web server using PHP. Can anybody tell me, how can i use another SMTP server to send mails? I don't like to change php.ini on my web server. Thank You, - Chinmoy __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookies- peanut butter or chocolate??
For (2) you could even build an array, object, etc. if you need to store several values and use serialize() right before setting the cookie, and unserialize when you retrieve the cookie. Joseph Henning Sittler [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 1. Set a big value in seconds for the time argument 2. Send 2 cookies OR Create one string value containing the two values you want to save, seperated by a a sepcific character of your choice and send this new value as your cookie. Remember to parse the cookie's value when you request it in your script, so that you determine the two seperatevalues actually stored there. Henning Sittler www.inscriber.com -Original Message- From: Sparky Kopetzky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 4:10 PM To: PHP General Subject: [PHP] Cookies- peanut butter or chocolate?? Yes, this question is about PHP cookies. Two questions: 1. How do you setup a cookie that will not expire?? 2. How do you put 2 items that you want to save in the cookie and retrieve?? Examples in the PHP manual only show how to work with a single value. Thanks! Robin E. Kopetzky Black Mesa Computers/Internet Services www.blackmesa-isp.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Creating graphs with PHP?
Dennis, Try this: http://www.aditus.nu/jpgraph/ Joseph Denis L. Menezes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hello friends, Is there a possibility to create graphs on a web page using PHP? I have loooked through the PHP manual but cannot find anything. Thanks very much. Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Force refresh of graphic - how?
Mark, Why not call the makepic.php image, passing in an URL parameter that is always different. This makes the browser think you are always calling a different image, and won't cache it. IMG SRC=makepic.php?opt1=abcopt2=defnocache=?php echo time() ? Joseph Mark Wilson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a PHP page which in turn calls an image-creating PHP program, like so: ...(calling page: mypage.php).. body IMG SRC=makepic.php?opt1=abcopt2=def /body /html makepic.php does database lookups using the values of opt1 and opt2, then creates a graphic (PNG) using that data and returns the graphic. So far, so good... but the graphic is being cached, so the data is not always up-to-date, unless I do a shift-reload of the calling page. I tried adding a pragma nocache line to the HEAD of mypage.php, but that had no effect. I don't want to tell my users to always do a shift-reload - how can I force either mypage.php to not cache the graphic, or get makepic.php's output to not be cached Thanks... replies to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTTP_REFERER security implications?
Tom, This will completely break in AOL. An AOL user's referer changes all the time. Joseph Tom Woody [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am working on a simple authentication script, where the user submits a login and password, the credentials are checked and the user is redirected to another script. The new script checks the HTTP_REFERER and if its the original script it continues, otherwise it stops with a message about being unauthorized. What kind of security implications may I be backing myself into? I want to try and stay away from cookies, and as small as this is I think Session management is a little overkill. The average user isn't going to spend much more than 1 or 2 minutes on the site (not much for them to see or do). I have seen this method used on other sites, but I prefer to check with the experts first. thanks, -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Get Browsers time zone
Jonathan, Only way I can think of is to display the time using Javascript. This way it will be displayed according to the users computer clock. Of course, if the computer clock is wrong... Joseph Jonathan Arnold [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there a way to figure out the client (ie., browser's) time zone? I have a time stored as a GMT time, and I'd like to display it in the viewer's time zone. -- Jonathan Arnold (mailto:[EMAIL PROTECTED]) Amazing Developments http://www.buddydog.org So I'm ugly. So what? I never saw anyone hit with his face. -- Yogi Berra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP OOP design question
I have several web projects that are all database driven. I have recently been diving into OOP, and rewriting a lot of procedural code in OOP. I have a design question about handling the MySQL connection. I have a mysql() class which handles all my queries, automatic inserts/updates, etc. Just about every other class will use the mysql() class at some point. Should I 1) Make every class extend mysql(), so that they all have direct access to the db functions 2) Create a new mysql object inside of each class. 3) Only create the mysql object at the script level, and pass in the object to the other classes. I.e.: // Create the db object $mysql = new mysql(); Now create whatever other objects I need, passing in mysql as an argument. $job = new job($mysql); 4) Some other idea? Thanks for any help, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crontab
I want to run /var/www/backup_mysql.php Are you just trying to backup your MySQL database? If so, check this out: http://members.lycos.co.uk/wipe_out/automysqlbackup Edit a view configuration variables (db to be backed up, path, etc), throw it in /etc/cron.daily, and forget about it. I does daily, weekly, and monthly backups. It overwrites the daily backups after seven days, so you don't have a growing number of backups taking up HD space. It overwrites the weekly backups after 5 weeks for the same reason. It never overwrites monthly backups. I use it on several server. It works really well. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysqldump
You need to use exec, system, etc. Here is a script that I recently put together. It backs up the database, and pushes it as a download to the user. ?php $filename = db_backup_ . date(n-j-y); header(Content-Disposition: filename=$filename.sql); header(Content-Type: application/force-download); exec(mysqldump -c -q user -u webserver -ppassword, $sql); for($i = 0; $i count($sql); $i++) { echo $sql[$i] . \r\n; } ? Hope this helps, Joseph John Taylor-Johnston [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Anyone do MySQLDump using PHP ? http://www.mysql.com/doc/en/mysqldump.html My code is: mysqldump -u ** -p ** -A /home/mybackups/dump_all.sql I would like to pull it off using PHP, remotely. $date = date (Ymd); $to_path = /home/MyBackups/$date/dump_all.sql; mysqldump -u ** -p ** -A $to_path; mysqldump is not PHP?! John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysqldump
u. that should read: exec(mysqldump -c -q database -u user -ppassword, $sql); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Detecting number of pages in a multi-page .TIFF file
Can PHP tell how many pages there are in a multi-page .TIFF file? The tif file would be on the local machine. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can a popup window get the page referer?
Thanks Justin. I should have clarified this is going to be used on an Intranet, where I can be sure that every browser will be IE 6 with javascript enabled, and no firewalls between the webserver and the clients. That's why I felt more or less safe with depending on HTTP_REFERER and javascript. However I do like your random number idea. I'll have to give it a shot. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can a popup window get the page referer?
But... it seems like this will be used in an intranet where everybody is using WinXP so there shouldn't be any problem ;) Actually, it still won't work under Windows. Even on a pop-up window, you can right click, view properties, copy the page address, open a new browser window, paste in the address. It's takes 3 seconds. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can a popup window get the page referer?
...press CTRL-N - there you go, a new window, pointing to the same page, with the addess bar showing exactly where the page is. I use this method quite often :) Furthermore, disabling right-click does NOT disable the Context Menu key (you know, the one in between the Windows key and Cntrl on the right-side of your keyboard). That still gives you the entire right-click menu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can a popup window get the page referer?
Justin, I have no intenetion of implementing such work-arounds. I simply wanted to know if a popup can determine the Referer. With PHP, that answer is no. The continuing discussion has been helpful to clarify what one 'can' and 'cannot' do, not that I'm actually going to use all these methods! I think I have it sorted out, using a variant of your original idea. Thanks! Joseph Justin French [EMAIL PROTECTED] wrote in message news:B9F96111.1728F%justin;indent.com.au... It still seems to me that there must be a fundamental problem with the application design if such great lengths / work-arounds / patch jobs need to be applied. But that's probably another discussion altogether :) Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] displaying a TIFF file
Folks... when I execute the following code, I get a big black nothing. I think it's the right size, but all black. No image is showing up. What gives? Header(Content-type: image/tiff); $filename = image.tif $file = fopen($filename,rb); fpassthru($file); fclose($file); Any help would be appreciated. Thanks. Joesph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] can a popup window get the page referer?
Folks, I have a popup window that I would like to put a mild security constraint on. I don't want others to be able to directly type in the address of this page, modify url parameters, etc. I only want this page accessible if it was triggered from a link on my own website, then I know I can trust the URL parameters, etc. I had thought about parsing the HTTP_REFERER and extracting the host, and comparing it with my domain name. This would tell me if a valid link was clicked. One problem... HTTP_REFERER appears to be empty when it's a new window. For some reason I thought the referer would still be detected. Am I up a creek? Is there anyway for a popup window to get the page referer (in other words, the popup opener)? Thanks, Joseph. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Flash and PHP?
http://www.macromedia.com/desdev/mx/flash/articles/flashmx_php.html http://www.phpbuilder.com/columns/hill20011214.php3 Neil [EMAIL PROTECTED] wrote in message news:20021029140955.29707.qmail;pb1.pair.com... Does anyone use this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: flash - php
Couple good places to start... http://www.phpbuilder.com/columns/hill20011214.php3 http://www.macromedia.com/desdev/mx/flash/articles/flashmx_php.html Joseph Zeljko Bozic [EMAIL PROTECTED] wrote in message 001b01c26ca2$cc79c7b0$b3411ad9@stuntssw9fdkdl">news:001b01c26ca2$cc79c7b0$b3411ad9@stuntssw9fdkdl... I'm new to php. want to build swf appl. with sql support need some example (source) please help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] extract domain name from a URL
Folks, I want to keep track of referers to my site. I want to store the domain name of the referer in a db field. I want 'just' the domain name, not the full url. So I need a snippet of code that could parse the $HTTP_REFERER, and return just the domain name. Example 1) http://www.google.com 2) http://www.google.com/ 3) http://www.google.com/search?sourceid=navclientq=evil+microsoft ... would all give me http://www.google.com Could anyone give me a hand? Thanks! -- : Joseph Szobody : Computers are like airconditioners: They stop working properly if you open windows. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: extract domain name from a URL
Never mind. Didn't realize PHP had the parse_url function. Got it! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Searching a db
Joshua, I learned a ton by reading this tutorial. See if it helps... http://www.zend.com/zend/tut/tutorial-Ferrara.php Joseph Joshua E Minnie [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey all, I am looking for a way to search a MySQL DB based on a users input string. The string would be searched on particular fields in my DB, which is already setup. The problem I am having is that I want to be able to return strings that match all *or* part of their string. Right now it only returns exact (case-insensitive) matches. But I want to be able to return partial matches as well. I have the relevancy calculation worked out but I'm not sure how to go about gathering the partial matches. i.e. User inputs: Christmas Output would be something like: Christmas (100%) Christian (67%) Christy (67%) Chandelier (20%) Anything below 10% will not be displayed. I am using a class I found at phpclasses.org called better_field_search. I am looking to modify it to fit my needs but I'm not sure how to go about it. If anyone has done anything similar, I would greatly appreciate any help or direction provided. -- Joshua E Minnie Advantage Computer Services, LLC Senior Project Manager [EMAIL PROTECTED] Phone: 269.276.9690 Fax: 269.342.8750 Don't work for recognition, but always do work worthy of recognition. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Specify authentication for SMTP mailserver?
I'm trying to send mail on a Windows machine using PHP. I have made the necessary corrections in the php.ini file for the SMTP server address, and the sendmail_from, my problem is that my SMTP server require authentication. How do I tell PHP to provide this? Thanks! Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Running a PHP script automatically?
Folks, I have a PHP script that needs to be executed automatically every 15 minutes. I have the option of doing this on a RedHat linux box, or on Windows 2000 Server. How would I do this (on either platform) and which would be easier? I believe somehow I could create a cron job on linux, but I'm a bit confused how that would work. Would I just call the php script using Lynx? If so, does the Lynx process die when the php script is finished? Will I have dozens of Lynx processes still running at the end of the day? In Windows, I believe I could use the task scheduler, or something like that. But again, how exactly would I call the script? I certainly don't want a new browser window to open every 15 minutes, especially if it doesn't close again. Any insight? Thanks! Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dynamic HTML Email
Mike, Here is how I send an HTML e-mail. Say I have a contact form with the values $name, $email, and $message. The form submits to say. process.php. ? // process.php $message = stripslashes(nl2br($message)); $date = Date(F d, Y h:i a); $body = pfont color='#99' face='Arial, Helvetica, sans-serif'strongContact Us Submitted $date/strong/font/p table width='300' border='1' cellspacing='1' cellpadding='3' tr td width='113'font face='Arial, Helvetica, sans-serif'Name:/font/td td width='187'font face='Arial, Helvetica, sans-serif'$name/font/td /tr tr tdfont face='Arial, Helvetica, sans-serif'E-mail address/font/td tdfont face='Arial, Helvetica, sans-serif'$email/font/td /tr tr tdfont face='Arial, Helvetica, sans-serif'nbsp;/font/td tdfont face='Arial, Helvetica, sans-serif'nbsp;/font/td /tr tr tdfont face='Arial, Helvetica, sans-serif'Message:/font/td tdfont face='Arial, Helvetica, sans-serif'$message/font/td /tr /table ; $subject = Contact Us submission from your website; $to = John Doe [EMAIL PROTECTED] . , ; //note the comma /* To send HTML mail */ $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; /* This sets the 'from' field to the Name and E-mail that was just submitted $headers .= From: ; $headers .= $name; $headers .= ; $headers .= $email; $headers .= \r\n; /* Send it!! */ mail($to, $subject, $body, $headers); ? That's it. The key part are the two header lines that set the MIME-Version, and the Content-type. Other than that it's the same. Note... I changed all the double-quotes in the HTML code to single quotes. This way I could use double-quotes around the whole block of HTML, and simply insert the PHP variables where desired without have to chop apart the $body. (make sense?) Hope this helps. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying PDF file
I've made a website for a real estate appraiser, who wants to put all his appraisals for his clients online. I have stored these PDF documents in a folder outside of the webserver folder, for security. When a client successfully logs in and clicks the link to biew the PDF, I have a PHP script that does the following: ? Header(Content-type: application/pdf); include(../pdfs/whatever.pdf); ? It worked great at first, and still does with some PDF documents. With others, it gives says something like... Parse error: parse error in /path/to/pdfs/whatever.pdf on line 410 Why does it work with some PDF docs, and not others? Is there a better way to display PDF files (without putting them in a web-accessible folder)? Thanks, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Displaying PDF file
Thanks Erwin, that helps but I'm still not getting it to work. Should I still use the Header(Content-type: application/pdf); line? I tried using readfile() keeping the header. When I click the link to the PHP script that should show me the PDF, the IE status bar says something like Downloading from site .blah, then says Done. Nothing happens. I'm still on the previous page. No error, no pdf file... nothing. I removed the Header line, and IE prompted me to download the file. That's not what I want. What am I doing wrong? Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Displaying PDF file
Ok I think it's working now. When I click the link going directly to the PHP script, it's displaying the PDF file in the browser appropriately. Exactly what I want. Now some of these PDF docs are so big, they could take a while to show up if a client is on a slow connection. So now I want to make a 'middle' page that says something like 'dowloading... please be patient' while the PDF is downloading. So here's what I've done. The file getpdf1.php is the following: meta http-equiv=refresh content=0;URL=getapdf2.php Please be patient... downloading getpdf2.php is: Header(Content-type: application/pdf); $file = fopen(../pdfs/whatever.pdf,rb); fpassthru($file); fclose($file); (Thanks to James for this little bit of code) Now... if I link directly to getpdf2.php, it works great. However if I link to getpdf1.php, which redirects to getpdf2.php, IE show the download file dialog. This is NOT what I want, why is this? Weird. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] AOL problem with remote IP address
In a portion of a website, I have implemented user authentication and management using sessions. When a user first logs in, the $REMOTE_ADDR is stored is a session variable SESSION['ip']. On each of the protected pages, a header.php is included with the following code: if ($SESSION['ip'] != $REMOTE_ADDR){ header(Location: error.php?err=2); die; } As you can see, this is an attempt to see if someone is trying to hijack a session. The problem is, AOL doesn't like this. Whenever an AOL user logs into the website, the session starts successfully, but when the user goes to a protected page, he's redirected to error.php?err=2. For some reason, the IP address appears to be changing. Is this a known issue with AOL? Is the IP really changing from page to page? That seems weird. Any way around this, or must I stop using this security approach? Thanks, -- : Joseph Szobody : Computers are like airconditioners: They stop working properly if you open windows. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] AOL problem with remote IP address
But I wouldn't be relying on a remote IP for anything... they're too unreliable. This wasn't meant to be a fool-proof security solution to begin with. None of these 'protected' pages contain anything real sensitive. However... what are some good security procedures (besides an encrypted connection)? I'm pretty new to PHP security issues, can you point me in a direction? Thanks, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] '#' character breaking the URL string
I have a 5-step (5 page) process in which users must answer various questions. Each page passes along the data to the next page, at the same time capturing the data from the previous page and passing that along too. To capture all the data submitted previously, I have the following code: $a = ?; $url = ; while(list($key, $value) = each($HTTP_POST_VARS)) { $url .= $a$key= . htmlspecialchars(addslashes($value)); $a = ; } while(list($key, $value) = each($HTTP_GET_VARS)) { $url .= $a$key= . htmlspecialchars(addslashes($value)); $a = ; } Each page then submits it's own form to nextpage.php? $url ?; I'm trying to simply pass along everything that has already been submitted, via GET or POST. The problem is that I noticed if the character '#' is part of a value for a GET variable, it breaks the whole string. Everything after the '#' is lost. How can I get around this? Is this something I must simply check for and strip out? What other characters must I worry about? As you can see, I'm already putting everything through htmlspecialchars() and addslashes(). Thanks -- : Joseph Szobody : Computers are like airconditioners: They stop working properly if you open windows. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: '#' character breaking the URL string
Thanks. That's what I needed. Joseph Richard Lynch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... I have a 5-step (5 page) process in which users must answer various questions. Each page passes along the data to the next page, at the same time capturing the data from the previous page and passing that along too. To capture all the data submitted previously, I have the following code: $a = ?; $url = ; while(list($key, $value) = each($HTTP_POST_VARS)) { $url .= $a$key= . htmlspecialchars(addslashes($value)); These should be http://php.net/URLEncode, not htmlspecialchars(addslashes(..)) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and multiple page .tiffs
Is there a way for PHP to look at a local multiple-page .tiff file and find out haw many page it has? Thanks, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Accessing multiple List/Menu values
This is sorta OT, but involves PHP. I have a fairly large List/Menu on a form, which allows for multiple selections. I want users to be able to use cntrl/shift-click to select a bunch of items. Let's say this List is called 'list'. Now when I submit the form, how does the processing script access all these different values in 'list'? If I try to echo '$list' it only show *one* of the selected items from the list. I've tried treating it as an array ($list[0], $list[1], etc), but that doesn't work either. How do I get at the different values? Thanks, -- : Joseph Szobody : Computers are like airconditioners: They stop working properly if you open windows. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] can I call a variable... using variables?
So here's what I'm trying to do: I have a form submitting dozens of variables called var1, var2, var3, .. and on and on. I want to check the value of each of these variables: for($i = 1;$i 100; $i++) { if($var$i 0) echo Yup. $var$i is greater than 0; } I get a parse error when trying to run this code. Can I not use $i to call the $var1, $var2, etc. variables? Is there another way of doing this? Thanks, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: can I call a variable... using variables?
Thanks folks. Worked like a charm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] my PHP scripts hangs over a simple error
Folks: I just setup a Redhat/Apache/PHP box for testing purposes as I develop some PHP websites. The weird thing, is that the server takes FOREVER to respond when I make a very simple error in the code. On other servers it comes up with a 'Parse Error' message immediately, but not so with this box. For example, I made a page with the following code: ? echo I'm making a purposeful mistake; echo The semi-colon is missing at the end of this line echo Now I'm going on; ? When I requested this page with my browser, I started my stopwatch and waited. The little blue progress bar started moving, but ever so slowly. 3 minutes later () I got the error message: Parse error: parse error, expecting `','' or `';'' in /var/www/html/test.php on line 4 Now why didn't that come up immediately?! Any help is appreciated. Thanks, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: if statement
try this: if($type==test1 || $type==test2 || $type==test3){ Joseph [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is it possible to do something like this all on one line. What I need is if any one of these are true then run the script if($type==test1)or($type==test2)or($type==test3){ -- Best regards, rdkurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php