RE: [PHP] Redirect to a new page?
if the browser doesn't support Javascript use this : if (YES) { header(Location: thispage.php); } else { header(Location: thatpage.php); } exit(); Just make sure you haven't send any output to the browser yet. A suggestion: place this code before you ever print in your code. I know you could do it :) Thanks, Miches:) -Original Message- From: Beauford.2002 [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 10:44 AM To: PHP General Subject: [PHP] Redirect to a new page? Hi, I have searched around for hours on this and nothing seems to work. I want simply to do this if yes - goto thispage.php if no - goto thatpage.php Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Page Rederection Problems
Hi Kelly, It would be better if you just take off the second part, the one enclosed in . Also, header(Location: location); notice, Location starts with capital L . Hope this helps, miches:) -Original Message- From: Kelly Protsko [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 1:18 PM To: [EMAIL PROTECTED] Subject: [PHP] Page Rederection Problems Basically what I am doing is having a post call a page with the following code to email the form contents. I want the page to redirect back to the page it was sent from after the mail has been sent. The top mailing part works fine but when I put the header redirect in at the bottom I get an error on my post saying the page doesn't exist anymore. Any idea what would be causing this? $formcontent = $_POST[content]; $toaddress = [EMAIL PROTECTED]; $subjectline = $_POST[subject]; $headers = From: $_POST[email]; mail( $toaddress, $subjectline, $formcontent, $headers); header(location: http://www.website.com http://www.website.com/ ); Thanks Kelly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Check to see if mysql_fetch_array result is empty
Mike, Use mysql_num_rows($db_query) ; - returns no of rows in the result set. - if none, returns 0. Thanks, Miches -Original Message- From: Mike Tuller [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 11:17 AM To: php mailing list list Subject: [PHP] Check to see if mysql_fetch_array result is empty How can I check to see if a mysql_fetch_array is empty. I have a search page, and want to have it so that when there are no matches, it returns a message saying that there were no matches, and if there are, then display them. Here is what I have so far to give you an idea as to what I am trying to do. Thanks - $query = SELECT * FROM software_assets WHERE $searchType LIKE '$search' ; $db_query = mysql_query($query, $db_connect) or die (mysql_error()); while ($row = mysql_fetch_array( $db_query )) { if $row = NULL { echo There were no results that match your query. Please try again; } else { echo tr td align=\left\a href=\editsoftwareasset.php?id=$row[asset_id]\$row[asset_id]/a/td /td td$row[developer] /td td align=\center\$row[title] /td td align=\center\$row[version] /td td align=\center\$row[platform] /td /tr\n; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Check to see if mysql_fetch_array result is empty
Hi, It's a logical error in your IF stmt. --- if ($num = 0) { echo There are no matches for your search. Please try again.; } else { --- that should have been if ($num == 0) . Notice the two = (==). Thanks, Miches:) -Original Message- From: Mike Tuller [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 12:43 PM To: [EMAIL PROTECTED] Cc: php mailing list list Subject: Re: [PHP] Check to see if mysql_fetch_array result is empty Ok. I have it changed, but I have something wrong here, because when I there result is 0, it doesn't print out the message that I want. If I have it print out the result, it says 0. It has to be something simple, but I can't see what is wrong. if ($num = 0) { echo There are no matches for your search. Please try again.; } else { while ($row = mysql_fetch_array( $db_query )) { echo tr td align=\left\a href=\editsoftwareasset.php?id=$row[asset_id]\$row[asset_id]/a/td /td td$row[developer] /td td align=\center\$row[title] /td td align=\center\$row[version] /td td align=\center\$row[platform] /td /tr\n; } } On Thursday, March 13, 2003, at 05:45 AM, Michael Roger C. Bianan wrote: Mike, Use mysql_num_rows($db_query) ; - returns no of rows in the result set. - if none, returns 0. Thanks, Miches -Original Message- From: Mike Tuller [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 11:17 AM To: php mailing list list Subject: [PHP] Check to see if mysql_fetch_array result is empty How can I check to see if a mysql_fetch_array is empty. I have a search page, and want to have it so that when there are no matches, it returns a message saying that there were no matches, and if there are, then display them. Here is what I have so far to give you an idea as to what I am trying to do. Thanks - $query = SELECT * FROM software_assets WHERE $searchType LIKE '$search' ; $db_query = mysql_query($query, $db_connect) or die (mysql_error()); while ($row = mysql_fetch_array( $db_query )) { if $row = NULL { echo There were no results that match your query. Please try again; } else { echo tr td align=\left\a href=\editsoftwareasset.php?id=$row[asset_id]\$row[asset_id]/a/ td /td td$row[developer] /td td align=\center\$row[title] /td td align=\center\$row[version] /td td align=\center\$row[platform] /td /tr\n; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Looking for partner for credit cards
check out http://www.esellerate.net/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 11:22 AM To: [EMAIL PROTECTED] Subject: [PHP] Looking for partner for credit cards Hi, I'm sure lot's of you have done their shop with PHP in the US. Could anybody give me a tip on a good partner that fits into a shopping site? I've to overwork a shop, which cooperates with paypal. They require registration of the credit card user, which is absolutely not acceptable. The shop is still very small so I'd prefer something with a very small monthly fee. Charge for actual transaction doesn't matter that much. 'Hope some of you know one or two good credit card partners (for the usuall credit cards used in the US) thx Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help Needed
Garcha, Kindly check your file paths. When you export it, it may not point to what really is the real path online. May I ask what are you trying to achieve? -Original Message- From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 1:45 PM To: [EMAIL PROTECTED] Subject: [PHP] Help Needed Hey All My Php App is trying to fopen() and fread() a File that is located in the Web Server. This works if the file is a simple html file. However the complicated part is that the file is not displayed correctly i.e. it has missing gifs if, it was created using Fireworks and then subsequently exported as a html. Any help will be highly appreciated TIA Pushpinder Singh Garcha _ Web Architect -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] auto_increment $value
I think this is facing a bigger issue when it comes to Concurrency. When two or more apps in a given time pops the auto_increment or mysql_insert_id (they will get THE SAME ID assuming no other transaction issued an INSERT sql to the table while retrieving the ID). Now, I don't know if this has a major effect on your applications but when your programs get bigger and larger... basing algos on things like this just won't work. Just be very careful though. Thanks, Miches:) -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 1:41 PM To: Eddie Lien Cc: [EMAIL PROTECTED] Subject: Re: [PHP] auto_increment $value Necessary, or at least cleaner, if there are less than 5 records in your database. Why don't you just use select * from table order by id DESC limit 0,5? I don't see any necessary to get the auto_increment value. Anyone know how to get the auto_increment $value out of a mysql table. I'm thinking it is in mysql_fetch_array but don't see how to get it. $SQL = SELECT * FROM table ORDER BY id asc LIMIT $autoindex -5 ,5;; I would like to get the autoindex value of my table and use it in my SQL. Can I get the autoindex? :) How? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] arrray
you can 'serialize' it and pass it as POST or GET variable too, then deserialize it again. Check out these PHP functions : serialize() and deserialize() Hope this helps, Miches:) -Original Message- From: Diana Castillo [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 9:39 AM To: [EMAIL PROTECTED] Subject: [PHP] arrray Is the only way to keep an array alive between one class and another to store it as a session array? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help Needed
I agree with the security on files especially on case of downloadable files. I suggest you use absolute paths for retrieving your files. say ( http://www.a.com/pathofyourfile/ or simply the platform /home/user/htdocs/files/pathtoyourfile/) Also, it's neat to have sorta config file on your scripts to maintain the directory paths. But oops, I maybe over acting here:))) Yet, I'm sorry I'm not familiar with the MacOS Jag Platform, but perhaps PNG files aren't compatible on that machine. Thanks, Miches -Original Message- From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 2:13 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Help Needed Thanks for the prompt reply Michael I am trying to protect files on the site, my script checks for a valid session ID and fopens() a File. This file is located in a different Dir from the php script. When the file is a simple html file , I can easily fopen() the file (Even though it contains gifs) The real problem arises is when this html file has been exported from Fireworks (I.E. .png file ) The resulting file shows many missing links wihen I try to fread() the html file. Although the file is displayed fine when I point my Browser (Mozilla) to it. I am testing on the MAC OS Jaguar Platform Thanks again --pS On Tuesday, March 11, 2003, at 09:12 AM, Michael Roger C. Bianan wrote: Garcha, Kindly check your file paths. When you export it, it may not point to what really is the real path online. May I ask what are you trying to achieve? -Original Message- From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 1:45 PM To: [EMAIL PROTECTED] Subject: [PHP] Help Needed Hey All My Php App is trying to fopen() and fread() a File that is located in the Web Server. This works if the file is a simple html file. However the complicated part is that the file is not displayed correctly i.e. it has missing gifs if, it was created using Fireworks and then subsequently exported as a html. Any help will be highly appreciated TIA Pushpinder Singh Garcha _ Web Architect -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Pushpinder Singh Garcha _ Web Architect -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Automatically Save Image?
Hi, You can read the file via fopen() and fread(), and then pass the resulting data to the client browser... Thanks, Miches;) -Original Message- From: Boaz Yahav [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 2:44 PM To: Doug Coning; [EMAIL PROTECTED] Subject: RE: [PHP] Automatically Save Image? How to let a user download a picture by clicking on it instead of needing to right click and Save-As. http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1562 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Doug Coning [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2003 1:19 AM To: [EMAIL PROTECTED] Subject: [PHP] Automatically Save Image? Hi, I'm developing a flash site that uses PHP and MySQL to pull in images. My client would like to have a button in flash underneath the images he has shown that would enable the viewer to download the images to their own harddrive. I know I could set it up to open the picture in a new window and have the viewer 'right' click on it and select Save. But is there anyway to automate this so that Flash would open the URL that would automatically open the Save Picture window for saving to the person's harddrive? Thanks, Doug Coning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Online Store
Hi Pag, In my experience, I usually have two database systems. I have the Live DB which is currently the one used by the website which is the one on the hosting server, and I also have a local DB on our local server just here. What I do is I create the back-end applications for the administration of records, like add, edit, and delete. The idea is that for a certain time of day or perhaps weekly, it depends on your need... these two databases should be synchronized... meaning their records be reconciled... Most often in my case it's a one-way direction. Records from your local database will be sent to the live server either for addition or just updating some fields... As a hint: you can just add a field if you'll either ADD or just EDIT a record in the live database... or you can issue a SELECT query and then if it exists.. you can either interpret it as a condition for ADD, else, EDIT.. It depends on your system. On doing the syncs, you can create just a PHP script to send data (i.e. CSV) to the server.. you can use fopen(http://www;) or perhaps just use the POST and GET Methods. The recieving script on your live server will parse and do the necessary actions for your data. Furthermore, you could add your PHP script to your CRON (*nix systems) if you want to create a schedule for your sync times. (say 12:00 Midnight when no one is around in your office) :) Or you can do another workaround in your OS. Otherwise, just run the script manually. ;) Watch out for expiration limits too... as you may have large data to send. :) Hope this helps, Miches -Original Message- From: Pag [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 2:51 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP Online Store Hi, I have to write a PHP/MySQL online store with product catalogs, prices, descriptions, and ordering (no payment) etc, but i have a big doubt when it comes to updating. How is it usually done? I mean, i never did a project like this, with a big amount of products to update. Whats the easiest way of updating the prices like say, every week? The suppliers send a list of the new prices to the store, and the store has to update the prices online manually, one by one? Also i thought of saving the excel file in csv format and uploading to the site, where some sort of parser would collect the new info from it. The problem with that approach would be if the supplier changes a cel on some product name, then everything would be ruined. How is it usually done? Big thanks, i am completely blind in this. Pag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php