[PHP] Question for you guys and gals
Hi! I have a problem. I have all my functions (currently) set aside in one file, and I just require_once that page for all of the other pages that may need any of those functions. In those functions I have it setup to echo the link to the CSS page for my site (just a very lazy way of doing it). My problem is on the sites that I use cookies or use the header to redirect a page. How can I still have my CSS on my functions page and not have problems with header errors because of this already being at the top...recommendations? David Smith Programmable Solutions [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not sure of the best way to handle a problem
Actually it does have to do with php.One of my main questions was also about whether it was best to use the script from the command-line or from the web server itself. The network question had to do with php as well. Whether it would be best to use samba or another source. VNC is a poor idea. After all that would suggest changing each one by hand because vnc would require that I would have to run the interpreter on the server. Which I did say I really couldn't install there due to the number of processes running there. Same thing with the telenet and ssh servers. The FTP idea might work, but windows already has the smb protocol enabled. So it does seem like the best way to go. However, I really rather not install other software on to this box due to again the number of processes it is running. Also after looking at the manual more which methods are best to search for the files. Is fnmatch better or glob. I'm not sure I understand what the difference is they both look like they do the same thing. Thanks again, David On Mon, 2003-08-04 at 01:11, Jeff Harris wrote: On Aug 3, 2003, David Smith claimed that: |Hi: |I have a slight problem that I'm not sure where to begin. I have |multiple files on another server other then my linux box that needs to |be renamed. These files are used under a particular software package and |I am trying to switch them to another software package which would |require them to be renamed. Now here is the catch. I really can't |install apache, php, or perl on the system (windows) or it will bog down |the software (which automates a radio station). What I need is to find |out if any of you have ever accessed a remote system (perhaps from the |command-line interface) and changed file names. I need to be able to |remove numbers a pluses. The numbers can be replaced with essentially |nothing. The pluses need to be replaced with spaces. Any ideas. I'm a |little new to PHP so I'm not sure if the best method would be to use the |command-line option or if I should find another solution altogether. |(I'm just more familar with php then perl and hate vb.) |David | This really has nothing to do with PHP. It sounds like you need to have, on your Windows system, either VNCServer or Timbuktu, an ftp server, or a telnet or ssh server. If you install an ftp server on your windows box, you might be able to use PHP on your webserver to open an ftp connection, read the directory list, then use one of the regex commands to create your new file name, then change the name on the server using ftp. David Smith Programmable Solutions [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Not sure of the best way to handle a problem
Hi: I have a slight problem that I'm not sure where to begin. I have multiple files on another server other then my linux box that needs to be renamed. These files are used under a particular software package and I am trying to switch them to another software package which would require them to be renamed. Now here is the catch. I really can't install apache, php, or perl on the system (windows) or it will bog down the software (which automates a radio station). What I need is to find out if any of you have ever accessed a remote system (perhaps from the command-line interface) and changed file names. I need to be able to remove numbers a pluses. The numbers can be replaced with essentially nothing. The pluses need to be replaced with spaces. Any ideas. I'm a little new to PHP so I'm not sure if the best method would be to use the command-line option or if I should find another solution altogether. (I'm just more familar with php then perl and hate vb.) David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] for the love of god, remove me
It's not usless if you read the page. [EMAIL PROTECTED] On Sun, 2003-08-03 at 13:45, Joseph Bannon wrote: PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This page is useless, you can't remove yourself. J. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP, MySQL and null?
Have you tried inserting it without including the id field in the insert statement? I have several tables with auto increments and I never even bother putting that field in the insert statement. David -Original Message- From: Jonas Thorell [mailto:[EMAIL PROTECTED] Sent: Sunday, July 27, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP, MySQL and null? Okay, how do I make PHP 4.3.2. and MySQL 4.0.13 to agree on what null means? I'm trying to get a form to add a new record into my database where one of the Fields might be null and for said field to actually be a null record once into The database as well... This is the script in question (a simple Let the user add links to the site thingy). It may not be the most elegant way of solving things...($name,$url and $comment are Variables found in $_POST if it's not obvious btw). ?php extract ($_POST, EXTR_PREFIX_SAME,ww); $fail=0; $fail2=0; if ($name==): echo I need a name for the new site!; return; endif; if ($url==): echo The site needs an URL!; return; endif; if ($comment==): $comment=null; endif; $link = mysql_connect(localhost) or die(Could not connect : . mysql_error()); mysql_select_db(intranet) or die(Could not select database); $query = SELECT id from site where name=\$name\; $result = mysql_query($query) or die(Query failed : . mysql_error()); while ($row = mysql_fetch_row($result)) { $fail=$row[0]; } if ($fail0): echo Sorry, that name already exist!; return; endif; mysql_free_result($result); $query = SELECT id from site where url=\$url\; $result = mysql_query($query) or die(Query failed : . mysql_error()); while ($row = mysql_fetch_row($result)) { $fail2=$row[0]; } if ($fail20): echo Sorry, that URL already exist!; return; endif; mysql_free_result($result); $name2=mysql_escape_string($name); $url2=mysql_escape_string($url); $comment2=mysql_escape_string($comment); $query = INSERT into site(id,name,url,comment) VALUES (null,'$name2','$url2','$comment2'); $result = mysql_query($query) or die(Query failed : . mysql_error()); mysql_close($link); echo Sitename=$name; echo brSite's URL=$url; if (is_null($comment)): echo brNo comment; else: echo brComment=$comment; endif; echo pAdded!; ? If I have null direcly in the query string (like this part...VALUES (null,'test'...) it works Like excepted (the id field is an auto_increment one so the id is automatically changed to The next available id-number). However, what fails is when I set a variable to be null and adds that to the query. The Record is inserted into the database alright but the comment-field (in this case) doesn't Get filled in with MySQL's the null-value. It gets filled with a zero-length string instead Which screws things up, since I no longer can use constructs like select id,name from site where comment is null; Not a problem on this specific table but on another table where I'm about to write the insert-script it is a Huge problem! Many thanks if someone has a good solution for this! --- ... and pray that there's intelligent life somewhere out in space, because there's bugger all down here on Earth! - Eric Idle - the Meaning of Life --- /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- 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, MySQL and null?
Actually that's my bad. That's what I get for doing a hundred other things while I'm reading my email. Sorry. I really don't know why null would be different under PHP and mysql; I'm not even sure it is. Right now I'm reloading my server due to a lighting hit (REALLY REALLY bad storms), so I really can't even play with it. However I was thinking (and this would be trying not knowing) that maybe you could change: if ($comment==): $comment=null; endif; to if ($comment==): $comment='null'; endif; Granted it is text whether then a null variable, but it would give you a possible fix. Of course it goes without saying that you would have to change your script below when it checks for a null value to check for the text 'null'. At least this way you it would be like you typed it in...of course this may not be the best way. Sorry about the misunderstanding...like I said my bad. David -Original Message- From: Jonas Thorell [mailto:[EMAIL PROTECTED] Sent: Sunday, July 27, 2003 10:10 AM To: 'David Smith'; [EMAIL PROTECTED] Subject: RE: [PHP] PHP, MySQL and null? Sorry, wrote wrong here so one more try. Well, no. But that's not where the problem is. If I was unclear - the id-field work as it should. It's when I try to use A variable in the query-string the problem pops up. IOW - INSERT INTO SITE (id,name,url,comment) VALUES (null,'testname','testurl',null) Works INSERT INTO SITE (id,name,url,comment) VALUES (null,'$name','$url','$comment') Does not when I've set $comment=null; If every field has a proper value (when everything had been filled in on the form), Everything works as expected. /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- 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] mysqldump
I agree with Curt, why reinvent the wheel. I mean even if you are like me and cannot access the command-line on your web server (which really really sucks) then there are still other tools that can do this very same thing. If you just want to click on a link and backup the db why not use the load data infile (of course this does not backup the database structure just the data) http://www.mysql.com/doc/en/LOAD_DATA.html. Or why not just get phpMyAdmin and upload it to your server. It already has these features plus many others, and of course the best part is it is open source http://sourceforge.net/projects/phpmyadmin/. So why take the time of reinventing the wheel? Of course this is just my dumb opinion...so you can always take it or leave it. David -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 10:33 AM To: '[EMAIL PROTECTED]' Subject: Re: [PHP] mysqldump * Thus wrote Marios Adamantopoulos ([EMAIL PROTECTED]): This is an attempt to create an backup script for my online databases. There are few things to sort out and the coding is not the most effiecient out there yet!!! I just wanted to check on what you guys think, am I going the right way, is there anything I should keep in mind? perhaps something like would be a whole lot easier: `mysqldump [options] db tables`; My general policy is don't revent the wheel unless it isn't round. Curt -- I used to think I was indecisive, but now I'm not so sure. -- 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] Re: PHP should know my data!
One possibility could be that your register_globals is off...maybe. David -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of J. Cox Sent: Thursday, July 24, 2003 8:26 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP should know my data! Chris Hubbard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hmm. You're right. Maybe something like the following would help: ?php if ($_SESSION[irony]) { $rs = enjoyJoke($_POST[msg]) }else{ $rs = fixProblem($_POST[msg]) } echo h3. $rs ./h3; ? This isn't working in Windows. Anyone know why? -- 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] Formatting Percents
Hello everyone, I am having a problem and can't seem to find an answer. Maybe someone here can help. I have a gift store that has prices of items. Well each item has a retail price that I have added to the DB. Let's say I want to sell the products at a discount of 15% but I don't want to change all the records. I want to use PHP to configure the 15% off price. How does one do this? Does the MySQL field need to be formatted a certain way? I want to show: Retail Price: $100.00 Your Price: $85.00 Thanks in advance and let me know if you need more information. David Smith Indy Web Design 877-347-1270 or 317-573-2486 http://www.indywebdesign.com -- Visit our online gift store at http://www.123giftshopping.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Putting Include files outside of document root
If you upload your index.htm file into the /dir folder and it shows then this is your document root folder. I would say if you place something in /myname then that would be outside your document root. -Original Message- From: Tom Malone [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 16, 2001 11:40 PM To: PHP Users Subject: [PHP] Putting Include files outside of document root I know this will sound like a dumb question to most, but I am new to *nix OS's - If my document root is something like /home/myname/dir/ (as per phpinfo()), and I put my include files in /home/myname/includes/, is that actually outside of the document root, or is anything under /home/myname/ actually the document root? Tom Malone Web Designer http://www.tom-malone.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Formatting Percents
What I have in code. If the retail price is $139.95 and I use the following: $aprice = $hotbuys[price] * .15; // Determine Discount $bprice = $hotbuys[price] - $aprice; // Subtract Discount $bprice = 118.9575 How can I format that to just 118.96? -Original Message- From: David Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 16, 2001 11:31 PM To: [EMAIL PROTECTED] Subject: [PHP] Formatting Percents Importance: High Hello everyone, I am having a problem and can't seem to find an answer. Maybe someone here can help. I have a gift store that has prices of items. Well each item has a retail price that I have added to the DB. Let's say I want to sell the products at a discount of 15% but I don't want to change all the records. I want to use PHP to configure the 15% off price. How does one do this? Does the MySQL field need to be formatted a certain way? I want to show: Retail Price: $100.00 Your Price: $85.00 Thanks in advance and let me know if you need more information. David Smith Indy Web Design 877-347-1270 or 317-573-2486 http://www.indywebdesign.com -- Visit our online gift store at http://www.123giftshopping.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Formatting Percents
DOH, wouldn't you know it. As soon as I sent these messages I found my answer... $sellprice = round ($bprice, 2); -Original Message- From: David Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 16, 2001 11:50 PM To: David Smith; [EMAIL PROTECTED] Subject: RE: [PHP] Formatting Percents What I have in code. If the retail price is $139.95 and I use the following: $aprice = $hotbuys[price] * .15; // Determine Discount $bprice = $hotbuys[price] - $aprice; // Subtract Discount $bprice = 118.9575 How can I format that to just 118.96? -Original Message- From: David Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 16, 2001 11:31 PM To: [EMAIL PROTECTED] Subject: [PHP] Formatting Percents Importance: High Hello everyone, I am having a problem and can't seem to find an answer. Maybe someone here can help. I have a gift store that has prices of items. Well each item has a retail price that I have added to the DB. Let's say I want to sell the products at a discount of 15% but I don't want to change all the records. I want to use PHP to configure the 15% off price. How does one do this? Does the MySQL field need to be formatted a certain way? I want to show: Retail Price: $100.00 Your Price: $85.00 Thanks in advance and let me know if you need more information. David Smith Indy Web Design 877-347-1270 or 317-573-2486 http://www.indywebdesign.com -- Visit our online gift store at http://www.123giftshopping.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Table Relationships
I have two table one categories, two with relationship to table one... Example: Table 1 catid category 1 General Gaming News 2 Combat Flight Simulator 3 B-17 Flying Fortress 4 IL-2 Sturmovik 5 Crimson Skies 6 European Air War Table Two id datecategorydesc 1 2001-04-04 14:41:33 1 Shrapnel Games I want to call the data from table two and if 1 matches 1 in first table it shows "General Gaming News" instead of just 1. understand? please reply to email since not a list member... David Smith Indy Web Design http://www.indywebdesign.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mail(), how can one specify from ?
$headers .= "From: David Smith [EMAIL PROTECTED]\n"; mail($recipient, $subject, $message, $headers); -Original Message- From: Richard [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 1:00 PM To: [EMAIL PROTECTED] Subject: [PHP] mail(), how can one specify from ? Greetings. If I would like to use mail(...), how could I make the "from" tag something else? I have not found any solution of specifying that! - Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] TraceRoute
This would be because his email shows [EMAIL PROTECTED] Hint the -nospam at the end. I don't know why people do this and then ask for help because when someone offers the help the email bounces... David Smith -Original Message- From: Henrik Hansen [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 18, 2001 5:18 PM To: Kath Cc: Mick; Henrik Hansen; [EMAIL PROTECTED] Subject: Re: [PHP] TraceRoute "Kath" [EMAIL PROTECTED] wrote: I tried emailing him 5 times with this, but I could never get through :| I even found the script for him and tried to send it to him :| - Kath heh i got an error too, lets just hope he read the group :) -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php or Mysql for DATE?
Try using ? $date = date ("Y-m-d H:i:s"); ? which formats the same as MySQL... -Original Message- From: Dhaval Desai [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 15, 2001 2:19 AM To: [EMAIL PROTECTED] Subject: [PHP] php or Mysql for DATE? I want to have a posting column wherein people can post their messages and when a new message is posted the Curent date has to be added in the mysql database. Do u think I should use Php to generate the date or should I have mysql to generate the date. I am also going to allow people to search for messages as per date. For example Search for messasges in the last week and stuff.. Please advice me.. THank You Dhaval Deasi __ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] email with multiple records
Thanks, I should have drop a code snippet in there... My problem was the .= -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 11:39 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] email with multiple records suppy a code snippit and I would have a huge advantage here, but I'll swing in the dark on this ok. your looping all this in a for/while/foreach loop right. your generating the body like this ? foreach($people as $pos = $val) { $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } right ? change it to this. foreach($people as $pos = $val) { $email_body = ''; $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } now good change im out to lunch here, but sithout a code snippit im grabing here. please post regarding, thank you. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""WreckRman2"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I wrote a small script like a email list only when I run it with 3 emails. The first record gets his info, 2nd get his plus first, 3rd get his plus 2nd and 1st. Why is it doing this? David Smith Number 3 record gets email with: - Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 --- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] email with multiple records [code included]
Ok here is my code... I have another question too. How can I include in the email a variable placed in the textarea of the form. Example: Hi your email is $email. and it would add the variable in each email and not show $email as plain text. Also open to any code suggestions as I am still new to php. ?php $connection = mysql_connect ("localhost", "root", "*"); if ($connection == false){ echo mysql_errno().": ".mysql_error()."BR"; exit; } mysql_select_db("indywebdesign",$connection); if ($submit) { $sql = "SELECT * FROM email"; $result = mysql_query($sql); while ($myrow = mysql_fetch_array($result)) { $email = $myrow["email"]; $recipient = "$email $email"; $subject = "$subject"; $message = "$message"; $headers = "From: David Smith [EMAIL PROTECTED]\n"; mail($recipient, $subject, $message, $headers); echo "Message Sent to $email!BR"; } } else { ? form method="post" action="?php echo $PHP_SELF?" INPUT TYPE="text" NAME="subject" TEXTAREA NAME="message" ROWS="5" COLS="30"/TEXTAREA input type="Submit" name="submit" value="Edit Information" /form ?php } ? -Original Message- From: David Smith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 1:49 PM To: Chris Lee; [EMAIL PROTECTED] Subject: RE: [PHP] email with multiple records Thanks, I should have drop a code snippet in there... My problem was the .= -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 11:39 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] email with multiple records suppy a code snippit and I would have a huge advantage here, but I'll swing in the dark on this ok. your looping all this in a for/while/foreach loop right. your generating the body like this ? foreach($people as $pos = $val) { $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } right ? change it to this. foreach($people as $pos = $val) { $email_body = ''; $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } now good change im out to lunch here, but sithout a code snippit im grabing here. please post regarding, thank you. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""WreckRman2"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I wrote a small script like a email list only when I run it with 3 emails. The first record gets his info, 2nd get his plus first, 3rd get his plus 2nd and 1st. Why is it doing this? David Smith Number 3 record gets email with: - Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 --- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] htaccess
Try this: ? echo ($HTTP_SERVER_VARS["PHP_AUTH_USER"]); ? -Original Message- From: Jason Jacobs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 4:09 PM To: [EMAIL PROTECTED] Subject: [PHP] htaccess Hey folks. I have another htaccess question. I have an entire folder set up to require authentication. It's in an htaccess file, not in each page. I was sure that the variable that's passed from the authentication dialog was $PHP_AUTH_USER, but it's not working when I use that in a query. Anyone got ideas? I'd paste my code, but when that wasn't working, I changed it back to hardcoded values. :) Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Connection error
Try this... You need to set a variable for the connection. Also you might be careful when sending examples of your code as you have given everyone on this list your username/password to your database. ?php $connection = mysql_connect ("localhost", "webmaster2", "**"); if ($connection == false){ echo mysql_errno().": ".mysql_error()."BR"; exit; } ? -Original Message- From: Shaohua Qu [mailto:[EMAIL PROTECTED]] Sent: Friday, March 02, 2001 4:00 PM To: [EMAIL PROTECTED] Subject: [PHP] Connection error Hi, When I run the code: ?php mysql_connect ("LOCALHOST","webmaster2","*"); ? I got error message: Fatal error: Call to unsupported or undefined function mysql_connect() in ... HELP! Thanks in advance, Sharon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] MySQL Create Table Problem
Quick example... CREATE TABLE user ( userid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, usergroupid smallint(5) unsigned DEFAULT '0' NOT NULL, username varchar(50) NOT NULL, password varchar(50) NOT NULL, email varchar(50) NOT NULL, parentemail varchar(50) NOT NULL, coppauser smallint(6) DEFAULT '0' NOT NULL, homepage varchar(100) NOT NULL, icq varchar(20) NOT NULL, aim varchar(20) NOT NULL, yahoo varchar(20) NOT NULL, biography mediumtext NOT NULL, signature mediumtext NOT NULL, adminemail smallint(6) DEFAULT '0' NOT NULL, showemail smallint(6) DEFAULT '0' NOT NULL, invisible smallint(6) DEFAULT '0' NOT NULL, usertitle varchar(250) NOT NULL, customtitle smallint(6) DEFAULT '0' NOT NULL, joindate int(10) unsigned DEFAULT '0' NOT NULL, canpost smallint(6) DEFAULT '0' NOT NULL, cookieuser smallint(6) DEFAULT '0' NOT NULL, daysprune smallint(6) DEFAULT '0' NOT NULL, lastvisit int(10) unsigned DEFAULT '0' NOT NULL, lastactivity int(10) unsigned DEFAULT '0' NOT NULL, lastpost int(10) unsigned DEFAULT '0' NOT NULL, posts smallint(5) unsigned DEFAULT '0' NOT NULL, timezoneoffset smallint(6) DEFAULT '0' NOT NULL, emailnotification smallint(6) DEFAULT '0' NOT NULL, imgurl varchar(150) NOT NULL, PRIMARY KEY (userid), KEY idxgroups (username, usergroupid) ); -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: Friday, March 02, 2001 2:09 PM To: PHP Subject: [PHP] MySQL Create Table Problem This is driving me nuts. I really tried to figure it out myself. I have a form for creating a table. The form fields have field_name field_type field_length, and checkboxes for not_null, auto_increment and primary. When I check the primary key checkbox it always makes the first field the primary key no matter what. And it makes two date fields I enter NULL and the rest NOT NULL no matter what I put in the checkboxes. The code is below along with a printout of the SQL query. I only wanted suffix and death date to be null. This is combination from PHP Fast and Easy and MySQL by Dubois. $sql = "CREATE TABLE $table_name ("; for ($i = 0; $i count($field_name); $i++) { $sql .= "$field_name[$i] $field_type[$i]"; if ($not_null[$i] == "Y") { $additional = " NOT NULL"; } else { $additional = " NULL"; } if ($auto_increment[$i] == "Y") { $additional .= " AUTO_INCREMENT"; } else { $additional .= ""; } if ($primary[$i] == "Y") { $additional .= " primary key"; } else { $additional .= ""; } if ($field_length[$i] != "") { $sql .= "($field_length[$i]) $additional,"; } else { $sql .= " $additional,"; } } $sql = substr($sql, 0, -1); $sql .= ")"; CREATE TABLE president (last_name varchar(15) NOT NULL primary key,first_name varchar(15) NOT NULL,suffix varchar(5) NOT NULL,city varchar(20) NOT NULL,state varchar(2) NOT NULL,birth date NULL,death date NULL) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] URL Encode
I know this have been covered before but I can't find it in my thousands of emails... How would I URL Encode the following... I am retrieving a variable like ? echo "$SearchCity"; ? but for example if it is Hilton Head Island I need it to add the + signs as Hilton+Head+Island so Netscape won't crash. Thanks...
[PHP] upload_max_filesize
Can anyone explain in detail how I can increase the upload_max_filesize to 5 meg instead of the default 2 meg? Thanks, David
Re: [PHP] upload_max_filesize
Sorry, that isn't very detailed but I appreciate your help. Where can I find php.ini? - Original Message - From: Jonatan Bagge [EMAIL PROTECTED] To: David Smith [EMAIL PROTECTED] Sent: Thursday, February 01, 2001 6:41 AM Subject: Re: [PHP] upload_max_filesize David Smith wrote: Can anyone explain in detail how I can increase the upload_max_filesize to 5 meg instead of the default 2 meg? Thanks, David php.ini -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Check for spaces..
With the following code how can I check to see if the file being uploaded has a space in it? Maybe replace them with a _ or reject them all together... if ($FileType== "none") { print "ERROR! - You must specify a File Type before we can begin the upload.BR"; } else { if ($filezip== "none") { print "ERROR! - You must specify a zip file to upload.BR"; } else { copy($filezip, "/home/sites/site1/ftp/$FileType/$filezip_name"); unlink($filezip); } WreckRman2 Combat Flight Center http://www.combatfs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]