[PHP] What is wrong here?
Hi all, I'm making a site which will reside in a remote server and had several problems... most of them where solved once I saw that register_globals are OFF, but now I dont know which other settings are affecting my scripts. I have trouble with header("Location... because the browser is NOT redirected. If I set an echo statement after I detected that the username and password using $_POST[""], the echo goes OK but if I comment the echo and un-comment the header("Location: http://www.domainname.com";); exit; nothing happens... and no, there isn't anything before that... what can be wrong? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What is wrong here?
In response to all of you wonderful people: Leif, yes and no... I've tried all kind of URLs Ernest, I think you're on the right track here... I'll try that. Kyle, no... I made those errors in the past, so now I make sure I don't (again :) Chris, I tend to forget to append the / after the URL so thanks 4 that. In the other hand, yes... the echo works fine. Now, I don't really know what you mean by "snoop the HTTP traffic" but if it has something to do with the server, then no I can't... Thanks all of you... I'll try these things... Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Cesar Aracena [mailto:[EMAIL PROTECTED]] Enviado el: domingo, 24 de noviembre de 2002 23:06 Para: [EMAIL PROTECTED] Asunto: [PHP] What is wrong here? Hi all, I'm making a site which will reside in a remote server and had several problems... most of them where solved once I saw that register_globals are OFF, but now I dont know which other settings are affecting my scripts. I have trouble with header("Location... because the browser is NOT redirected. If I set an echo statement after I detected that the username and password using $_POST[""], the echo goes OK but if I comment the echo and un-comment the header("Location: http://www.domainname.com";); exit; nothing happens... and no, there isn't anything before that... what can be wrong? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- 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] includes & globals
Hi all, I'm making a site with a dynamic menu based on IF statements and DB queries, but have this little problem which I can't understand the reason. My programming method is based upon an application.php file which controls the hole site and paths, template files for the header & footer and main PHP files which includes all the needed files that I mentioned before. As an example of this, the header TITLE tag has a variable to take a different title for each page and after that, I put a $LOCATION variable to tell the menu() function which page is being displayed (different menus for products, about us, etc.) but the menu() function (fetched from a library) is not recognizing this $LOCATION variable. I'm declaring it as a GLOBAL inside the function, but nothing happens. Here's part of my code: This is part of my product's index.php file: templatedir/header.inc"); ?> === And this is the menu() function: function menu(){ GLOBAL $LOCATION; if ($LOCATION = "productos"){ GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK, $CFG; $MENU_NAME = "Nosotros"; $MENU_LINK = "".$CFG->wwwroot."/nosotros"; $MENU_BACK = "66"; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK; $MENU_NAME = "Productos"; $MENU_LINK = "".$CFG->wwwroot."/productos"; $MENU_BACK = "99"; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK; $MENU_NAME = "Regístrese"; $MENU_LINK = "".$CFG->wwwroot."/registrese"; $MENU_BACK = "66"; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK; $MENU_NAME = "Contacto"; $MENU_LINK = "".$CFG->wwwroot."/contacto"; $MENU_BACK = "66"; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); } else if ($LOCATION = "nosotros"){ echo "hi"; } else{ echo "none"; } } == Any thoughts? Thanks Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RV: includes & globals
Hi all, I'm making a site with a dynamic menu based on IF statements and DB queries, but have this little problem which I can't understand the reason. My programming method is based upon an application.php file which controls the hole site and paths, template files for the header & footer and main PHP files which includes all the needed files that I mentioned before. As an example of this, the header TITLE tag has a variable to take a different title for each page and after that, I put a $LOCATION variable to tell the menu() function which page is being displayed (different menus for products, about us, etc.) but the menu() function (fetched from a library) is not recognizing this $LOCATION variable. I'm declaring it as a GLOBAL inside the function, but nothing happens. Here's part of my code: This is part of my product's index.php file: templatedir/header.inc"); ?> === And this is the menu() function: function menu(){ GLOBAL $LOCATION; if ($LOCATION = "productos"){ GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK, $CFG; $MENU_NAME = "Nosotros"; $MENU_LINK = "".$CFG->wwwroot."/nosotros"; $MENU_BACK = "66"; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK; $MENU_NAME = "Productos"; $MENU_LINK = "".$CFG->wwwroot."/productos"; $MENU_BACK = "99"; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK; $MENU_NAME = "Regístrese"; $MENU_LINK = "".$CFG->wwwroot."/registrese"; $MENU_BACK = "66"; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK; $MENU_NAME = "Contacto"; $MENU_LINK = "".$CFG->wwwroot."/contacto"; $MENU_BACK = "66"; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); } else if ($LOCATION = "nosotros"){ echo "hi"; } else{ echo "none"; } } == Any thoughts? Thanks Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Querying two tables
Hi all, I have several tables from which I have to fetch certain products & categories based on customer selection. The tables are as follows: Table 1 - Categories catid (autonum) catname Table 2 - Sub categories subcatid (autonum) subcatname Table 3 - Products prodid (autonum) prodname Table 4 - Relationships Catid Subcatid Prodid Now, the question is how to fetch all the sub-categories let's say that are related to category 0001. I know it's as simple as relating two tables in one query, but I don't remember how. Any help appreciated. Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Javascript var to PHP
Hi all, I want one of my links to open a brand-new pre defined window using a javascript (defined in the header) with javascript: launchinfopage(); but I don't know how to pass a variable so the opened PHP file knows which info to get from MySQL... if I use launchinfopage(varname=varvalue) how can I retrieve that info? Thanks, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Javascript var to PHP
Jon, thanx for the fast response, but the problem is that the link is made dynamically from a DB and the varvalue changes on every link... if it helps, I make this link list with a FOR loop in PHP and the varvalues I want to pass are the IDs of a table elements. Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Jon Haworth [mailto:[EMAIL PROTECTED]] Enviado el: miércoles, 18 de diciembre de 2002 7:50 Para: 'Cesar Aracena'; Php-General@Lists. Php. Net Asunto: RE: [PHP] Javascript var to PHP Hi Cesar, > I want one of my links to open a brand-new > pre defined window using a javascript > but I don't know how to pass a variable so > the opened PHP file knows which info to get > from MySQL... In your launchinfopage() function, presumably you're specifying the url of the page ("foo.php" or something)? If so, just tack the variables on the end of the url as normal: foo.php?varname=varvalue And then, in foo.php, look in the $_GET array: echo "varname is ". $_GET['varvalue']; I do this quite a lot, I can go and dig up the code if you're still having problems. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Javascript var to PHP
Actually Jon, the IDs are not exactly expressed that way, but your example gave me a nice idea... To tell you the truth (and now that I have a clearer idea of what to do), the id I need to pass along is from a random quote (or FAQ) but I'll fetch it before script is being declared (even before the HTML tag) and then target the script to a moreinfo.php?var=varvalue page... (does that make any sense?) thanks a lot. Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Jon Haworth [mailto:[EMAIL PROTECTED]] Enviado el: miércoles, 18 de diciembre de 2002 8:08 Para: 'Cesar Aracena'; 'Php-General@Lists. Php. Net' Asunto: RE: [PHP] Javascript var to PHP Hi Cesar, > Jon, thanx for the fast response, but the problem is > that the link is made dynamically from a DB and the varvalue > changes on every link... if it helps, I make this link > list with a FOR loop in PHP and the varvalues > I want to pass are the IDs of a table elements. You probably need to do it along these lines: // assume ids are in $id[1...10] for ($i = 1; $i <= 10; $i++) { echo 'click for more info"; } and, in your JS function: function launchinfopage(id) { url = "infopage.php?id=" + id; // open url however you like } I imagine you have your url hardcoded in your launchinfopage() function... this makes it less portable, you may want to consider passing the complete url to a generic "open new window" function. HTH Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Selecting what's for deletion
Hi all, I'm making the administration part of a site which handles categories, sub categories and products. Inside the "Categories" part, there's a "List categories" button which gives a list of the categories and sub categories when pressed. Along with each category, there's a "Delete" button that, when pressed, it's supposed to delete that category from the DB. The problem here is that the lists is made dynamically using a FOR loop and is being placed inside a FORM so the action is handled through an ACTION="" tag. Now, the ACTION tag points to a php file which deletes the desired row in the DB. The question is how to tell that php file (through GET or POST) which row to delete... My first shot was to name each "Delete" or submit button inside form like "delcategory?catid=0001" but then the POST wasn't reading that... Any thoughts? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Selecting what's for deletion
Thanks John and Marek for your fast responses. I made the decision to opt for the "hidden" tag option. Now, I'll show you the part of my code that hangs when trying to make what I intend it to do. $query1 = "DELETE * FROM maracat WHERE catid = $catid"; $result1 = mysql_query($query1) or die (mysql_errno()); $query2 = "DELETE * FROM marasubcat WHERE catid = $catid"; $result2 = mysql_query($query2) or die (mysql_errno()); $query3 = "DELETE * FROM maraprod WHERE catid = $catid"; $result3 = mysql_query($query3) or die (mysql_errno()); echo "Accion taken"; echo "Back"; I know that it's very tedious to write 1 query for each action taking place, but I think this is easier for me to change in the future. Now, the page gets stuck when reaching this level and doesn't process what I ordered... Any thoughts? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: John W. Holmes [mailto:[EMAIL PROTECTED]] Enviado el: jueves, 26 de diciembre de 2002 18:32 Para: 'Cesar Aracena'; [EMAIL PROTECTED] Asunto: RE: [PHP] Selecting what's for deletion > I'm making the administration part of a site which handles categories, > sub categories and products. Inside the "Categories" part, there's a > "List categories" button which gives a list of the categories and sub > categories when pressed. Along with each category, there's a "Delete" > button that, when pressed, it's supposed to delete that category from > the DB. The problem here is that the lists is made dynamically using a > FOR loop and is being placed inside a FORM so the action is handled > through an ACTION="" tag. > > Now, the ACTION tag points to a php file which deletes the desired row > in the DB. The question is how to tell that php file (through GET or > POST) which row to delete... My first shot was to name each "Delete" or > submit button inside form like "delcategory?catid=0001" but then the > POST wasn't reading that... > > Any thoughts? Thanks in advance, You could use a bunch of forms, if you want to use a button. Since you're using a while() loop, it wouldn't be a big deal... While(fetching_from_db) { Other data } Then the delete button on each row is for it's own form with a hidden cat_id element that you can use to tell which row to delete. Even better would be to use checkboxes, so you can delete multiple rows at one. Name them And when it's submitted all of the checked boxes will be in $_POST['delete'], so you can do this: $delete_ids = implode(",",$_POST['delete']); $query = "DELETE FROM table WHERE ID IN ($delete_ids)"; Add in your own validation, of course... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- 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] Auto_incerement value
Hi all, This is a fast question. Does anyone remembers how to obtain the ID auto assigned after an INSERT statement under MySQL? Thanks in advanced, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Zerofill
Hi all, Sorry to bother you all, but I need something I haven't used in quite a long time. Dows anyone remembers the PHP function to fill a number with zeros until it reaches a desired length? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mass-mailing method
Hi all, I did a registration page for a customer, and now I'm trying to develop a way for him to send an e-mail once in a while to the people registered with him. I did something (shown below) and everything seems to be ok, but the e-mail never reaches... Can someone find the problem or maybe point me to something already done to send multiple e-mails as BCC??? Thanks in advance, $query = "SELECT * FROM mararegistro2 ORDER BY lname"; $result = mysql_query($query) or die (mysql_errno()); $num_rows = mysql_num_rows($result); for ($x=0; $x < $num_rows; $x++) { $row = mysql_fetch_array($result); $bcc .= $row[email]."; "; } $myname = "".$name.""; $myemail = "".$email.""; $contactemail = $bcc; $message = "".$mes.""; $subject = "".$subject.""; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$myname." <".$myemail.">\r\n"; $headers .= "Bcc: ".$contactemail."\r\n"; $headers .= "Reply-To: ".$myname." <".$myemail.">\r\n"; $headers .= "X-Priority: 1\r\n"; $headers .= "X-MSMail-Priority: High\r\n"; $headers .= "X-Mailer: Joyeria Mara"; $mail = mail("", $subject, $message, $headers); Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mass-mailing method
I'm going to try changing that. I don't have access to my client's server as I work remotely, so I can't view any logs... or can I? If anyone else have something for me to try, start shooting... Thanks, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Michael J. Pawlowsky [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 03 de enero de 2003 3:15 Para: Cesar Aracena; [EMAIL PROTECTED] Asunto: Re: [PHP] Mass-mailing method Take a look at the sendmail.log for some clues... But I had something weird were it worked fine for me at home Linux 8 PHP 4.2.2 and when I sent it up to the prod server I had to change the ."\r\n"; to ."\n"; Which technically is wrong. Go figure! But take a look at the sendmail log to begin with. Mike *** REPLY SEPARATOR ******* On 03/01/2003 at 3:08 AM Cesar Aracena wrote: >Hi all, > >I did a registration page for a customer, and now I'm trying to develop >a way for him to send an e-mail once in a while to the people registered >with him. I did something (shown below) and everything seems to be ok, >but the e-mail never reaches... Can someone find the problem or maybe >point me to something already done to send multiple e-mails as BCC??? > >Thanks in advance, > >$query = "SELECT * FROM mararegistro2 ORDER BY lname"; >$result = mysql_query($query) or die (mysql_errno()); >$num_rows = mysql_num_rows($result); > >for ($x=0; $x < $num_rows; $x++) >{ >$row = mysql_fetch_array($result); >$bcc .= $row[email]."; "; >} > >$myname = "".$name.""; >$myemail = "".$email.""; > >$contactemail = $bcc; > >$message = "".$mes.""; >$subject = "".$subject.""; > >$headers .= "MIME-Version: 1.0\r\n"; >$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; >$headers .= "From: ".$myname." <".$myemail.">\r\n"; >$headers .= "Bcc: ".$contactemail."\r\n"; >$headers .= "Reply-To: ".$myname." <".$myemail.">\r\n"; >$headers .= "X-Priority: 1\r\n"; >$headers .= "X-MSMail-Priority: High\r\n"; >$headers .= "X-Mailer: Joyeria Mara"; > >$mail = mail("", $subject, $message, $headers); > > > >Cesar L. Aracena >[EMAIL PROTECTED] >[EMAIL PROTECTED] >(0299) 156-356688 >Neuquén (8300) Capital >Argentina > > > > >-- >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] DUMB QUESTION I'M SURE
Try by adding a backslash to the : there (..."\: "...) Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Adam French [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 03 de enero de 2003 3:18 Para: [EMAIL PROTECTED] Asunto: [PHP] DUMB QUESTION I'M SURE I'm just starting out, this is my script... " .$feildvalue. ""; } echo""; } ?> This is the error I get... Parse error: parse error, unexpected ':' in C:\Xitami\webpages\php\result1.php on line 12 I dunno what I'm doing wrong. Help please??? -- 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] DUMB QUESTION I'M SURE
What they mean is to make that line: $query = "SELECT shops.name FROM shops WHERE name = $name"; Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Adam French [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 03 de enero de 2003 3:18 Para: [EMAIL PROTECTED] Asunto: [PHP] DUMB QUESTION I'M SURE I'm just starting out, this is my script... " .$feildvalue. ""; } echo""; } ?> This is the error I get... Parse error: parse error, unexpected ':' in C:\Xitami\webpages\php\result1.php on line 12 I dunno what I'm doing wrong. Help please??? -- 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] Strange problem with MAIL
Hi all, I've been trying to make my way around a complex mailing system for the past couple of days with no success, but now I noticed that I can't just send a simple: mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3"); I used to make this scripts work all the time before using the same hosting but something changed now... is there a way to see what's going on using phpinfo.php or other way??? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with MAIL (Correction)
Hello Manuel and all, I just checked my hotmail account (one of three I'm sending to) and all the emails arrived correctly (sorry for the re-post) but it's not reaching the other two. One of them, I know it has a very poor configuration and can hardly receive e-mails from PHP scripts, but the other one usually works correct (the one I have with the hosting)... Can anyone tell me what are the headers sent usually so mostly everyone can receive the mails? Thanks again, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Cesar Aracena [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 06 de enero de 2003 7:22 Para: [EMAIL PROTECTED] Asunto: [PHP] Strange problem with MAIL Hi all, I've been trying to make my way around a complex mailing system for the past couple of days with no success, but now I noticed that I can't just send a simple: mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3"); I used to make this scripts work all the time before using the same hosting but something changed now... is there a way to see what's going on using phpinfo.php or other way??? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- 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 $query help
First, try to complete that query by executing it. You do that by adding the next couple of lines right after the $query: $result = mysql_query($query); // supposing you already established the connection and that you use MySQL. $num_rows = mysql_num_rows($result); // To count how many matches where found Then compare the names that you have stored with the new one like: if ($num_rows > 0) { echo "Sorry, that name is taken"; } else ($num_rows == 0) { echo "Welcome ".$name.""; } This is made from memory, so it might not work right on. Hope it helps, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: - [ Paul Ferrie ] - [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 06 de enero de 2003 10:16 Para: [EMAIL PROTECTED] Asunto: [PHP] php $query help Here is my problem I have created a user login system (flash+php+mysql) And it just about works Here's the prob when i go to register as a new user the code wont properly check to see if the username already exsist's in the DB, I am pretty sure the problem lies in my first $query PHP: -- $query = "SELECT name FROM contacts WHERE name='$name'"; if ($name == $name) { print "loginT=UserName in Use"; }else{ $query = "INSERT INTO contacts (name, pass, email, id) VALUES ('$name', '$pass', '$email', NULL);"; } $result = mysql_query($query); // Gets the number of rows affected by the query as a check. $numR = mysql_affected_rows($Connect); if ($numR == 0) { // Sends output to flash print "loginT=Error - Register Again"; } else if ($numR == 1) { // Sends output to flash print "loginT=Success&checklog=1"; } -- If i take out PHP: -- $query = "SELECT name FROM contacts WHERE name='$name'"; if ($name == $name) { print "loginT=UserName in Use"; -- THe login system works fine but dupilcate entries can be submitted to the database. Please help i would love to get this up and running Cheers -- 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] Dynamic menu from DB
Hi all, I'm making a new site for a client and he needs to put several different menus under a static FLASH menu. The bad part is that every item in the flash menu leads to different categories and these need different number of sub menus. I use MySQL & PHP 4. The categories and sub categories are something like this: * Products <-- Flash static menu - Item 1 <-- MySQL fetched menu - Item 2 <-- MySQL fetched menu - Item 3 <-- MySQL fetched menu - Item 3-1 <-- MySQL fetched menu - Item 3-2 <-- MySQL fetched menu * Services <-- Flash static menu - Item 1 <-- MySQL fetched menu - Item 1-1 <-- MySQL fetched menu - Item 1-2 <-- MySQL fetched menu - Item 2 <-- MySQL fetched menu - Item 3 <-- MySQL fetched menu What would be the best solution for this? Another problem to solve is the creation of new children into the menu... sub categories AND items dynamically. Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] nl2br too?
Hi all, When I make a form in a web site for a visitor to send me some comments, I use nl2br() to put things like line breaks and see what the visitor wants me to see. But what happens if I have a web form to input some text into a TEXT cell in MySQL and want to retrieve it like I wrote it? Should I use nl2br too? How should I use it and What's gonna end up stored in the DB? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions or Cookies?
Hi all, I'm about to create a site where visitors will be able to search, view, surf and add items to a shopping cart without logging in to the site, but will need to do that in order to complete the transaction of course. What I wonder, is what to use to collect information about the items the visitor has chosen in order to show them in the cart section... Should I use the no-so-secure old cookies method or should I start a new session every time a client drops in and handle each cart by session name or ID? Of course I would rather store every visitor's temporary cart in a long MySQL DB and not in their Hard Disks because of those 4 Kb of limit cookies have. Any suggestions? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Header sent polem
Hi all, Following Chris's idea on how to handle visitors sessions, I'm trying to setup a cookie with a randomly generated session ID but it throws me the "headers already sent" notice but there's nothing above the setcookie function. Here's part of my code: getHTMLPassword(); setcookie("sessid", "".print($RandPassword)."", time()+3600); } else if (isset($sessid)) { echo "$sessid"; } [---snip---] and after all this is then called the header and main files... What is getting outputted to the browser? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Random string (was Header sent problem)
I found that the Header already sent problem was caused by the Random Password Generator I'm using, even if I place this function on the bottom of the same file I'm trying to open an just call for the result. So, to avoid this issue, I need another method of generating a random number or string of some sort like using the actual time which I can place inside the setcookie function directly... anyone knows what can I use? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiplication of double
Hi all, I guess this problem might sound childish for most of you, but I'm having it right now. I get two numbers from a FORM, one price and one quantity and I need to make a multiplication with them in order to store the total amount also as a double expression... I'm trying with: $totalprice = $price * $qty; but when I echo the, it gives me just plain old 0 (zero). Any suggestions? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can I use white spaces?
Hi all, I've encountered myself trapped into a big mystery this time, and that's because of some white spaces. I have a MySql table which I use to store users and visitors information, but when I want to display this information on screen for them to see and/or correct, every field that has white spaces are stripped to the first word, so I need something more "Address: Avenue" to ship a product don't I? How can I correct this in PHP? I've tried with stripslashes but white spaces are not treated like quotes (am I right?). FYI, there are Varchars and TEXT fields having this problem. Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can I use white spaces?
You where nothing but right. I didn't know that PHP's html HAD to have all of the quoting right for PHP to work properly. Thank a lot! Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Larry E. Ullman [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 20 de enero de 2003 2:04 Para: Cesar Aracena CC: [EMAIL PROTECTED] Asunto: Re: [PHP] Can I use white spaces? I suspect (but could be wrong) that you aren't quoting these values in your forms. Be sure that you are using... Larry -- 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] Loop inside a table
Hi all, I always make for loops inside tables so I usually don't have problems with it, but this case is a little different. I'm making a mail program for my client to receive a mail each time a customer places an order in his site. Inside the mail program, I declaring a value called $message where an HTML form is being created dynamically, depending on the products selected by the customer or visitor. The problem is that PHP apparently won't let me do a for loop inside this variable. I have something like this: $message = " title goes here ". for ($x = 0; $x < $num_rows; $x++) { //several lines made dynamically } ." ; and the error goes like: unexpected T_FOR in line xxx (where my for loop is). I've never tried this in the past, so I assumed it had to be done normally but I see I was mistaken. Anyone did this before? What's the problem here? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Loop inside a table
Thanks a lot! I was already doing something of the sort, but with a LOT more $message .= Thanks again, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Jim Lucas [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 20 de enero de 2003 14:41 Para: Cesar Aracena; [EMAIL PROTECTED] Asunto: Re: [PHP] Loop inside a table instead of doing that your should do this $message = " title goes here "; for ($x = 0; $x < $num_rows; $x++) { $message .= "some stuff"; } $message .= " "; you were also missing your last double quote. Jim ----- Original Message - From: "Cesar Aracena" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 20, 2003 9:37 AM Subject: [PHP] Loop inside a table Hi all, I always make for loops inside tables so I usually don't have problems with it, but this case is a little different. I'm making a mail program for my client to receive a mail each time a customer places an order in his site. Inside the mail program, I declaring a value called $message where an HTML form is being created dynamically, depending on the products selected by the customer or visitor. The problem is that PHP apparently won't let me do a for loop inside this variable. I have something like this: $message = " title goes here ". for ($x = 0; $x < $num_rows; $x++) { //several lines made dynamically } ." ; and the error goes like: unexpected T_FOR in line xxx (where my for loop is). I've never tried this in the past, so I assumed it had to be done normally but I see I was mistaken. Anyone did this before? What's the problem here? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- 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] Checkboxes
Hi all, I am wondering what would be the best way to handle checkboxes. I am making a site that will display several items in a 20-items-per-page format and each item will have a checkbox next to it for the user to select them. Now, what I need to do is to record the items selected by the user when clicking the Next button into a MySQL table. Should I name all the checkboxes the same, using the item IDs as values and then use an array to see which ones where selected or maybe another thing? Thanks in advanced, Cesar Aracena <http://www.icaam.com.ar> www.icaam.com.ar Note: The information inside this message and also in the attached files might be confidential. If you are not the desired receptor or the person responsible of delivering the message, we notify you that it's copy, distribution, keep or illegal use of the information it has it's prohibited. Therefore we ask you to notify the sender by replying this message immediately and then delete it from your computer.
RE: [PHP] Checkboxes
It could be a solution but only working with a few items. My list(s) will be filled up with hundreds of items grabbed automatically out of another MySQL table... would it help too? Maybe naming the checkboxes with each item own ID... anyone? Thanks, Cesar Aracena www.icaam.com.ar > -Mensaje original- > De: Matt Babineau [mailto:[EMAIL PROTECTED] > Enviado el: Viernes, 15 de Agosto de 2003 12:34 p.m. > Para: Cesar Aracena > CC: [EMAIL PROTECTED] > Asunto: Re: [PHP] Checkboxes > > You could try this: > > > > > So basically when it get submitted, you'll have either a 0 or 1 response > to know whether or not it has been checked. > > Does this help? > > Matt > > On Fri, 2003-08-15 at 14:25, Cesar Aracena wrote: > > Hi all, > > > > I am wondering what would be the best way to handle checkboxes. I am > > making a site that will display several items in a 20-items-per-page > > format and each item will have a checkbox next to it for the user to > > select them. Now, what I need to do is to record the items selected by > > the user when clicking the Next button into a MySQL table. Should I > > name all the checkboxes the same, using the item IDs as values and then > > use an array to see which ones where selected or maybe another thing? > > > > Thanks in advanced, > > > > Cesar Aracena > > <http://www.icaam.com.ar> www.icaam.com.ar > > Note: The information inside this message and also in the attached files > > might be confidential. If you are not the desired receptor or the person > > responsible of delivering the message, we notify you that it's copy, > > distribution, keep or illegal use of the information it has it's > > prohibited. Therefore we ask you to notify the sender by replying this > > message immediately and then delete it from your computer. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DATE insertion
Hi all, First of all, thanks to everyone who helped me with the "checkbox" issue. I have an issue here while trying to INSERT INTO a MySQL table a date in a DATE format (-MM-DD). Obviously saying date(Y,m,d) doesn't work. What PHP function should I use? Thanks in advanced, Cesar Aracena www.icaam.com.ar Note: The information inside this message and also in the attached files might be confidential. If you are not the desired receptor or the person responsible of delivering the message, we notify you that it's copy, distribution, keep or illegal use of the information it has it's prohibited. Therefore we ask you to notify the sender by replying this message immediately and then delete it from your computer. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie Question regarding Syntax
I would encourage you to use double quotes instead of single quotes inside the PHP code. After this, you must comment HTML double quotes so the PHP engine does not consider these as part of its code. I would type your example like this: mailto:[EMAIL PROTECTED]">".$row_rep_RS['repEmail'].""; ?> Note how the only concatenated string (using periods) is the variable $row_rep_RS[] and the double quotes inside the HTML link were commented using a backslash. HTH, Cesar Aracena www.icaam.com.ar > -Mensaje original- > De: Creative Solutions New Media [mailto:[EMAIL PROTECTED] > Enviado el: Domingo, 17 de Agosto de 2003 08:08 p.m. > Para: [EMAIL PROTECTED] > Asunto: [PHP] Newbie Question regarding Syntax > > HREF="mailto:[EMAIL PROTECTED]">'.$row_rep_RS['repEmail'].''; ?> > > Obviously this isn't working. What is the proper syntax when you have to > use > double quotes inside the tag? > > Thx > > Tim Winters > Manager, Creative Development > Sampling Technologies Incorporated (STI) > [EMAIL PROTECTED] > [EMAIL PROTECTED] > W: 902 450 5500 > C: 902 430 8498 > > > > > -- > 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] Delimiter WITHOUT lots of IF's
Hi all, I need to create an automatic process for visitors who are adding items into a shopping cart, be able to see how many MBs and how many CDs will the order have. >From this site, visitors will be able to choose one ore more software products from a list of hundreds. I want them to check the cart to see something like: Total size: 872,43 MBs Total CDs: 2 Total price: $XXX,XX Now, I developed a decision function that works with a lot of IF statements, but I only calculated a max o 6 CDs (690,00 MBs max. per CD), but I want to be able to make this automatically... Can someone help me with this? BTW, Using PHP 4+ and MySQL 3+. Thanks in advanced, Cesar Aracena www.icaam.com.ar Note: The information inside this message and also in the attached files might be confidential. If you are not the desired receptor or the person responsible of delivering the message, we notify you that it's copy, distribution, keep or illegal use of the information it has it's prohibited. Therefore we ask you to notify the sender by replying this message immediately and then delete it from your computer. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail() Problem Sending
Before trying to guess what Saddam can and can't do with computers, try sending e-mails to different addresses (different domains... NOT just different usernames). Sometimes, the e-mail server you use is NOT configured properly, so every e-mail does not gets to you. It happened to me too when testing my server's sendmail. The e-mails reached well one of my addresses but not another one. So I pointed the e-mails to a Hotmail account and it reached it. Try it and see what happens. For some e-mail servers, you have to write lots of "extra headers" in the e-mails in order to pass their guard. HTH Cesar Aracena www.icaam.com.ar > -Mensaje original- > De: Ben C. [mailto:[EMAIL PROTECTED] > Enviado el: Lunes, 18 de Agosto de 2003 06:28 p.m. > Para: [EMAIL PROTECTED] > Asunto: [PHP] Mail() Problem Sending > > I have recently had php installed on my server with sendmail. The server > is behind a firewall and SMTP is open on the firewall. However, when I > execute the mail(), it appears to have sent the mail, but I never receive > it. I am not getting any error messages. Has anyone ever run into this > problem? Does anyone have any ideas? > > > -- > 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] Delimiter WITHOUT lots of IF's
Using a cookie (I know, I know...) I plant a cookie in the visitor's browser when he opens the site with a random generated number which expires when the browser(s) is closed. With that SID, PHP stores the orders (one per line) into a "sessions" table in MySQL each with the itemID. Is it fine or am I too messy? TXS, Cesar Aracena > > How are you keeping track of items added being added to the shopping > cart? > > -Original Message- > From: Cesar Aracena [mailto:[EMAIL PROTECTED] > Sent: Monday, August 18, 2003 7:55 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Delimiter WITHOUT lots of IF's > Importance: High > Sensitivity: Confidential > > Hi all, > > I need to create an automatic process for visitors who are adding items > into a shopping cart, be able to see how many MBs and how many CDs will > the order have. > > >From this site, visitors will be able to choose one ore more software > products from a list of hundreds. I want them to check the cart to see > something like: > > Total size: 872,43 MBs > Total CDs: 2 > Total price: $XXX,XX > > Now, I developed a decision function that works with a lot of IF > statements, but I only calculated a max o 6 CDs (690,00 MBs max. per > CD), but I want to be able to make this automatically... Can someone > help me with this? > > BTW, Using PHP 4+ and MySQL 3+. > > Thanks in advanced, > > Cesar Aracena > www.icaam.com.ar > > Note: The information inside this message and also in the attached files > might be confidential. If you are not the desired receptor or the person > responsible of delivering the message, we notify you that it's copy, > distribution, keep or illegal use of the information it has it's > prohibited. Therefore we ask you to notify the sender by replying this > message immediately and then delete it from your computer. > > > > > -- > 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] Delimiter WITHOUT lots of IF's
Ok. Here you have the entire function to see how many CD's the order will contain: function cart_cdqty() { $query = "SELECT * FROM sessions WHERE sess_sid = ".$_COOKIE['SID'].""; $result = mysql_query($query); $num_rows = mysql_num_rows($result); $x = 0; $n = 0; for ($y = 0; $y < $num_rows; $y++) { $row = mysql_fetch_array($result); $n = $n + $row[sess_itemsize]; } if ($n > 0 AND $n <= 690.0) { $x = 1; } elseif ($n > 690.1 AND $n <= 1380.0) { $x = 2; } elseif ($n > 1380.1 AND $n <= 2070.0) { $x = 3; } elseif ($n > 2070.1 AND $n <= 2760.0) { $x = 4; } elseif ($n > 2760.1 AND $n <= 3450.0) { $x = 5; } return $x; } Pretty long if someone wants to order 17MBs don't you agree? Thanks for this, Cesar Aracena > > No, that sounds about right. > > So your table should have the following fields: > > customer_session_id, item_id, quantity, final_price > > so then all you have to do is query this table looking for all items in > customers shopping cart. > > I am not quite sure how you are going about calculating orders in > customer's basket. You said you wrote a function with multiple IF > statements, can you show me the code for this function so that I can get > a better idea of what you are currently doing? > > > -Original Message- > From: Cesar Aracena [mailto:[EMAIL PROTECTED] > Sent: Monday, August 18, 2003 8:38 PM > To: 'Ralph Guzman'; [EMAIL PROTECTED] > Subject: RE: [PHP] Delimiter WITHOUT lots of IF's > Importance: High > Sensitivity: Confidential > > Using a cookie (I know, I know...) I plant a cookie in the visitor's > browser when he opens the site with a random generated number which > expires when the browser(s) is closed. With that SID, PHP stores the > orders (one per line) into a "sessions" table in MySQL each with the > itemID. Is it fine or am I too messy? > > TXS, > > Cesar Aracena > > > > > How are you keeping track of items added being added to the shopping > > cart? > > > > -Original Message- > > From: Cesar Aracena [mailto:[EMAIL PROTECTED] > > Sent: Monday, August 18, 2003 7:55 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Delimiter WITHOUT lots of IF's > > Importance: High > > Sensitivity: Confidential > > > > Hi all, > > > > I need to create an automatic process for visitors who are adding > items > > into a shopping cart, be able to see how many MBs and how many CDs > will > > the order have. > > > > >From this site, visitors will be able to choose one ore more software > > products from a list of hundreds. I want them to check the cart to see > > something like: > > > > Total size: 872,43 MBs > > Total CDs: 2 > > Total price: $XXX,XX > > > > Now, I developed a decision function that works with a lot of IF > > statements, but I only calculated a max o 6 CDs (690,00 MBs max. per > > CD), but I want to be able to make this automatically... Can someone > > help me with this? > > > > BTW, Using PHP 4+ and MySQL 3+. > > > > Thanks in advanced, > > > > Cesar Aracena > > www.icaam.com.ar > > > > Note: The information inside this message and also in the attached > files > > might be confidential. If you are not the desired receptor or the > person > > responsible of delivering the message, we notify you that it's copy, > > distribution, keep or illegal use of the information it has it's > > prohibited. Therefore we ask you to notify the sender by replying this > > message immediately and then delete it from your computer. > > > > > > > > > > -- > > 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] Delimiter WITHOUT lots of IF's
Thanks Curt AND Ralph, This makes it all a lot more clear and easy to understand. And yes, it makes sense. I'll try it now and see what happens. What I've never seen before is what you did with: if($row = mysql_fetch_array($result)) that made me go LOL!!! Thanks in advanced, Cesar Aracena www.icaam.com.ar > > I agree with Curt, use mySQL to get the sum of 'sess_itemsize' then > divide the result by size per disk to get quantity. So your function > should look something like this: > > function cart_cdqty() > { > > $query = "SELECT SUM(sess_itemsize) AS total_size > FROM sessions > WHERE sess_id = ".$_COOKIE['SID'].""; > > $result = mysql_query($query); > > if($row = mysql_fetch_array($result)) > { >$n = $row['total_size']; >$x = ceil( $n / 690.0 ); > >$cart_cdqty = array( >'quantity' => '$x', >'total_size' => '$n', >); > >return $cart_cdqty; > } else { >return false; > } > > } > > Then all you do is call the function like this: > > if(!$cdqty = cart_cdqty()) > { >print 'no items found in your shopping cart'; > } else { >print 'Total Size:' . $cdqty['quantity'] . ''; >print 'Total CDs:' . $cdqty['total_size'] . 'MBs '; > } > > I have not tested this but it should work. > > Ralph > > -Original Message- > From: Cesar Aracena [mailto:[EMAIL PROTECTED] > Sent: Monday, August 18, 2003 8:54 PM > To: 'Ralph Guzman'; [EMAIL PROTECTED] > Subject: RE: [PHP] Delimiter WITHOUT lots of IF's > Importance: High > Sensitivity: Confidential > > Ok. Here you have the entire function to see how many CD's the order > will contain: > > function cart_cdqty() > { > $query = "SELECT * FROM sessions WHERE sess_sid = > ".$_COOKIE['SID'].""; > $result = mysql_query($query); > $num_rows = mysql_num_rows($result); > > $x = 0; > $n = 0; > > for ($y = 0; $y < $num_rows; $y++) > { > $row = mysql_fetch_array($result); > $n = $n + $row[sess_itemsize]; > } > > if ($n > 0 AND $n <= 690.0) { > $x = 1; > } elseif ($n > 690.1 AND $n <= 1380.0) { > $x = 2; > } elseif ($n > 1380.1 AND $n <= 2070.0) { > $x = 3; > } elseif ($n > 2070.1 AND $n <= 2760.0) { > $x = 4; > } elseif ($n > 2760.1 AND $n <= 3450.0) { > $x = 5; > } > > return $x; > } > > Pretty long if someone wants to order 17MBs don't you agree? > > Thanks for this, > > Cesar Aracena > > > > > No, that sounds about right. > > > > So your table should have the following fields: > > > > customer_session_id, item_id, quantity, final_price > > > > so then all you have to do is query this table looking for all items > in > > customers shopping cart. > > > > I am not quite sure how you are going about calculating orders in > > customer's basket. You said you wrote a function with multiple IF > > statements, can you show me the code for this function so that I can > get > > a better idea of what you are currently doing? > > > > > > -Original Message- > > From: Cesar Aracena [mailto:[EMAIL PROTECTED] > > Sent: Monday, August 18, 2003 8:38 PM > > To: 'Ralph Guzman'; [EMAIL PROTECTED] > > Subject: RE: [PHP] Delimiter WITHOUT lots of IF's > > Importance: High > > Sensitivity: Confidential > > > > Using a cookie (I know, I know...) I plant a cookie in the visitor's > > browser when he opens the site with a random generated number which > > expires when the browser(s) is closed. With that SID, PHP stores the > > orders (one per line) into a "sessions" table in MySQL each with the > > itemID. Is it fine or am I too messy? > > > > TXS, > > > > Cesar Aracena > > > > > > > > How are you keeping track of items added being added to the shopping > > > cart? > > > > > > -Original Message- > > > From: Cesar Aracena [mailto:[EMAIL PROTECTED] > > > Sent: Monday, August 18, 2003 7:55 PM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP] Delimiter WITHOUT lots of IF's > > >
RE: [PHP] Delimiter WITHOUT lots of IF's
Ralph, I tested the function below but the result at the page is: "CD Quantity: Array" and not the CD quantity according to file size... Why is the array there and what it is supposed to be called with to give one or another result? Thanks, Cesar Aracena www.icaam.com.ar > > Actually, I missed a few things on that function. It should look like > this: > > function cart_cdqty() > { > > $query = "SELECT SUM(sess_itemsize) AS total_size > FROM sessions > WHERE sess_id = ".$_COOKIE['SID'].""; > > $result = mysql_query($query); > > if(!$row = mysql_fetch_array($result)) > { >return false; > } else { >$n = $row['total_size']; >$x = ceil( $n / 690.0 ); > >$cart_cdqty = array( >'quantity' => $x, >'total_size' => $n >); > >return $cart_cdqty; > } > > } > > > -Original Message- > From: Ralph Guzman [mailto:[EMAIL PROTECTED] > Sent: Monday, August 18, 2003 11:41 PM > To: 'Cesar Aracena'; [EMAIL PROTECTED] > Subject: RE: [PHP] Delimiter WITHOUT lots of IF's > Sensitivity: Confidential > > I agree with Curt, use mySQL to get the sum of 'sess_itemsize' then > divide the result by size per disk to get quantity. So your function > should look something like this: > > function cart_cdqty() > { > > $query = "SELECT SUM(sess_itemsize) AS total_size > FROM sessions > WHERE sess_id = ".$_COOKIE['SID'].""; > > $result = mysql_query($query); > > if($row = mysql_fetch_array($result)) > { >$n = $row['total_size']; >$x = ceil( $n / 690.0 ); > >$cart_cdqty = array( >'quantity' => '$x', >'total_size' => '$n', >); > >return $cart_cdqty; > } else { >return false; > } > > } > > Then all you do is call the function like this: > > if(!$cdqty = cart_cdqty()) > { >print 'no items found in your shopping cart'; > } else { >print 'Total Size:' . $cdqty['quantity'] . ''; >print 'Total CDs:' . $cdqty['total_size'] . 'MBs '; > } > > I have not tested this but it should work. > > Ralph > > > > > > -- > 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] Delimiter WITHOUT lots of IF's
Ok, That's logical, but the thing is that even $x and $n are empty, as if the result would give a hole bunch of zeros (but it isn't). Could there be an error in the query or somewhere around that we are all missing? Thanks, Cesar > function cart_cdqty() > { > > $query = "SELECT SUM(sess_itemsize) AS total_size > FROM sessions > WHERE sess_id = ".$_COOKIE['SID'].""; > > $result = mysql_query($query); > > if(!$row = mysql_fetch_array($result)) > { >return false; > } else { >$n = $row['total_size']; >$x = ceil( $n / 690.0 ); > >$cart_cdqty = array( >'quantity' => $x, >'total_size' => $n >); > >return $cart_cdqty; > } > > } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] "back" works in opera but not in internet explorer
> > When I push the back buttom in Opera, I get back to the previous > (database/php-generated) page in my site, but when I'm using IE and push > back, I get a message saying that the page isn't valid any more. > > Is this an internal IE-issue, or could I make my php-script IE-friendly? [Cesar Aracena] This is just a security measure placed there by MS people. It should work after refreshing the page. If you don't want that to appear EVER, then you shouldn't place any session handling, cookies, $_POST and/or $_GET into your PHP code... maybe go back to .htm? HTH Cesar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Delimiter WITHOUT lots of IF's
> > So it's not returning any results? > > What happens when you do the following... > > >> } else { > >>$n = $row['total_size']; > echo ":$n:"; > > Put that echo statement in your code and see what happens. > > If you've already done this and it prints :: (as opposed to :0: which > would indicate a value of zero) then you're sql query is not correct or > there are just no rows that match what you're looking for. > [Cesar Aracena] It does print 0 so I guess something must be wrong somewhere else. My guess is that $row['total_size'] is not fetching anything. Shouldn't the function contain a mysql_fetch_array somewhere? Thanks Cesar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] "back" works in opera but not in internet explorer
> > > This is just a security measure placed there by MS people. It should > > work after refreshing the page. > > But it doesn't... > > Are session variables killed when an IE user presses back button? [Cesar Aracena] Well, They shouldn't. What are you trying to achieve? If it's something like a FORM where the visitor fill up a lot of fields and after a mistake is detected he is asked to go back and correct the problem, then what you're trying to do is worthless. For that, what you should do is pass the filled fields values using HIDDEN text fields back and forth. If this is not the case, please tell everyone what you are trying to accomplish so we can help you. Maybe a little piece of code wouldn't be so bad. Cheers, Cesar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Delimiter WITHOUT lots of IF's :: SOLVED ::
> > > Importance: High > > Sensitivity: Confidential > > Is this being done by your server or by you? > By me, because of my Company's policies and requirements. Sorry if it bothers anyone :) > > It does print 0 so I guess something must be wrong somewhere else. My > > guess is that $row['total_size'] is not fetching anything. Shouldn't > > the function contain a mysql_fetch_array somewhere? > > Ok. If it prints zero that means it's (a) your SQL query works, (b) your > retrieving the value correctly from the $result. There was an error actually in the query, that was passed while copying one of Ralph's answers. Just a Typo that I didn't saw earlier. > > $row['total_size'] seems to be working as expected. If it wasn't working > correctly it'd probably print "Array" or something. > > You're next option would be to try print_r(); > > > echo ""; > print_r($row); > echo ""; > > That will show you exactly what's in $row. > Thanks to everyone who helped me with this. Cesar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Query problem
Hi all, I came back from vacations and forgot some things about queries... can anyone tell me what is wrong with this? of all the error messages I set up in the script, none comes back on the page but the record is not saved... Any thiughts? Thanks in advance, Cesar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Query problem
The problem is that I have a remote "rented" server and I don't have access to these configurations any other ideas are welcome. Thanks any ot - Original Message - From: "BigDog" <[EMAIL PROTECTED]> To: "Cesar Aracena" <[EMAIL PROTECTED]> Cc: "PHP General" <[EMAIL PROTECTED]> Sent: Tuesday, November 12, 2002 11:51 AM Subject: Re: [PHP] Query problem > In your php.ini file you can turn on all the errors have have them > displayed... > > I would suggest doing that and you should see some errors if there are > any. > > Have you verified that dates in the database via mysql command line or > gui application. > > > On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote: > > Hi all, > > > > I came back from vacations and forgot some things about queries... can > > anyone tell me what is wrong with this? of all the error messages I set up > > in the script, none comes back on the page but the record is not saved... > > > > > > > $db = mysql_connect("www.icaam.com.ar", "icaam", ""); > > if (!$db) > > { > > die("No se pudo abrir la base de datos"); > > } > > > > $ok = mysql_select_db("icaam"); > > if(!$ok) > > { > > die("No se pudo acceder a la base de datos"); > > } > > > > $borndate = $bornd . $bornm . $borny; > > $phonenumber = $phone; > > > > $query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate, > > address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c', > > 'c', 12, 'c')"; > > $result = mysql_query($query) or die (mysql_errno()); > > if (mysql_affected_rows() != 1) > > { > > die("Fallo al guardar datos"); > > } > > > > echo "Gracias por administrarnos su información."; > > > > ?> > > > > Any thiughts? Thanks in advance, > > > > Cesar > -- > .: B i g D o g :. > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form with two actions
Hi Scott, what you want to do can be acomplished just by telling php what to do in order... for example run the $query to insert the data into the DB and after that, run a mail function that sends the mail. IF you want to be more elegant in your scripting, do the mailing within an IF clause so the mail will be sent ONLY and ONLY IF the data was succsesfully stored into the DB. Cheers, Cesar - Original Message - From: "Scott" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Wednesday, November 13, 2002 2:05 AM Subject: [PHP] form with two actions > Hello > I would like to know if it is possible to use Php to make a form perform 2 > actions by having the user click on a single submit button. For instance, > send data to a database and email it simultaneously. I would prefer not to > use javascript. If someone could point me to an example I would appreciate it > > Thanks, > S.W. > > -- > 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] Forgoten
Hi all, Im quite rusty with this sessions stuff (just came from vacations) and have this strange problem with a session Im trying to build. Along with that, Im making my first lines of code with a new portable computer and maybe PHP or Apache is not well configured any ideas? The code goes as follows and the result page is below that: 0) { $row = mysql_fetch_array($result); $valid_admin = $row['adminid']; session_register("valid_admin"); header("Location: admin.php"); exit; } else { header("Location: ../index.html"); exit; } } else { header("Location: ../index.html"); exit; } ?> Resulta at IE: Warning: open(/tmp\sess_d25ead36103aaf410d8ad254d206ada3, O_RDWR) failed: No such file or directory (2) in C:\apache\htdocs\joyeriamara\admin\login.php on line 3 Warning: Cannot add header information - headers already sent by (output started at C:\apache\htdocs\joyeriamara\admin\login.php:3) in C:\apache\htdocs\joyeriamara\admin\login.php on line 16 Warning: open(/tmp\sess_d25ead36103aaf410d8ad254d206ada3, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 Any thoughts are welcome and appreciated. Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CCO
Hi all, Before anything else, thanks for the answers to the last request of mine. Now, I'm trying to make a mailing script which is a very common task to do, but from this one, my client needs to send one e-mail to all the recipients stored in a DB every once in a while. I know that is best to send just one e-mail and add all the recipients to the hidden CC (CCO) instead of adding all of them to the "TO" header. Now, I usually use a very comfortable way to configure e-mails by setting all the $vaiables first and then adding a mail() function at the bottom, but I never used a CCO target variable and never less a loop to fetch all the addresses... any thoughts? By the way, I'm very used to work with FOR loops, so I'll try to keep using it. Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie mail () question
Why don't you send your mailing code so the rest of us can see it, help you and maybe even learn something from you too... Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Duncan Ellwood [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 22 de noviembre de 2002 13:30 Para: [EMAIL PROTECTED] Asunto: [PHP] Newbie mail () question I have just built a simple formmail script that validates certain fields and then if alls well mails the information to the client's email addressand displays some confirmatin html. This is all fine except for one minor issue. When I collect the email to check it looks OK etc the header From : in Outlook Express gives the www.servername.com Can I personalise this a bit to display the From: as the email address that the user has supplied i.e $Email I'm v. new to this so any help appreciated! TIA -- 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] Session Problem
Hi all, I'm having this strange issue with a remote server. I'm trying to create a session control for administrative use which works fine in my PC but once I upload these scripts to that server, it doesn't recognize the $username && $password variables and kick me right into the else{} of the login.php script. Here's my code: if ($username && $password) { $db_conn = mysql_connect("www.icaam.com.ar", "icaam", "xxx"); mysql_select_db("icaam", $db_conn); $query = "SELECT * FROM maraadmins WHERE adminuser = '$username' AND adminpassword = password('$password')"; $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) > 0) { $row = mysql_fetch_array($result); $valid_admin = $row['adminid']; session_register("valid_admin"); header("Location: admin.php"); exit; } else { header("Location: ../login.html"); exit; } } else { //header("Location: ../login.html"); //exit; echo "nothing"; } Any thoughts?? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help choosing on-line transactions company
Hi all, Im about to start building e-commerce credit/debit card processing Web Sites in a regular basis but I dont have a clue on how to do that using PHP. I have to consider a couple of things before subscribing with VeriSign or any other company. I wonder if anyone how had implemented this before using pure PHP can give me a head start by pointing me in the right direction on which service to hire based on the next few things: 1. I use only rent-a-server services, so I dont have physical access to the Server and Im sure they wont install any kind of out-of-the-box software for me, so I have to implement everything with PHP. I do have the option for SSL. 2. I live in Argentina, so I need a service that can process credit/debit cards issued not only in the USA or any other first world country but also world wide ones (Visa International, American Express International and Visa Electron cards). 3. I dont have a Merchant Account. I just have a common Checking Account in the US, where the money would be deposited to. 4. If everything goes smooth and I start selling out Web Sites with on-line credit card processing, the system I choose must be able to handle detailed reports, so at the end of the month I know exactly how much I have to transfer to each one of my clients. Thanks for all in advanced, Cesar Aracena www.icaam.com.ar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Persistent database connections in PHP
I haven't heard of persistent connections with MySQL before, and I think is because PHP can't handle it. PHP will connect to the DB every time it has to. Are you really that annoyed for that 0.0003 second that it probably takes your pages to connect to the DB? What I do to manage just ONE connection request per visitor, is request a mainfile.php which also declares a function that connects to the DB. After that is prepared to handle all the queries you want. HTH, Cesar Aracena www.icaam.com.ar > -Mensaje original- > De: Shivanischal [mailto:[EMAIL PROTECTED] > Enviado el: Viernes, 05 de Septiembre de 2003 01:05 a.m. > Para: [EMAIL PROTECTED] > Asunto: [PHP] Persistent database connections in PHP > > Hi friends, > > I wanted help on how to achieve persistent database connections in PHP. > The > database i use is MySQL. I would be grateful if u could also guide me to > resources that tell me how to do it. > > Thanks, > -shiva > > -- > 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] MySQL timestamp to desired date function
Hi all, I have a a timestamp in a DB (14 digits) that I want to display like I want in my pages. I tried to use strtotime, mktime and date functions with no success... it always return the current timestamp instead of the one I have stored. This is what I've done so far: for ($x = 0; $x < $num_rows; $x++) { $row = mysql_fetch_array($result); $date1 = strtotime($row[lugar_lastinsert]); $date2 = date("d \de m \de Y \a \l\a\s H:i:s", mktime($date1)); echo ""; echo ""; echo $row[lugar_name]." - ".$row[lugar_specific]; echo ""; echo ""; echo $date2; echo ""; echo ""; } How can I do this and make it work? Thanks in advanced, Cesar Aracena www.icaam.com.ar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL timestamp to desired date function
Thanks Tom, but using only the strtotime() and later the date() functions, the page throus the following error: Warning: unexpected error in date() in e:\wwwroot\videoteca\index.php on line 52 Now my code looks like this: $date1 = strtotime($row[lugar_lastinsert]); $date2 = date("d \de m \de Y H:i:s", $date1); Any ideas? Thanks, Cesar Aracena www.icaam.com.ar -Mensaje original- De: Tom Rogers [mailto:[EMAIL PROTECTED] Enviado el: Jueves, 18 de Septiembre de 2003 01:48 a.m. Para: Cesar Aracena CC: [EMAIL PROTECTED] Asunto: Re: [PHP] MySQL timestamp to desired date function Hi, Thursday, September 18, 2003, 2:38:50 PM, you wrote: CA> Hi all, CA> I have a a timestamp in a DB (14 digits) that I want to display like I CA> want in my pages. I tried to use strtotime, mktime and date functions CA> with no success... it always return the current timestamp instead of the CA> one I have stored. This is what I've done so far: CA> for ($x = 0; $x < $num_rows; $x++) CA> { CA> $row = mysql_fetch_array($result); CA> $date1 = strtotime($row[lugar_lastinsert]); CA> $date2 = date("d \de m \de Y \a \l\a\s H:i:s", CA> mktime($date1)); CA> echo ""; CA> echo ""; CA> echo $row[lugar_name]." - ".$row[lugar_specific]; CA> echo ""; CA> echo ""; CA> echo $date2; CA> echo ""; CA> echo ""; CA> } CA> How can I do this and make it work? CA> Thanks in advanced, CA> Cesar Aracena CA> www.icaam.com.ar strtotime() returns a timestamp so you don't need the mktime() call $date2 = date("d \de m \de Y \a \l\a\s H:i:s", $date1); -- regards, Tom -- 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] MySQL timestamp to desired date function
Sure. One result is 20030918014916. That sound like MMDDHHMMSS to me right? Thanks, Cesar Aracena www.icaam.com.ar -Mensaje original- De: Cody Phanekham [mailto:[EMAIL PROTECTED] Enviado el: Jueves, 18 de Septiembre de 2003 02:04 a.m. Para: [EMAIL PROTECTED] Asunto: RE: [PHP] MySQL timestamp to desired date function [snip] > I have a a timestamp in a DB (14 digits) [/snip] strtotime() tries to convert textual dates into a UNIX timestamp. eg "10 September 2000" since you've supplied a 14 digit timestamp to strtotime(), the function will throw back unexpected results. can we get some sample data from the lugar_lastinsert field? > -Original Message- > From: Cesar Aracena [mailto:[EMAIL PROTECTED] > Sent: Thursday, 18 September 2003 14:39 > To: [EMAIL PROTECTED] > Subject: [PHP] MySQL timestamp to desired date function > > > Hi all, > > I have a a timestamp in a DB (14 digits) that I want to display like I > want in my pages. I tried to use strtotime, mktime and date functions > with no success... it always return the current timestamp > instead of the > one I have stored. This is what I've done so far: > > for ($x = 0; $x < $num_rows; $x++) > { > $row = mysql_fetch_array($result); > $date1 = strtotime($row[lugar_lastinsert]); > $date2 = date("d \de m \de Y \a \l\a\s H:i:s", > mktime($date1)); > echo ""; > echo ""; > echo $row[lugar_name]." - ".$row[lugar_specific]; > echo ""; > echo ""; > echo $date2; > echo ""; > echo ""; > } > > How can I do this and make it work? > > Thanks in advanced, > > Cesar Aracena > www.icaam.com.ar > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > * This e-mail, including any attachments to it, may contain confidential and/or personal information. If you have received this e-mail in error, you must not copy, distribute, or disclose it, use or take any action based on the information contained within it. Please notify the sender immediately by return e-mail of the error and then delete the original e-mail. The information contained within this e-mail may be solely the opinion of the sender and may not necessarily reflect the position, beliefs or opinions of Salmat on any issue. This email has been swept for the presence of computer viruses known to Salmat's anti-virus systems. For more information, visit our website at www.salmat.com.au. * -- 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] PHP email message composing
Hi all, I am trying to create an automatic email composing script, but I have one big problem here. The message composing method I'm using is the following: /* message */ $message = ' Solicitud de Presupuesto El siguiente mensaje ha sido enviado desde la página de presupuesto de icaam.com.ar: [SNIP] And after a while, I have to know which are the options the visitor has selected. The options might vary depending on two different selections, which are "guided" using arrays. What I've done so far, and doesn't work is: '.if (isset($checkbox[0])) {.' Tipo de Sitio Web '.foreach ($tipo as $key => $value) { echo $value.""; }.' }.' [SNIP] Any ideas on why this isn't working? In another rows, I say for example "Name is '.$first_name.'" (without wuotes) and it works just fine but for the "IF" lines it throws me a parse error... How can I solve this? I've even tried with double quote with the same results. Thanks in advanced, Cesar Aracena <http://www.icaam.com.ar> www.icaam.com.ar
[PHP] CSV file with PHP
Hi all, Does anybody knows how to make a CSV (comma separated values) file with PHP based on results fetched from MySQL? I need it to import it with Microsoft Outlook Express. Thanks in advanced, Cesar Aracena www.icaam.com.ar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Dump using PHP
Hi all, I am wondering if someone could point me to the right functions to use to make a script to dump all the tables in a specific MySQL DB. I need this to keep a daily backup from my site as the hackers are screwing up my site very often these days. Thanks in advanced, ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Dump using PHP
The thing is that I don't have phisical access to the server and it doesn't have telnet access either. What I want to achieve is to make a password protected page inside my site were a button is kept to start a full backup of my MySQL DB and after clicking on it, be able to select the Internet Explorer's option to store the file xxx.sql in my HDD. Is this possible? I use the built'in function of phpbb that does exactly that and it's just beautifull. Thanks again, ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] "Ajai Khattri" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > On Sat, Dec 06, 2003 at 04:39:22PM -0300, Cesar Aracena wrote: > > > I am wondering if someone could point me to the right functions to use to > > make a script to dump all the tables in a specific MySQL DB. I need this to > > keep a daily backup from my site as the hackers are screwing up my site very > > often these days. > > Much easier to use mysqldump in a shell script to do this. > > man mysqldump > > -- > Aj. > Sys. Admin / Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Dump using PHP
"Justin Patrin" <[EMAIL PROTECTED]> wrote news:[EMAIL PROTECTED] > Use mysqldump in a system() call, redirect it to a temp file, then read > it back and out to the browser. > > Or, you could use popen to get the output piped back into php. Make sure > to check the mysqldump options for things you need (I often use -Q -e > --add-drop-table). > > header('Content-type: application/mysql'); > header('Content-disposition: attachment; filename=dump.sql'); > $fd = popen('mysqldump -uuser -ppassword databaseName', 'r'); > while(!feof($fd)) { >echo fgets($fd); > } > pclose($fd); > ?> Thanks a lot. I haven't used this functions ever, but I'm sure PHP.net (and maybe some help from you guys) will do the job. Also thanks to Ajai for the idea. ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and MySQL date
Hi all, I'm making a site and need some tables from wich I can extract date, time and/or date/time later with PHP and I neved had very clear the way the possible formats work with each other so my question is what is the best (or recommended) method to store dates and/or times in a MySQL DB for PHP to work later? Thanks in advanced, ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP and MySQL date
Thanks both of you for the answer. I tried what both of you told me and I found very easy to use the datetime value under MySQL and then fetch it using strtotime() as fireball at sizzling dot com recommended at the "User Contributed Notes" of php.net's function.date.php page rather than using mktime() which can output incorrect dates. Thankis to both and everyone. "Cesar Aracena" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > Hi all, > > I'm making a site and need some tables from wich I can extract date, time > and/or date/time later with PHP and I neved had very clear the way the > possible formats work with each other so my question is what is the best (or > recommended) method to store dates and/or times in a MySQL DB for PHP to > work later? > > Thanks in advanced, > ___ > Cesar L. Aracena > Commercial Manager / Developer > ICAAM Web Solutions > 2K GROUP > Neuquen, Argentina > Tel: +54.299.4774532 > Cel: +54.299.6356688 > E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changing languages
Hi all, I have an issue here. I'm making a english/spanish site and want the browser to remember their preference with a cookie. The first time a visitor comes into the site, they will be taken to the english part (www.site.com/eng/) and when someone clicks over the "Spanish" link, I want the cookie that was setled to be erased and a new one to be placed instead. The thing is that is being done in two separate files because the problem with headers (one for deleting the cookie and the other to place the new one). The script I have (pretty mesy) doesn't erase the cookie OR places the same one over again instead of placing the new one. Here's what I've got so far: THE MAIN INDEX PAGE: http://localhost/icaam10/".$relative_url); } elseif(!isset($_COOKIE['Languange']) AND !isset($lan)) { $value = "eng"; setcookie ("Language", $value, time()+31536000); header("Location: http://localhost/icaam10/eng";); } elseif(!isset($_COOKIE['Languange']) AND isset($lan)) { $value = $lan; setcookie ("Language", $value, time()+31536000); header("Location: http://localhost/icaam10/".$value); } ?> THE "LANSELECT.PHP" PAGE: http://localhost/icaam10/index.php?lan=esp";); } elseif ($_COOKIE['Language'] == "esp") { $value = $_COOKIE['Language']; setcookie ("Language", $value, time()-31536000); header("Location: http://localhost/icaam10/index.php?lan=eng";); } ?> ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Domain Check script
Hi all, Anyone knows about anyPHP script to add a domain check option to a web site like almost any hosting company has? I'm looking into hotcripts.com but everything offered serves also like a registering script for the available domains and I just want to inform my visitors if the domain they entered is available or taken... that's all. Thanks in advanced, ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Domain Check script
Ok... I found it... but not quite what I like. I found this function (thanks to WebWorkz) that needs not only the domain name but also the extension to be written. I changed the form a little bit so the extension is selected by the visitor from a drop down menu but I don't know what to change in the function to use it. Here it is: function whois ($a_server, $a_query, $a_port=43) { $available = "No match"; $a_query = str_replace("www.", "", $a_query); $a_query = str_replace("http://";, "", $a_query); $sock = fsockopen($a_server,$a_port); IF (!$sock) { echo ("Could Not Connect To Server."); } fputs($sock,"$a_query\r\n"); while(!feof($sock)) $result .= fgets($sock,128); fclose($sock); IF (eregi($available,$result)) { echo ("$a_query is available."); echo (""); echo (""); echo ("Domain Check Copyright:"); echo (""); echo (""); echo ("2002 WebWorkz Network, Inc. All Rights Reserved."); } ELSE { echo ("$a_query is not available."); echo (""); echo (""); echo ("Domain Check Copyright:"); echo (""); echo (""); echo ("2002 WebWorkz Network, Inc. All Rights Reserved."); } } The domain variable is $query and the extension I want to add is passed as $ext... any thoughts? Thanks in advanced. "Cesar Aracena" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > Hi all, > > Anyone knows about anyPHP script to add a domain check option to a web site > like almost any hosting company has? I'm looking into hotcripts.com but > everything offered serves also like a registering script for the available > domains and I just want to inform my visitors if the domain they entered is > available or taken... that's all. > > Thanks in advanced, > ___ > Cesar L. Aracena > Commercial Manager / Developer > ICAAM Web Solutions > 2K GROUP > Neuquen, Argentina > Tel: +54.299.4774532 > Cel: +54.299.6356688 > E-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fopen
Hello, I am trying to open my first text file using PHP and my PC almost freezed... please don't laught. Here's my script: function welcometext() { $fp = fopen("../files/welcome.txt", "a+"); while (!feof($fp, 100)) { $text = fgets($fp, 100); echo $text; } fclose($fp); } What can be wrong? Thanks in advanced, Cesar Aracena -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen
Now it gives me the following error message: Warning: fopen(websitename/esp/files/welcome.txt): failed to open stream: No such file or directory in d:\wwwroot\websitename\esp\lib\functions.php on line 6 But the file exists and so does the folder it is into. What can be wrong? I also uploaded the file to my Unix web server for testing purposes, CHMOD the folder to 777 and linked to the file but then other error appeared. When I tried with "rb" for fopen it gave me the same error saying that the file was missing... ??? Thanks, "Gerard Samuel" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > On Sunday 28 December 2003 11:17 pm, Cesar Aracena wrote: > > $fp = fopen("../files/welcome.txt", "a+"); > > > > Change to > $fp = fopen("../files/welcome.txt", "r"); > > Use "r" to read, when you use "a" it appends (or adds) to the file > Its also suggested to use the "b" option to so it would look like > $fp = fopen("../files/welcome.txt", "rb"); > > That is done for portability between *nix and windows. > > More info is at the manual > http://us2.php.net/manual/en/function.fopen.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP cart & Credit Card processing
Hi all, I am building a cart of my own for a site I'm making and would like to know if doing it like this (instead of using a known cart script), I will be able to use any of the Credit Card processing systems there are. If so, which Credit Card processing company has given you the best experience? Thanks all, Cesar Aracena -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Email verification
Hi all, I'm trying to create a script to check for errors in submitted forms. I want the visitor to enter two times the email address and then check for it... This is what I have so far. The scripts checks if the email was entered in both fields, but not if they are equal to each other... ??? if (!trim($email1)) { echo "El E-mail es requerido."; $errors++; if (!trim($email2)) { echo "El E-mail es requerido en ambos campos."; $errors++; if ($email1 != $email2) { echo "Las direcciones de E-mail no concuerdan."; $errors++; } } } What is wrong? Thanks in advanced and happy new year to all. Cesar Aracena -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email verification
Well Brad... it worked. Guess I forgot to use well the IF statements. Thanks. "Brad Pauly" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > On Wed, 2003-12-31 at 11:18, Cesar Aracena wrote: > > Hi all, > > > > I'm trying to create a script to check for errors in submitted forms. I want > > the visitor to enter two times the email address and then check for it... > > This is what I have so far. The scripts checks if the email was entered in > > both fields, but not if they are equal to each other... ??? > > > > if (!trim($email1)) > > { > > echo "El E-mail es requerido."; > > $errors++; > > if (!trim($email2)) > > { > >echo "El E-mail es requerido en ambos campos."; > >$errors++; > >if ($email1 != $email2) > >{ > > echo "Las direcciones de E-mail no concuerdan."; > > $errors++; > >} > > } > > } > > > > What is wrong? Thanks in advanced and happy new year to all. > > The check to see if they are the same needs to be outside of the checks > for being blank. If they are both not blank, you will never get to the > last check. You could check for both in the first if, then do the > comparison. Something like (untested): > > if (!trim($email1) || !trim($email2)) { > echo "El E-mail es requerido en ambos campos."; > $errors++; > } elseif ($email1 != $email2) { > echo "Las direcciones de E-mail no concuerdan."; > $errors++; > } > > - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] No COOKIE Set?
Hi all, My head is about to explode here... I am trying to setup a cookie for every new user that registers in my site and right after that, to send them to the home page... is that so difficult? apparently yes... It does redirect, but when I try to "echo" the $MemberId cookie with: echo $_COOKIE["MemberId"]; Nothing happens... nothing is displayed... also, I can't find where these cookies are being stored. I am developing under WinXP, latest PHP and latest MySQL... other cookies are being stored very well, but I don-t know where... I'm displaying at http://localhost/. ¿¿¿??? Here's my script: if ($use_same_data == "yes") // One kind of information stored { $query = "INSERT INTO members_info ... )"; $result = mysql_query($query); $id = mysql_insert_id(); } elseif ($use_same_data == "") // Other kind of choice of information for shipping address { $query = "INSERT INTO members_info ...)"; $result = mysql_query($query); $id = mysql_insert_id(); } if (!$result) { echo "Error code here"; } else { setcookie ("MemberId", $id, time()+31536000); header ("Location: $CFG->wwwroot"); exit(); } Thax in advanced, Cesar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: No COOKIE Set?
Hi Aidan and thanx for the answer. I placed the exit(); function below the setcookie() function and the page just keeps blank. No error is displayed. I have NOTICES turned off but that's no notice it should give me. Thanks again, Cesar "Aidan Lister" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > Try putting the exit() before the redirect, and see if there's an error when > you attempt to set the cookie. > > > "Cesar Aracena" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hi all, > > > > My head is about to explode here... I am trying to setup a cookie for > every > > new user that registers in my site and right after that, to send them to > the > > home page... is that so difficult? apparently yes... It does redirect, but > > when I try to "echo" the $MemberId cookie with: > > > > echo $_COOKIE["MemberId"]; > > > > Nothing happens... nothing is displayed... also, I can't find where these > > cookies are being stored. I am developing under WinXP, latest PHP and > latest > > MySQL... other cookies are being stored very well, but I don-t know > where... > > I'm displaying at http://localhost/. ¿¿¿??? > > > > Here's my script: > > > >if ($use_same_data == "yes") // One kind of information stored > >{ > >$query = "INSERT INTO members_info ... )"; > >$result = mysql_query($query); > >$id = mysql_insert_id(); > >} > > > >elseif ($use_same_data == "") // Other kind of choice of information > for > > shipping address > >{ > > $query = "INSERT INTO members_info ...)"; > > $result = mysql_query($query); > > $id = mysql_insert_id(); > >} > > > >if (!$result) > >{ > > echo "Error code here"; > >} > >else > >{ > > setcookie ("MemberId", $id, time()+31536000); > > header ("Location: $CFG->wwwroot"); > > exit(); > >} > > > > Thax in advanced, > > > > Cesar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: No COOKIE Set?
It worked but not at all. I placed the setcookie() function in a folder that's under the main one. When displaying the cookie like you told me, now appears right just in the .php files under the same folder of the setcookie() function, but not in the other (like the site's main pages)... ¿?¿?¿? I didn't put any path or domain argument... just the name, value and time... Thanks, Cesar "Jim & Sara Feldman" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] Cesar: I think that the problem is the array in the "echo" statement. I have found that I have to do something like: $simple = $_COOKIE["MemberId"]; echo "Member ID = $simple"; Hope that helps. Jim >Hi all, > >My head is about to explode here... I am trying to setup a cookie for every >new user that registers in my site and right after that, to send them to the >home page... is that so difficult? apparently yes... It does redirect, but >when I try to "echo" the $MemberId cookie with: > >echo $_COOKIE["MemberId"]; > >Nothing happens... nothing is displayed... also, I can't find where these >cookies are being stored. I am developing under WinXP, latest PHP and latest >MySQL... other cookies are being stored very well, but I don-t know where... >I'm displaying at http://localhost/. øøø??? > >Here's my script: > >if ($use_same_data == "yes") // One kind of information stored >{ >$query = "INSERT INTO members_info ... )"; >$result = mysql_query($query); >$id = mysql_insert_id(); >} > >elseif ($use_same_data == "") // Other kind of choice of information for >shipping address >{ > $query = "INSERT INTO members_info ...)"; > $result = mysql_query($query); > $id = mysql_insert_id(); >} > >if (!$result) >{ > echo "Error code here"; >} >else >{ > setcookie ("MemberId", $id, time()+31536000); > header ("Location: $CFG->wwwroot"); > exit(); >} > >Thax in advanced, > >Cesar -- Jim Feldman 14 Linda Lane Newton, MA 02461 617-527-0509 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array into $_SESSION
Hi all, can somebody remind me how to propperly insert not just one but many variables into a $_SESSION handle? php manual doesn't explain it very well. It just says that it can be done. Thanks in advanced, Cesar Aracena -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array into $_SESSION
Thanks a lot :) "Gerard Samuel" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > On Friday 02 January 2004 02:11 am, Cesar Aracena wrote: > > Hi all, > > > > can somebody remind me how to propperly insert not just one but many > > variables into a $_SESSION handle? php manual doesn't explain it very well. > > It just says that it can be done. > > > > $_SESSION['foo'] = array('a', 'b', 'c', 'd', 'e'); > > var_dump($_SESSION['foo'][3]); => 'd' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] No cookie is being set?
Hi again, I have the following code to first start a session and then write a cookie... is that so hard? Well it is starting the session but the cookie is not being set. see: $row = mysql_fetch_array($result); $_SESSION["user"] = $row[member_id]; if ($_POST["autologin"] == "yes") { $id = $_SESSION["user"]; setcookie("memberlogin", $id, time()+60*60*24*365); header("Location: $CFG->wwwroot"); exit(); } else { header("Location: $CFG->wwwroot"); exit(); } What can it be? No error is posted. Thanks in advanced, Cesar Aracena -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No cookie is being set?
As extrange as can be, the echo function simply returns the following: 31536000); but not the setcookie, $varname and $value parts... What's this? Do I havve a missconfiguration in php.ini file? Thanks, Cesar Aracena "Larry Brown" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > shouldn't $row[member_id] be $row['member_id']. In case anyone can profit > from this, when I find a function doesn't work right and I am using > variables in its execution I run an echo/die combination immediately before > the function to verify the data being fed to it is as it should be. In this > example... > > ... > $id = $_SESSION["user"]; > echo "setcookie(\"memberlogin\", ".$id.", ".time() +60*60*24*365.");"; > die(); > setcookie... > > What does this yeild? > > > > > > -Original Message- > From: Cesar Aracena [mailto:[EMAIL PROTECTED] > Sent: Friday, January 02, 2004 2:28 AM > To: [EMAIL PROTECTED] > Subject: [PHP] No cookie is being set? > > > Hi again, > > I have the following code to first start a session and then write a > cookie... is that so hard? Well it is starting the session but the cookie is > not being set. see: > > $row = mysql_fetch_array($result); > $_SESSION["user"] = $row[member_id]; > if ($_POST["autologin"] == "yes") > { > $id = $_SESSION["user"]; > setcookie("memberlogin", $id, time()+60*60*24*365); > header("Location: $CFG->wwwroot"); > exit(); > } > else > { > header("Location: $CFG->wwwroot"); > exit(); > } > > What can it be? No error is posted. > > Thanks in advanced, > > Cesar Aracena > > -- > 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] No cookie is being set?
Hi all, and thanks for all your kind hel. I found the problem although I don't know what was causing it. I simply moved the setcookie() function to another page (standalone to say) and it worked perfectly... my "Cookies" folder started to show/delete the cookie on each request, and also the site could make use of it with no problem. Why you ask? I don't know. I remember reading a long time ago that in some cases the code was read by the server from the bottom up in some case, but I don't know if this is the case... There was NOTHING that altered the setcookie() function above it. Cesar Aracena "Chris Shiflett" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > --- Cesar Aracena <[EMAIL PROTECTED]> wrote: > > I have the following code to first start a session and then write a > > cookie... is that so hard? > > Not hard at all. However, when trying to identify a problem, it is much > easier to try to isolate it. Forget the session, and see if you can set a > cookie: > > > > Try to read it on another page: > > > > If that works, slowly modify it until it is identical to the code in > question, testing after each step. > > Also, make sure the URL you are spcifying in the Location header is an > absolute URL. And, if you are on IIS, the Location header (and response > status code change) might be what is causing the problem, as IIS has a > known bug related to this. > > Hope that helps. > > Chris > > = > Chris Shiflett - http://shiflett.org/ > > PHP Security Handbook > Coming mid-2004 > HTTP Developer's Handbook > http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange counter behavior
Hi all, I know most of you doesn't have the time() for this kind of things, but I have a problem with this beautifull counter script I found on hotscripts. I read it over and over again but I can't find where the problem is. As the code is way too long to write (several .php pages) I uploaded it to http://www.icaam.com.ar/files/ep-dev-counter-3.41.zip. if anyone would be so kind to download it and take a look at it... you may even find it usefull. The problem is that the last counter showed displays a number one (1) after it, so my total visitors show 11, 21, 31, 41... instead of just 1, 2, 3, 4... This one's has no rush... Thanks in advanced. Cesar Aracena -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Collaboration
Hi all, Does anyone knows of any nice PHP/MySQL program (free of course) that could help me do a more efficient collaboration between me and my programming partners? I've tried like 8 of them but the nice ones are pricely. I need to upload/download files, keep track of proyects and users and leave messages for all to see. Thanks in advanced, Cesar Aracena -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php