php-general Digest 24 Apr 2001 10:12:47 -0000 Issue 646 Topics (messages 49945 through 50040): Question on installation 49945 by: Jason Lam 49986 by: Nashirak Bosk Using <input type = 'button> rather than <input type = 'submit'> 49946 by: Martin Cameron 49956 by: Rene Maldonado 49967 by: Plutarck 49969 by: Jason Murray 50012 by: Martin Cameron 50013 by: David Robley PHP script and new window. 49947 by: Angerer, Chad 49963 by: Plutarck Re: Site Structure 49948 by: Meir kriheli 49954 by: Steve Werby Re: PHP 4.0.5 49949 by: Henrik Hansen 49950 by: Henrik Hansen 49964 by: Plutarck Re: How to turn off warnings ??? 49951 by: Brandon Orther 49968 by: Plutarck Posting to a form 49952 by: Wade 49957 by: Philip Olson 49958 by: Jack Dempsey Calculating the difference between two dates 49953 by: Stuart Rees 49961 by: Plutarck Re: ereg_replace: Replacing only first occurrence 49955 by: ~~~i LeoNid ~~ Re: How to find the object...(clarification) 49959 by: Plutarck Re: How to find the object name in a class? 49960 by: Plutarck Re: newbie question: duplicate emails 49962 by: Plutarck trouble reading a database (fwd) 49965 by: johndmiller 49966 by: Jason Murray 49982 by: johndmiller ereg_replace: Help! 49970 by: Erica Douglass 49971 by: Plutarck Re: Having trouble executing unzip from PHP script 49972 by: David Robley Re: logging in (online?!) 49973 by: Plutarck preg_replace on array with "E (PCRE_DOLLAR_ENDONLY)" modifier 49974 by: Grant Walters 49976 by: Plutarck 49985 by: CC Zona Re: web page grab 49975 by: Plutarck newbie migration issues 49977 by: S.J. Black 49980 by: Jack Dempsey 49981 by: Plutarck Re: Method Not Allowed 49978 by: Steve Maroney Re: Printing 49979 by: Plutarck gif and jpeg support 49983 by: Dan Phoenix PHP and useradd 49984 by: Nashirak Bosk 49987 by: Plutarck 50010 by: Steve Werby date plus 7 more days 49988 by: Jacky 49991 by: David Robley Now, why doesn't this work? 49989 by: Tyler Longren 49992 by: Jason Murray 49995 by: David Robley function in if statement not executed ?-->> Help 49990 by: PHPhyperboy 49994 by: Jason Murray 49996 by: PHPhyperboy Re: Now, why doesn't this work (update)? 49993 by: Tyler Longren date add more 7 days, help needed. 49997 by: Jacky 50000 by: Maxim Maletsky Re: Now, why doesn't this work? (this thread can die off now) 49998 by: Tyler Longren is_link() behavior 49999 by: J. Jones 50005 by: Martin Skjöldebrand 50007 by: J. Jones Sensitive Information (like CC) 50001 by: Ashley M. Kirchner 50006 by: Jason Murray 50008 by: Aaron D. Turner 50026 by: Niklas Neumann 50028 by: Jason Murray file_exists with remote file??? 50002 by: Paulo - Bruc Internet 50004 by: J. Jones BASIC function question 50003 by: Martin Skjöldebrand 50009 by: David Robley 50015 by: Philip Olson Re: Why is it dangerous to have register_globals on? 50011 by: Rasmus Lerdorf 50025 by: Francois Legare 50027 by: Geir Eivind Mork Re: Looping through variables 50014 by: Dan Lowe Re: how do I do this 50016 by: Adrian D'Costa 50018 by: Philip Olson 50022 by: Adrian D'Costa Want to send email in html format 50017 by: George Alexander 50019 by: Peter Houchin 50030 by: Martin Oust 50031 by: Martin Oust 50032 by: Martin Oust sending files by mail 50020 by: Calin Rotaru 50021 by: David Robley 50039 by: Calin Rotaru Convert a numeric string 50023 by: liman 50024 by: Jason Murray Yes, thanx 50029 by: liman Standalone Browser with PHP and/CGI 50033 by: John Monfort 50035 by: elias what is better? mysql_connect() or mysql_pconnect()? 50034 by: elias 50037 by: VirtualSolution [Virtualsolution.net] delete browser-cache 50036 by: mohammed oda Re: IP Chains 50038 by: Michael Hall Re: Fatal Errors and Error Handling 50040 by: Svein Roar Nilsen Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
I have installed the RPM version of PHP that came with a Linux dist. Obviously, it didn't came with a lot of the goodies, like ODBC. Now, if I have to install those modules, is there anyway I can "JUST" compile those modules and install it with /etc/php.ini ? Is this a recommended way? Or should I just re-compile everything? That will really defeat the purpose of a packaging system.... Jason Lam
Well if you are using Linux you could try looking for a .o file or I think they have RPMs for some of these that just have a .o file in them and then configure php for you. Basically what you are looking for is a php_$whatever_module. Like I downloaded php_imap_mod.rpm and php_mysql_mod.rpm I am sure they have an ODBC. If not then you will have to do it the hard way and find a ODBC.o or something that has been compiled with php before, put it in the correct directory (I cant remember which) and then edit /etc/php.ini to load in the module when php is run. If you still cant find any of this for a module you want.... sorry you will have to recompile. :) Oh by the way all the stuff I described above is a sinch with Debian Linux :) (not that I am partial). Good Luck, Jason Lam wrote: > I have installed the RPM version of PHP that came with a Linux dist. Obviously, it >didn't came with a lot of the goodies, like ODBC. Now, if I have to install those >modules, is there anyway I can "JUST" compile those modules and install it with >/etc/php.ini ? > > Is this a recommended way? Or should I just re-compile everything? That will really >defeat the purpose of a packaging system.... > > Jason Lam -- ------------------------------- Clayton Bluhm Computer Engineering Student [EMAIL PROTECTED] (School) [EMAIL PROTECTED] (home)
Here is a simple form file that needs to pass a variable - $hello - from the form to a new function. Unfortunately, it doesn't. When you click the submit button, the URL looks like this: http://localhost/test5.php?action=1&hello= It should have the variable there after the "hello=" I suspect it's something to do with parent.location. Looking for a solution. Here's the script: <head> </head> <body bgcolor=white> <? define(INITIAL_PAGE,0); define(SELECT,1); function initial_page(){ global $PHP_SELF,$hello; print "<form action = '$PHP_SELF?action=1' method = 'post' name = 'hello'>"; print "<input type='text' name='hello'>"; print "<input name = 'hello' type='button' value='Submit' onClick=\"parent.location='$PHP_SELF?action=1&hello=$hello'\">"; print "</form>"; } function select(){ global $hello; print "Hellooooooooooo, $hello!"; } initial_page(); switch($action){ case INITIAL_PAGE: initial_page; break; case SELECT: select(); break; default: die ("Hello, can't find that function."); } ?> </body> </html> The thing is that if you simply hit "enter" - rather than click the "submit" button, the first directive in the <form> tag is invoked, and the value of the $hello variable IS passed. regards Martin Cameron
Hi I think it woulf be better this way:print "<form action = '$PHP_SELF?action=1' method = 'post' name = 'hello'>";
print "<input type='text' name='var_hello'>";
print "<input type = submit value = 'Submit' >";
and, the var name is $var_hello
this way, the value of your var do not appear in the URL,
This work for me...
Martin Cameron wrote:
Here is a simple form file that needs to pass a variable - $hello - from
the form to a new function. Unfortunately, it doesn't. When you click
the submit button, the URL looks like this:http://localhost/test5.php?action=1&hello=
It should have the variable there after the "hello="
I suspect it's something to do with parent.location. Looking for a
solution. Here's the script:<head>
</head>
<body bgcolor=white>
<?
define(INITIAL_PAGE,0);
define(SELECT,1);
function initial_page(){
global $PHP_SELF,$hello;
print "<form action = '$PHP_SELF?action=1' method = 'post'
name = 'hello'>";
print "<input type='text' name='hello'>";
print "<input name = 'hello' type='button' value='Submit'
>";print "</form>";
}function select(){
global $hello;
print "Hellooooooooooo, $hello!";
}initial_page();
switch($action){
case INITIAL_PAGE:
initial_page;
break;
case SELECT:
select();
break;
default:
die ("Hello, can't find that function.");
}
?>
</body>
</html>The thing is that if you simply hit "enter" - rather than click the
"submit" button, the first directive in the <form> tag is invoked, and
the value of the $hello variable IS passed.regards
Martin Cameron
In addition, it's worth of note that whenever something has a name attribute it that will show up as a variable in your script. More or less. One question though. Why does your <form> have a name attribute at all? And naming it the same as a variable, for whatever reason, isn't a good idea if for no other reason than it's confusing. It got a weird look from me...not that that makes it very unusual... -- Plutarck Should be working on something... ...but forgot what it was. "Rene Maldonado" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi I think it woulf be better this way: > > print "<form action = '$PHP_SELF?action=1' method = 'post' name > = 'hello'>"; > print "<input type='text' name='var_hello'>"; > print "<input type = submit value = 'Submit' >"; > > > and, the var name is $var_hello > > this way, the value of your var do not appear in the URL, > > This work for me... > > > > Martin Cameron wrote: > > > Here is a simple form file that needs to pass a variable - $hello - from > > the form to a new function. Unfortunately, it doesn't. When you click > > the submit button, the URL looks like this: > > > > http://localhost/test5.php?action=1&hello= > > > > It should have the variable there after the "hello=" > > > > I suspect it's something to do with parent.location. Looking for a > > solution. Here's the script: > > > > <head> > > </head> > > <body bgcolor=white> > > <? > > define(INITIAL_PAGE,0); > > define(SELECT,1); > > function initial_page(){ > > global $PHP_SELF,$hello; > > print "<form action = '$PHP_SELF?action=1' method = 'post' > > name = 'hello'>"; > > print "<input type='text' name='hello'>"; > > print "<input name = 'hello' type='button' value='Submit' > > onClick=\"parent.location='$PHP_SELF?action=1&hello=$hello'\">"; > > > > print "</form>"; > > } > > > > function select(){ > > global $hello; > > print "Hellooooooooooo, $hello!"; > > } > > > > initial_page(); > > > > switch($action){ > > case INITIAL_PAGE: > > initial_page; > > break; > > case SELECT: > > select(); > > break; > > default: > > die ("Hello, can't find that function."); > > } > > ?> > > </body> > > </html> > > > > The thing is that if you simply hit "enter" - rather than click the > > "submit" button, the first directive in the <form> tag is invoked, and > > the value of the $hello variable IS passed. > > > > regards > > Martin Cameron > ---------------------------------------------------------------------------- ---- > -- > 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]
> One question though. Why does your <form> have a name > attribute at all? Probably so it can be addressed through JavaScript. Jason
Hi Rene I think that I first used a submit button about html ver 2.0. I want to use a button type - not submit. regards Martin Rene Maldonado wrote: > Hi I think it woulf be better this way: > > print "<form action = '$PHP_SELF?action=1' method = 'post' > name = 'hello'>"; > print "<input type='text' name='var_hello'>"; > print "<input type = submit value = 'Submit' >"; > > > and, the var name is $var_hello > > this way, the value of your var do not appear in the URL, > > This work for me... > > > > Martin Cameron wrote: > >> Here is a simple form file that needs to pass a variable - $hello - >> from >> the form to a new function. Unfortunately, it doesn't. When you >> click >> the submit button, the URL looks like this: >> >> http://localhost/test5.php?action=1&hello= >> >> It should have the variable there after the "hello=" >> >> I suspect it's something to do with parent.location. Looking for a >> solution. Here's the script: >> >> <head> >> </head> >> <body bgcolor=white> >> <? >> define(INITIAL_PAGE,0); >> define(SELECT,1); >> function initial_page(){ >> global $PHP_SELF,$hello; >> print "<form action = '$PHP_SELF?action=1' method = 'post' >> name = 'hello'>"; >> print "<input type='text' name='hello'>"; >> print "<input name = 'hello' type='button' value='Submit' >> >> onClick=\"parent.location='$PHP_SELF?action=1&hello=$hello'\">"; >> >> print "</form>"; >> } >> >> function select(){ >> global $hello; >> print "Hellooooooooooo, $hello!"; >> } >> >> initial_page(); >> >> switch($action){ >> case INITIAL_PAGE: >> initial_page; >> break; >> case SELECT: >> select(); >> break; >> default: >> die ("Hello, can't find that function."); >> } >> ?> >> </body> >> </html> >> >> The thing is that if you simply hit "enter" - rather than click the >> "submit" button, the first directive in the <form> tag is invoked, >> and >> the value of the $hello variable IS passed. >> >> regards >> Martin Cameron >
On Tue, 24 Apr 2001 14:12, Martin Cameron wrote: > Hi Rene > > I think that I first used a submit button about html ver 2.0. I want to > use a button type - not submit. > > regards > Martin > > Rene Maldonado wrote: > > Hi I think it woulf be better this way: > > > > print "<form action = '$PHP_SELF?action=1' method = 'post' > > name = 'hello'>"; > > print "<input type='text' name='var_hello'>"; > > print "<input type = submit value = 'Submit' >"; > > > > > > and, the var name is $var_hello > > > > this way, the value of your var do not appear in the URL, > > > > This work for me... > > > > Martin Cameron wrote: > >> Here is a simple form file that needs to pass a variable - $hello - > >> from > >> the form to a new function. Unfortunately, it doesn't. When you > >> click > >> the submit button, the URL looks like this: > >> > >> http://localhost/test5.php?action=1&hello= > >> > >> It should have the variable there after the "hello=" > >> > >> I suspect it's something to do with parent.location. Looking for a > >> solution. Here's the script: > >> > >> <head> > >> </head> > >> <body bgcolor=white> > >> <? > >> define(INITIAL_PAGE,0); > >> define(SELECT,1); > >> function initial_page(){ > >> global $PHP_SELF,$hello; > >> print "<form action = '$PHP_SELF?action=1' method = 'post' > >> name = 'hello'>"; > >> print "<input type='text' name='hello'>"; > >> print "<input name = 'hello' type='button' value='Submit' > >> > >> onClick=\"parent.location='$PHP_SELF?action=1&hello=$hello'\">"; > >> > >> print "</form>"; > >> } > >> > >> function select(){ > >> global $hello; > >> print "Hellooooooooooo, $hello!"; > >> } > >> > >> initial_page(); > >> > >> switch($action){ > >> case INITIAL_PAGE: > >> initial_page; > >> break; > >> case SELECT: > >> select(); > >> break; > >> default: > >> die ("Hello, can't find that function."); > >> } > >> ?> > >> </body> > >> </html> > >> > >> The thing is that if you simply hit "enter" - rather than click the > >> "submit" button, the first directive in the <form> tag is invoked, > >> and > >> the value of the $hello variable IS passed. > >> > >> regards > >> Martin Cameron Why are you using the same name for the button and the text field? Surely this is going ot cause you a problem. also, you seem to be mixing GET and POST when calling the FORM action script; you might be better to pass the value action as a hidden field. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA Ensign Pillsbury: He's bread Jim!
I have searched high and low for thos but with no luck. Hopefully someone will give me some good pointers. I have a poll on a page that I am building which uses php. I would like to have a new window open when the submit and view results links are selected. I am using an onClick and the view results window works fine. It is the submit button I am having trouble with. The new window won't populate with any info. Here is the form that I have on my page <form method="post" action="vote.php"> <div class="pollTitle"><? echo $question; ?></div> <div class="pollResponse"> <input type="Radio" name="response" value="1"><? echo $response1; ?><br> <input type="Radio" name="response" value="2"><? echo $response2; ?><br> <input type="Radio" name="response" value="3"><? echo $response3; ?><br></div> <input type="hidden" name="id" value="<? echo $id; ?>"> <font size=-2><a href="#" onClick="window.open('archive.php?id=<? echo $id; ?>','archive','toolbar=no,status=no.location=no,menubar=no,top=50,left=50,he ight=250,width=200,scrollbars=no'); return false;">view results</a></font><br><br> <input type="submit" name="submit" value="Vote" onClick="window.open('http://www.askedagain.com/vote.php','vote','toolbar=no ,status=no.location=no,menubar=no,top=50,left=50,height=250,width=200,scroll bars=no'); return false;"> </form> The vote script works fine as if I just have it load in the current browser window. Is there something that I am missing? Any help and/or ideas are much appreciated. Thanks again. CAA
First of all, I believe since you are using javascript on your button you shouldn't use type="submit". Change it to type="button", which means it will have no effect for browsers that don't have javascript enabled when clicked. That could be an error, for one. But then again, it might not. It might cause it to be submitted to one page and opened on another, which very well may be what you want to happen. However it might be that the window is being opened first then the data is submitted second, thus the error that's being caused. To fix it just add the window.open function in the <head> area of your document, so that as soon as the page is viewed the window pops up. Annoying if the user hits refresh, but what you could do is use a Meta-Refresh to take them from the page that pops up the window to the page that user should be normally seing. Next, how is it that you are getting the data and what data are you getting? For instance, are you using the id you are submitting to the other page to see how that user voted? Or are you just tracking who's viewing that page? Further, does what you are displaying depend on what id is being submitted? Lastly, view source on your HTML page and ensure all the fields are getting filled out like you expect them to. It happens all the time that by using View Source I find what my problem was. -- Plutarck Should be working on something... ...but forgot what it was. ""Angerer, Chad"" <[EMAIL PROTECTED]> wrote in message 9E35C54B0C7AD411B5C1009027DE539940B5EF@MSPMX01">news:9E35C54B0C7AD411B5C1009027DE539940B5EF@MSPMX01... > I have searched high and low for thos but with no luck. Hopefully someone > will give me some good pointers. > > I have a poll on a page that I am building which uses php. I would like to > have a new window open when the submit and view results links are selected. > I am using an onClick and the view results window works fine. It is the > submit button I am having trouble with. The new window won't populate with > any info. > > Here is the form that I have on my page > > <form method="post" action="vote.php"> > <div class="pollTitle"><? echo $question; ?></div> > <div class="pollResponse"> > <input type="Radio" name="response" value="1"><? echo $response1; > ?><br> > <input type="Radio" name="response" value="2"><? echo $response2; > ?><br> > <input type="Radio" name="response" value="3"><? echo $response3; > ?><br></div> > <input type="hidden" name="id" value="<? echo $id; ?>"> > <font size=-2><a href="#" onClick="window.open('archive.php?id=<? > echo $id; > ?>','archive','toolbar=no,status=no.location=no,menubar=no,top=50,left=50,he > ight=250,width=200,scrollbars=no'); return false;">view > results</a></font><br><br> > <input type="submit" name="submit" value="Vote" > onClick="window.open('http://www.askedagain.com/vote.php','vote','toolbar=no > ,status=no.location=no,menubar=no,top=50,left=50,height=250,width=200,scroll > bars=no'); return false;"> > </form> > > The vote script works fine as if I just have it load in the current browser > window. Is there something that I am missing? Any help and/or ideas are > much appreciated. > > Thanks again. > > CAA > > > -- > 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] >
On Monday 23 April 2001 22:47, Jaxon wrote: > Hmm... > > Is there any way to set something like include_path on the fly, so you just > define all your possible direcories at once in what is essential a 'site > environment' variable, and then you can include/require your files without > putting any path info in? > > regards, > jaxon Sure you can, set the include_path in your php.ini file. -- Meir Kriheli There's someone in my head, but it's not me - Pink Floyd > > > -----Original Message----- > > From: Toby Miller [mailto:[EMAIL PROTECTED]] > > Sent: Monday, April 23, 2001 3:44 PM > > To: indrek siitan > > Cc: PHP General Mailing List > > Subject: Re: [PHP] Site Structure > > > > > > While it is true that you don't have to put your files in the web > > directory > > at all and it is a more secure option there is still one very large > > inconvenience that prevents me from going with that option. You lose the > > usefulness of just including > > "$DOCUMENT_ROOT/yourfolder/yourfilename". This > > is the main reason that I do put my files in the root web > > directory. So how > > do you tell all of your files where your included content is? Do you hard > > code the path in every page? If so, do you also have development, > > stage, and > > live environments that mimic the exact same directory structures? > > If not, do > > you always change the include strings by hand every time you move from > > one environment to another? Do you run into these problems? What kind of > > solutions/workarounds have you implemented? > > > > I have always used this style of including documents because it enables > > me to do my mockup ideas on my Windows machine with PWS. Then I can move > > onto my Linux test box and try the site in my home account. Then I can > > push the exact same code to the dev server which uses www as the root web > > directory. > > Then I can push the exact same code to the staging server for > > clients to see > > which has wwwroot as the root web directory and the live > > environment mimics > > the stage environment so that move makes little to no difference. Now if > > someone else was working on the same project and checked the files out of > > CVS they would have to tweak their copy to work in their special > > environment > > instead of just running and developing the files. This just seems like a > > whole lot of extra work to me. Correct me if I'm wrong, but the only way > > anyone can see the source code of a php file if the extension is > > associated > > with the PHP interpreter is if you provide a phps file that they > > can see or > > if someone uninstalls the PHP interpreter (which bypasses the situation > > because the first condition is no longer being met). > > > > I'm really curious to see how other developers handle these kind of > > development situations. > > > > ----- Original Message ----- > > From: "indrek siitan" <[EMAIL PROTECTED]> > > To: "Toby Miller" <[EMAIL PROTECTED]>; "Jordan Elver" > > <[EMAIL PROTECTED]> > > Cc: "PHP General Mailing List" <[EMAIL PROTECTED]> > > Sent: Monday, April 23, 2001 1:22 PM > > Subject: RE: [PHP] Site Structure > > > > > Hi, > > > > > > > Also, it's not a good idea to use the .inc extension unless you've > > > > associated it with PHP. The reason is if I type the URL directly to > > > > /includes/header.inc I will get the source code for that file in text > > > > format. > > > > > > you don't have to keep your .inc files in the web server document > > > root folder at all... > > > > > > > > > Rgds, > > > Tfr > > > > > > --==< [EMAIL PROTECTED] >==< MySQL development team >==< Tallinn / Estonia > > >==--
"Toby Miller" <[EMAIL PROTECTED]> wrote: > While it is true that you don't have to put your files in the web directory > at all and it is a more secure option there is still one very large > inconvenience that prevents me from going with that option. You lose the > usefulness of just including "$DOCUMENT_ROOT/yourfolder/yourfilename". This > is the main reason that I do put my files in the root web directory. So how > do you tell all of your files where your included content is? Do you hard > code the path in every page? If so, do you also have development, stage, and > live environments that mimic the exact same directory structures? If not, do > you always change the include strings by hand every time you move from one > environment to another? Do you run into these problems? What kind of > solutions/workarounds have you implemented? Here's a solution I've used with a lot of success. I concocted it myself a year or so ago after trying a number of other alternatives. // Set INC_PATH. ereg( '(.*)htdocs.*', $SCRIPT_FILENAME, $regs ); define( 'INC_PATH', $regs[1] . 'inc/' ); // Include files. include( INC_PATH . "inc_common.php" ); ... include( INC_PATH . "inc_db.php" ); Nearly all of the sites I design are controlled from a single PHP file using some Apache AliasMatch magic so I usually only have to set the INC_PATH constant in one file and include the main include files in the same place. So the include directory (inc) is parallel to my web docs directory. The parent of both is a directory called 'production', which has directories parallel to it called 'development' and 'staging' which allows me to run 3 versions of the site, each on 3 separate ports and copy code from one version to the other and run them with no modifications. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
Felix Kronlage <[EMAIL PROTECTED]> wrote: > On Mon, Apr 23, 2001 at 03:00:07PM -0700, Dominique Paquin wrote: > > > I asked when the new version of PHP was comming out at the beginning of the > > month and some one told me that it was comming out the week after. Haven't > > seen it yet, anyone knows the release date?? > > RC7 got out a few days ago (Thursday I believe), and I think I recall that unless > lot's of things went wrong this is the last RC.... RC8 too :) -- Henrik Hansen
Martín Marqués <[EMAIL PROTECTED]> wrote: > On Lun 23 Abr 2001 22:13, Felix Kronlage wrote: > > On Mon, Apr 23, 2001 at 03:00:07PM -0700, Dominique Paquin wrote: > > > I asked when the new version of PHP was comming out at the beginning of > > > the month and some one told me that it was comming out the week after. > > > Haven't seen it yet, anyone knows the release date?? > > > > RC7 got out a few days ago (Thursday I believe), and I think I recall that > > unless lot's of things went wrong this is the last RC.... > > > > -fkr > > > > ps. I guess, it's released once it works fine :) > > Why don't the publicate the RC's. I had a hard time getting RC5. they are freely avaialiable on the net for download. or you always have cvs :) -- Henrik Hansen
Or it could be RC8 that will be the last one :) Then again, that's why it's called an RC (Release Candidate...or something similar). Nice to know that when you get a new version it's been hammered to death to squish all the latent bugs. Unlike some people...*cough* -- Plutarck Should be working on something... ...but forgot what it was. "Henrik Hansen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Felix Kronlage <[EMAIL PROTECTED]> wrote: > > > On Mon, Apr 23, 2001 at 03:00:07PM -0700, Dominique Paquin wrote: > > > > > I asked when the new version of PHP was comming out at the beginning of the > > > month and some one told me that it was comming out the week after. Haven't > > > seen it yet, anyone knows the release date?? > > > > RC7 got out a few days ago (Thursday I believe), and I think I recall that unless > > lot's of things went wrong this is the last RC.... > > RC8 too :) > > -- > 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] >
You can put a @ in front of you function. Example <? @function("Test"); ?> -----Original Message----- From: Greg Donald [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 3:05 PM To: [EMAIL PROTECTED]; Php-General Subject: RE: [PHP] How to turn off warnings ??? > I am a newbie to PHP and I am trying to get a number of scripts to work. > > Whenever I try to execute some code I receive 'warnings', that basically > clutter up the screen. Since I am assuming that these are not fatal - is > there any way to turn them off? > > Any help would be appreciated. The manual details the settings for the php.ini here: http://www.php.net/manual/en/configuration.php You may want to alter your error reporting level there, or at the top of each script as needed. ------------------------------------------------------------------------ destiney - (des-ti-ny) - n. 1. deity of all things "html", 2. common internet addict, 3. lover of late 80's heavy metal music, 4. Activist for the terminally un-elite; see also - cool guy, des, mr. php... It's 4:00am, your web site is still up, why are you? http://phplinks.org/ http://destiney.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]
And just thought I'd add in that you should _almost_ never allow a warning to be sent in your script as it's just begging for something to go wrong without you knowing why. And for your reading enjoyment (if you call reading about errors enjoyable...which I of course, do): http://www.php.net/manual/en/features.error-handling.php -- Plutarck Should be working on something... ...but forgot what it was. "Brandon Orther" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You can put a @ in front of you function. Example > > <? > @function("Test"); > ?> > -----Original Message----- > From: Greg Donald [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 23, 2001 3:05 PM > To: [EMAIL PROTECTED]; Php-General > Subject: RE: [PHP] How to turn off warnings ??? > > > > > I am a newbie to PHP and I am trying to get a number of scripts to work. > > > > Whenever I try to execute some code I receive 'warnings', that basically > > clutter up the screen. Since I am assuming that these are not fatal - is > > there any way to turn them off? > > > > Any help would be appreciated. > > The manual details the settings for the php.ini here: > http://www.php.net/manual/en/configuration.php > > You may want to alter your error reporting level there, or at the top of > each script as needed. > > ------------------------------------------------------------------------ > destiney - (des-ti-ny) - n. 1. deity of all things "html", 2. common > internet addict, 3. lover of late 80's heavy metal music, 4. Activist > for the terminally un-elite; see also - cool guy, des, mr. php... > > It's 4:00am, your web site is still up, why are you? > http://phplinks.org/ http://destiney.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] >
I'm trying to do the following <input type="text" tabindex=17 name="Aname" value= <? echo strtoupper($Aname); ?> But when Aname is multiple words, such as "Wade Williams", everything from the whitespace on gets cut off. Any ideas how to fix this? Thanks Wade
value="foo bar" as opposed to value=foo bar regards, philip On Mon, 23 Apr 2001, Wade wrote: > I'm trying to do the following > > <input type="text" tabindex=17 name="Aname" value= > > <? > echo strtoupper($Aname); > ?> > > But when Aname is multiple words, such as "Wade Williams", everything from > the whitespace on gets cut off. > > Any ideas how to fix this? > > Thanks > Wade > > > > -- > 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] >
it looks like you left off the quotes around the value that you're echoing...try putting it in like this <input type="text" tabindex="17" name="Aname" value="<? echo strtoupper($Aname); ?>"> -jack Wade wrote: > > I'm trying to do the following > > <input type="text" tabindex=17 name="Aname" value= > > <? > echo strtoupper($Aname); > ?> > > But when Aname is multiple words, such as "Wade Williams", everything from > the whitespace on gets cut off. > > Any ideas how to fix this? > > Thanks > Wade > > -- > 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]
Please can someone tell me there is a nice function that can calculate the difference between two dates. If there isn't such a function I'm sure someone could tell me how I can do a different way.
Try mkdate. You'll have to make sure it's in a format it knows, but it works. -- Plutarck Should be working on something... ...but forgot what it was. ""Stuart Rees"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Please can someone tell me there is a nice function that can calculate the > difference between two dates. If there isn't such a function I'm sure > someone could tell me how I can do a different way. > > > -- > 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] >
On 23 Apr 2001 13:04:36 -0700 impersonator of [EMAIL PROTECTED] ("Erica Douglass") planted &I saw in php.general: >I want to only replace the first occurrence of a string in a file using >ereg_replace. Should I use a loop to do this? Any suggestions? Please email >me at [EMAIL PROTECTED] with suggestions. > >Thanks, >Erica > I think, begining from some php >4, preg_replace allows to do this, Otherwise, you could use preg_match to find first match then strpos() to find it position, and, finaly substr() with concatenation to your replacement. This loong way was the first, that came to my mind for cases, where regexp realy needed. (If they are not needed, str_replace() would work faster/simlier, you know o'cos:). Note: for some strings I experience hangup, especially w/ereg_replace, but also, for long ones, w/preg0. Regards. Leonid.
Before anyone get's confused I thought I should note that $this won't work because I need the name of the object for use _outside_ of the class itself too. For instance I have a group of about 30 functions in a seperate file which directly modify $front_page. $front_page will now be inside of an object, and I _could_ just change them to $pge->front_page, but here's the problem. I'm doing all this so I can have variable function output. So for now I use the object name $pge to output data, but in the future I may need to use $xml or $pge_error. But I don't want to go through all the functions and change the names, so I use a variable variable. But I don't know how to get the variable variable name! So what I want is to see what name $this is holding, then declare what comes after $ as the value of a global variable which I will use in a variable variable. I know, I know, it's really complicated. But it really is the most non-constraining way of going about it, as I'm probably going to use this class many times in the future. So I'm still stumped. Am I going to have to just use a hack-around till a version of PHP includes such an odd class function, of which I know of know other such existing function in any language? :( -- Plutarck Should be working on something... ...but forgot what it was. ""Plutarck"" <[EMAIL PROTECTED]> wrote in message 9c21ks$cp$[EMAIL PROTECTED]">news:9c21ks$cp$[EMAIL PROTECTED]... > I've been using a function to output HTML to the user's browser, and now my > use has made it neccessary to put it all inside a class. > > All's going find and dandy and I've got it all working. However one of it's > variables is $front_page. > > Now in other pages there are references to $front_page, and I want to change > them to something like $objectname->front_pagee. > > The problem is that I can't know what the object will be named ahead of > time! > > So my hack-around is in the class constructor I set a global variable called > $pge with the value submitted to the constructor. So someone would do this: > > $somename = new Display(somename); > > But if someone typos the and the name of the variable is different from the > one submitted to the constructor, all the code will break! That's because > I'm using a variable variable to refer to $front_page, like this: > > ${$pge}->front_page > > I told you it was a hack-around, and it isn't a good one. > > > So is there ANY way to get the name of the object in PHP code without > knowing the name of the object ahead of time? > > I'm really stumped! > > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > > > > -- > 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] >
*sigh* I'm thinking so too ;( Doh! However, I have at least a usable hack around. In the constructor of your class, add: function Class ($object_name) { global $pge; $pge = $object_name; } Then when you use create a new object of that type you must use: $objectname = new Class('objectname'); Then in your code you just use ${$pge}-> to refer to it. Sucks, doesn't it? -- Plutarck Should be working on something... ...but forgot what it was. ""Boget, Chris"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > So is there ANY way to get the name of the object in PHP code without > > knowing the name of the object ahead of time? > > I went through this exact thing not too long ago with an error class > I wrote. Unfortunately, there is no way to know. What you can do, > however, is do a check to see if that object exists before you access > the variable. Other than that, I think you're outta luck. :/ > > Chris >
The best way is to use an email list manager. I remember someone suggesting one, but I've totally forgotten it now. Personally the way I would do it is take the first list and load all the email addys into the Bcc field. Or break them up into small chunks of less than 50 at a time, since trying to pop out an email with 1000 recipients will get you flagged as spamming (which is at least an inconvenience to have to talk with your admin) and could cause SMTP to choke. But less than 50 at a time shouldn't do any harm. Then finish up with all the emails in that list, then go to another function to spit another round. So I'd set up the function to take the ID of the list to email, which would email all the users as mentioned above. I'd have the function in a loop which checks how many lists there are, then feeds them one at a time to the function. Easy to alter later, and it's a weensy bit easier to debug. -- Plutarck Should be working on something... ...but forgot what it was. ""Nikhil Goyal"" <[EMAIL PROTECTED]> wrote in message 9c27h6$ift$[EMAIL PROTECTED]">news:9c27h6$ift$[EMAIL PROTECTED]... > Yes, that is a sound approach. However I've checked it again, and again, and > again, and nothing pops up. It would be easier if I had an error generated. > > I'll try to get my hands on the SMTP logs, will talk to the server admin > about that. My code is sending data to the SMTP socket and monitoring > responses for the SMTP server, and no error there. Here is how it goes > > HELO xxx > MAIL FROM: (me) > RCPT TO: (recipient 1) > DATA > (body) > . > RSET > MAIL FROM: (me) > RCPT TO: (recipient 2) > DATA > (body) > . > (and so on...) > QUIT > > I've noticed that the error shows up when the server load is high: for e.g. > when I am sending out emails to the lists, generally the first list goes > through without a problem (i.e. one email per person). But when it moves on > to the second list, it starts sending two copies. But sometimes the second > list goes okay, and the third generates duplicates. > > What _is_ the best way to send one email body to a dynamically generated > list of email addresses??? > > ""Phillip Bow"" <[EMAIL PROTECTED]> wrote in message > 9c2570$56q$[EMAIL PROTECTED]">news:9c2570$56q$[EMAIL PROTECTED]... > > Whenever you are positive its nto your code then check it again. That > being > > said are there any SMTP logs you can check? Have you monitored the exact > > data being sent to the SMTP server(maybe set up a dummy socket that > repeats > > back the data sent to it then have your program try to connect to that)? > > -- > > phill > > > > ""Nikhil Goyal"" <[EMAIL PROTECTED]> wrote in message > > 9c1ujm$868$[EMAIL PROTECTED]">news:9c1ujm$868$[EMAIL PROTECTED]... > > > Hello people, > > > > > > I am having a peculiar problem with my mailing list and hope you can > help > > me > > > out. I have a mySQL database with a table of email addresses for the > > mailing > > > lists. I have many lists, and my (PHP) code runs various queries on this > > > table to generate lists of email addresses to which the mail has to be > > sent. > > > > > > The email body is combined with this generated list, and then I use > mail() > > > to send this message out to each recipient. I also add on a few headers > > such > > > as From:, Errors-To, Reply-To and Return-Path to the message. > > > > > > Now the problem is that every recipient of my mail is getting two copies > > of > > > the message. I am positive that it's not my code which is causing the > > > problem, the script runs once and terminates. I've also tried to send > mail > > > by opening a socket connection to port 25 on the mail machine and > sending > > > SMTP commands, but still the result is the same. And there is no SMTP > > error > > > generated. > > > > > > Can anybody help me out here? or perhaps suggest a more efficient way of > > > sending out mail to my users? I'm really in a spot here... > > > > > > - Nikhil > > > > > > > > > > > > > > > > > > > > > > > > -- > > > 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] >
I have posted the following message a couple of times on the php-db list and have not gotten a response. I am hoping someone here is willing to help. Thank you John Below is the output and code for my problem. When the database gets read, it returns 0 rows. When it writes, it says it can't because of duplicate entry. FLD_FileName and FDL_Path are the Primary key. Two questions, what I am doing wrong and is there a better way to create a string of text then the one used below. TIA John Read_sql SELECT * FROM TBL_Picture WHERE FLD_FileName = "SailBoat.jpg"and FLD_Path =" /var/www/html/slidecollection/WinterCarnival" Result of read Resource id #2 Error Results 0 Number or Rows 0 Insert Sql INSERT INTO TBL_Picture VALUES ("SailBoat.jpg","/var/www/html/slidecollection/WinterCarnival", "1234","gfgfdgfddg","gfdgfd") Error Results Duplicate entry '/var/www/html/slidecollection/WinterCarnival-SailBoat.jpg' for key 1Result is of 2 is //reading the database to see if record already exists $result = mysql_select_db ("Picture_DB", $link) or die ("Could not get the database"); $read_sql = "SELECT * FROM TBL_Picture WHERE FLD_FileName = \""; $read_sql .= $fn_FileName; $read_sql .= "\"and FLD_Path =\" "; $read_sql .= $fn_Path; $read_sql .= "\""; echo " Read_sql "; echo $read_sql; $result = mysql_query($read_sql, $link) or die("could not read the table"); echo "Result of read "; echo $result; echo " Error Results "; echo mysql_errno ($link); $number_of_rows = mysql_num_rows($result); echo " Number or Rows "; echo $number_of_rows; //if return no rows then we need to add the record if ($number_of_rows == 0){ $insert_sql = "INSERT INTO TBL_Picture VALUES (\""; $insert_sql .= $fn_FileName; $insert_sql .= "\",\""; $insert_sql .= $fn_Path; $insert_sql .= "\",\""; $insert_sql .= $fn_Year; $insert_sql .= "\",\""; $insert_sql .= $fn_DescriptiveText; $insert_sql .= "\",\""; $insert_sql .= $fn_PictureName; $insert_sql .= "\")"; echo " Insert Sql "; echo $insert_sql; $result2 = mysql_query($insert_sql, $link); // or die("could not write to the table "); echo " Error Results "; echo mysql_error ($link); echo "Result is of 2 is"; echo $result2; -- PHP Database 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 Database 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]
> Read_sql SELECT * FROM TBL_Picture WHERE FLD_FileName = > "SailBoat.jpg"and FLD_Path =" /var/www/html/slidecollection/WinterCarnival" This is a little hideous. For one thing, you should probably use ' and not ". It may not make a difference to MySQL, but it does to other databases you may use in the future. For the FLD_Path comparison, you are looking for something that specifically STARTS with a space. I'd bet this is why the script is getting 0 rows back - probably none of your FLD_Path's start with a space. Jason
Thanks for the pointer about ' vs ". I have changed my code to used these. The code is a lot cleaner. I am still getting a not found error. Below is the new "cleaner" messages that I display. One point that may be important, FLD_Name and FLD_Path are the primary key. Couple of questions, can I recreate the same key and use just one name (looks like I could) and would this help with the problem. Read_sql SELECT * FROM TBL_Picture WHERE FLD_FileName = 'IceCastle.jpg' and FLD_Path = '/var/www/html/slidecollection/WinterCarnival' Error Results Result of read Resource id #2 Number or Rows 0 Insert Sql INSERT INTO TBL_Picture VALUES ('IceCastle.jpg', '/var/www/html/slidecollection/WinterCarnival', '1984', 'This is a picture of an Ice Castle at night.', 'Ice Castle') Error Results Duplicate entry '/var/www/html/slidecollection/WinterCarnival-IceCastle.jpg' for key 1 Can I set up my primary key On Tue, 24 Apr 2001, Jason Murray wrote: > > Read_sql SELECT * FROM TBL_Picture WHERE FLD_FileName = > > "SailBoat.jpg"and FLD_Path =" > /var/www/html/slidecollection/WinterCarnival" > > This is a little hideous. > > For one thing, you should probably use ' and not ". It may not > make a difference to MySQL, but it does to other databases you > may use in the future. > > For the FLD_Path comparison, you are looking for something that > specifically STARTS with a space. I'd bet this is why the script > is getting 0 rows back - probably none of your FLD_Path's start > with a space. > > Jason > >
I have one ereg_replace problem that I cannot seem to fix. I need to delete an IMG tag. The only thing I know about this tag is that it will contain SRC="images/headers in the string. Here is an example: <IMG ALT="Tools" BORDER=0 HEIGHT=55 SRC="images/headers/tools.gif" WIDTH=455 > I tried this, but it didn't work: $contents = ereg_replace ("<IMG.*images/headers.*>", "", $contents); Can someone please help? Thanks, Erica
This works: $str = '<IMG ALT="Tools" BORDER=0 HEIGHT=55 SRC="images/headers/tools.gif" WIDTH=455>'; echo eregi_replace("<IMG.+SRC=\"images/headers.*>", "Replaced", $str); -- Plutarck Should be working on something... ...but forgot what it was. "Erica Douglass" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have one ereg_replace problem that I cannot seem to fix. > > I need to delete an IMG tag. The only thing I know about this tag is that > it will contain > > SRC="images/headers > > in the string. Here is an example: > > <IMG ALT="Tools" BORDER=0 HEIGHT=55 SRC="images/headers/tools.gif" WIDTH=455 > > > I tried this, but it didn't work: > > $contents = ereg_replace ("<IMG.*images/headers.*>", "", $contents); > > Can someone please help? > > Thanks, > Erica > > > -- > 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] >
On Tue, 24 Apr 2001 09:51, Dexter wrote: > Hi PHP ers, > > Cant unzip a file from a PHP script. It does nothing. > > It works on the command line. Added paths to both the zip file and > unzip program nothing happens > > exec("/usr/bin/unzip $IMAGE_TEMP_DIR/phpxXTN3T "); > > Thanks > > Dexter What about permissions? Remember that scripts run as the webserver user, possibly nobody. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
> Write to MySQL (last logged in) ? Best, fastest, least error causing way. Yes. -- Plutarck Should be working on something... ...but forgot what it was. ""FredrikAT"" <[EMAIL PROTECTED]> wrote in message 9c19n1$li2$[EMAIL PROTECTED]">news:9c19n1$li2$[EMAIL PROTECTED]... > Hi! > > I have users logging in on my site (they write news).. > What is the best way to show how's online? > > Write to MySQL (last logged in) ? > Somehow use the sessions to this ? > > > --------------------------------- > Fredrik A. Takle > [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] >
Hi, I'm having problems stopping preg_replace from losing $ signs and following text when replacing with array variables. I am trying to use the E modifier and keep getting: "Warning: Unknown modifier 'E' in script.WEB.php3 on line 413" $template=array( "/({PAGETOP})/E", "/({PAGEMIDDLE})/E", "/({PAGEBOTTOM})/E" ); $pagevars=array( "PAGETOP" => $pagetop, "PAGEMIDLE" => $pagetop, "PAGEBOTTOM" => $pagenavbar, ); Text from assorted sources such as database records or external files are placed into the variables $pagetop ... $page = "{PAGETOP}{PAGEMIDDLE}{PAGEBOTTOM}"; $page = preg_replace($template,$pagevars,$page); Other modifiers seem to be accepted. Any help appreciated. Regards Grant Walters Brainbench 'Most Valuable Professional' for Unix Admin Walters & Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND Telephone: +64 4 4765175, CellPhone 025488265, ICQ# 23511989
Try switing the modifier to "e". "E" is not a supported modifier according to the manual. Only the following are supported: i m s x e A D S U X If you are trying to match a $ in your code, just use a backspace to escape it. But I don't think that was your problem... -- Plutarck Should be working on something... ...but forgot what it was. ""Grant Walters"" <[EMAIL PROTECTED]> wrote in message 003801c0cc59$7d2b01a0$[EMAIL PROTECTED]">news:003801c0cc59$7d2b01a0$[EMAIL PROTECTED]... > Hi, > > I'm having problems stopping preg_replace from losing $ signs and following text when replacing with array variables. I am trying > to use the E modifier and keep getting: > > "Warning: Unknown modifier 'E' in script.WEB.php3 on line 413" > > $template=array( > "/({PAGETOP})/E", > "/({PAGEMIDDLE})/E", > "/({PAGEBOTTOM})/E" > ); > > $pagevars=array( > "PAGETOP" => $pagetop, > "PAGEMIDLE" => $pagetop, > "PAGEBOTTOM" => $pagenavbar, > ); > > Text from assorted sources such as database records or external files are placed into the variables $pagetop ... > > $page = "{PAGETOP}{PAGEMIDDLE}{PAGEBOTTOM}"; > $page = preg_replace($template,$pagevars,$page); > > Other modifiers seem to be accepted. Any help appreciated. > > Regards > > Grant Walters > Brainbench 'Most Valuable Professional' for Unix Admin > Walters & Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND > Telephone: +64 4 4765175, CellPhone 025488265, ICQ# 23511989 > > > -- > 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] >
In article <9c2j66$1nt$[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Plutarck") wrote: > If you are trying to match a $ in your code, just use a backspace to escape > it. Or enclose it in square braces. [$] Or use preg_quote(). -- CC
The eregi_replace syntax would be: $string = eregi_replace(".*Wish(.+)numbers", "\\1", $page); It should be noted that I prefer preg_replace, but that's neither here nor there. That _should_ work. It looks fine to me, but test it out to make sure. -- Plutarck Should be working on something... ...but forgot what it was. "Ed Lazor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi =) > > I'm trying to grab content from another web page. After having browsed > through the mailing list archives and such, it looks like I'll need to use > the eregi_replace function, but I'm not sure how to properly format the > command. The goal is to get rid of everything from the start of the page > up to the word "Wish" and everything after the word "numbers". Or, another > way of phrasing it, I'm wanting to get a web page and only use the content > between the words "Wish" and "numbers". What would be the best way of > going about this? > > Thanks, > > -Ed > > > -- > 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] >
Hi, all - Hoping someone can help me with this..I have a client who has a webiste with a number of php3 scripts in it, and we're having a spate of problems relating to migration to php4. 1) I need to know what needs to be done to convert php3 scripts to be compatible with php4. These are scripts largely to do with counters, statistics, date & time functions, and the like. What needs to be done to their extensions as well? 2) Not having access to that info at the time, we decided to go back to php3 - and then ran into a host of security issues re visibility of the html directory. The requisite libraries were there, apache was configured to work with php3, and so forth. If anyone can explain how security issues arose, and give me some faint clue as to how to prevent that from ever happening again,I will try to send maple syrup. 8) 3) Can anyone begin to explain the rationale for making php3 and php4 so utterly incompatible? Thanks in advance, Alpha
S.J. Basic syntax that you would be using in things like counters, statistics, date and time functions hasn't changed much at all...I don't have personal experience with php3, but i know that the developers of php4 have tried hard to make php4 very compatible with php3...i'm sure you'll get an e-mail in a second from several others saying the same thing....as far as security issues, that's not very descriptive, so its hard to understand exactly what's happening...explain what you're doing better and you'll get a more helpful response... all the best, jack "S.J. Black" wrote: > > Hi, all - > > Hoping someone can help me with this..I have a client who has a webiste > with a number of php3 scripts in it, and we're having a spate of > problems relating to migration to php4. > > 1) I need to know what needs to be done to convert php3 scripts to be > compatible with php4. > These are scripts largely to do with counters, statistics, date & > time functions, and the like. What needs to be done to their > extensions as well? > > 2) Not having access to that info at the time, we decided to go back to > php3 - and then ran into a host of security issues re visibility of > the html directory. The requisite > libraries were there, apache was configured to work with php3, and so > forth. If anyone > can explain how security issues arose, and give me some faint clue as > to how to prevent > that from ever happening again,I will try to send maple syrup. 8) > > 3) Can anyone begin to explain the rationale for making php3 and php4 so > utterly > incompatible? > > Thanks in advance, > > Alpha > > -- > 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]
Check out the FAQ on php.net to see about migration issues. They have a section in there...or is it in the manual...well it's in one of those somewhere. First, what security issues are you having? If code is being displayed to the browser it's because the extension is probably not correctly figured. When you start with PHP4 I believe the standard is it will use .php3 and .php, but leave off .php4 and .inc. So you'll need to add those into your server configuration files. On the final question, great care was taken to make PHP4 compatible with PHP3, but certain things are just blasted impossible. Preserving complete compatibility would be little more than a big speed-bump in the road of progress, so to speak :) Then again, it's easy for me to not complain because I started learning on PHP4, hehe. -- Plutarck Should be working on something... ...but forgot what it was. ""S.J. Black"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, all - > > Hoping someone can help me with this..I have a client who has a webiste > with a number of php3 scripts in it, and we're having a spate of > problems relating to migration to php4. > > 1) I need to know what needs to be done to convert php3 scripts to be > compatible with php4. > These are scripts largely to do with counters, statistics, date & > time functions, and the like. What needs to be done to their > extensions as well? > > 2) Not having access to that info at the time, we decided to go back to > php3 - and then ran into a host of security issues re visibility of > the html directory. The requisite > libraries were there, apache was configured to work with php3, and so > forth. If anyone > can explain how security issues arose, and give me some faint clue as > to how to prevent > that from ever happening again,I will try to send maple syrup. 8) > > 3) Can anyone begin to explain the rationale for making php3 and php4 so > utterly > incompatible? > > Thanks in advance, > > Alpha > > -- > 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] >
I just deleted a post that I wanted to reply to. Try reading the FAQ on apache.org Click here or go here -----> http://httpd.apache.org/docs/misc/FAQ.html#POSTnotallowed Hope this helps, Steve
Any data can be sent to the viewer's browser using print or echo in PHP. >From then on you'll need javascript to do any conditional displaying once it hits the user's browser. -- Plutarck Should be working on something... ...but forgot what it was. "Dmitry" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, all! > > Do you know, can I print some page using PHP or > JavaScript? > > Dmitry. > [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] >
Downloaded the latest snapshot so postgres would work. ALl is fine except i cannot get gif and jpeg to work at same time. http://www.ranman.huggle.com/gd_plus_gif.txt i followed those instructions when i tried at first to build stable. and yes i did compile jpeg etc into gd. my configure line is CFLAGS='-O2' ./configure --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd --enable-inline-optimization --with-gnu-ld --with-apache=../apache_1.3.19 --enable-track-vars --disable-debug --with-ttf --with-config-file-path=/usr/local/apache --enable-xml --with-pgsql=/usr/local/pgsql --with-jpeg-dir=/usr/local problem is when i do --with-jpeg-dir=/usr/local i loose gif support. when i take the jpeg line out of configure i get gif support back but no jpeg......anyone run into this can help me out? I would be interested in hearing from anyone that got them both working. ps. I am not on any of these lists...please email me directly. Regards, -- Dan +------------------------------------------------------+ | BRAVENET WEB SERVICES | | [EMAIL PROTECTED] | | screen;cd /usr/src;make buildworld;cd ~ | | cp MYKERNEL /sys/conf/i386;cd /usr/src | | make buildkernel KERNCONF=MYKERNEL | |make installkernel KERNCONF=MYKERNEL;make installworld| +______________________________________________________+
Ok. I have looked at all my options for creating account dynamically from a webpage, and have not come up with much. I want to create an user account that only creates a mail account. I think I can do this with the useradd command (I am running Linux). Like this: useradd accountname -s /bin/false then I could su into the accountname and run the passwd command. Now I could do this, with PHP using the popen() function. There is only 1 problem. I would have to run all this as root since only root is able to run this command. And even if I could it would be a big no no to somehow make PHP become root and then run this command. Any other suggestions on how to create an account dynamically with PHP or how to modify what I about the useradd command to get this to work? Thanks -- ------------------------------- Clayton Bluhm Computer Engineering Student [EMAIL PROTECTED] (School) [EMAIL PROTECTED] (home)
One way is to use a cron job to handle the account adding from a text file, which PHP will write the data into. Since the cron job will use only the account name and password the user submitted it's much less of a security risk. -- Plutarck Should be working on something... ...but forgot what it was. "Nashirak Bosk" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Ok. I have looked at all my options for creating account dynamically > from a webpage, and have not come up with much. I want to create an > user account that only creates a mail account. I think I can do this > with the useradd command (I am running Linux). Like this: > > useradd accountname -s /bin/false then I could su into the > accountname and run the passwd command. > > Now I could do this, with PHP using the popen() function. There is only > 1 problem. I would have to run all this as root since only root is able > to run this command. And even if I could it would be a big no no to > somehow make PHP become root and then run this command. Any other > suggestions on how to create an account dynamically with PHP or how to > modify what I about the useradd command to get this to work? Thanks > > > > -- > ------------------------------- > > Clayton Bluhm > > Computer Engineering Student > > [EMAIL PROTECTED] (School) > [EMAIL PROTECTED] (home) > > >
"Nashirak Bosk" <[EMAIL PROTECTED]> wrote: > Ok. I have looked at all my options for creating account dynamically > from a webpage, and have not come up with much. I want to create an > user account that only creates a mail account. I think I can do this > with the useradd command (I am running Linux). Like this: > > useradd accountname -s /bin/false then I could su into the > accountname and run the passwd command. > > Now I could do this, with PHP using the popen() function. There is only > 1 problem. I would have to run all this as root since only root is able > to run this command. And even if I could it would be a big no no to > somehow make PHP become root and then run this command. Any other > suggestions on how to create an account dynamically with PHP or how to > modify what I about the useradd command to get this to work? Thanks I would recommend installing PHP as a CGI and making the script that calls useradd owned by root and implementing some sort of authentication scheme to prevent unauthorized use or I would write the useradd command to a database (or text file) and have a bash script owned by root check it for entries from a cron job and run the commands if entries are found. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
Hi all I have variable that store date like this : $First = "$year" . "$month" . "$date"; ( which return 20010201 for Feb 1,2001) . I wanna do the loop 8 times that will add 7 more days to the begining date and keep adding it for 8 times. The looping thing is okay but I am not sure if I simply plus 7 on top of date value will give me the date value I want to have. Is this sniplet below okay? ************** $First = "$year" . "$month" . "$date"; for ($i=1; $i < 9 ; ++$i){ $First = $First + 7 ; } ******************* cheers Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
On Tue, 24 Apr 2001 23:44, Jacky wrote: > Hi all > I have variable that store date like this : > $First = "$year" . "$month" . "$date"; ( which return 20010201 for Feb > 1,2001) . I wanna do the loop 8 times that will add 7 more days to the > begining date and keep adding it for 8 times. The looping thing is okay > but I am not sure if I simply plus 7 on top of date value will give me > the date value I want to have. Is this sniplet below okay? > ************** > $First = "$year" . "$month" . "$date"; > for ($i=1; $i < 9 ; ++$i){ > $First = $First + 7 ; > } > ******************* Try it and you'll see why it won't work as you expect. Then check the manual for mktime which can do what you want. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
Hello everybody, My host seems to be having some weird problems. Here's a piece of code: if (($this_month_sql = mysql_query("SELECT * FROM $mysql_shows_table WHERE month = '$thismonth' ORDER BY timestamp ASC")) && ($next_month_sql = mysql_query("SELECT * FROM $mysql_shows_table WHERE month = '$nextmonth' ORDER BY timestamp ASC"))) { do this(); } else { print ("<font face=Arial size=2>MySQL query <b>DIDN'T RETURN DATA</b><br>Error No.:". mysql_errno(). "<br>MySQL Error:". mysql_error(). "</font><Br>"); } Now, this is the error that I get from this: MySQL query DIDN'T RETURN DATA Error No.:1064 MySQL Error:You have an error in your SQL syntax near 'WHERE month = '4' ORDER BY timestamp ASC' at line 1 Why I get this, I don't know. The code hasn't changed in a few days, and it just started doing that today. This also works on my home Win2k box, and Slackware box. The versions of PHP, MySQL, and apache are the same on my host and on my Linux box. The version of php and mysql are the same on ALL of the machines (host, Win2k, Slackware). Any ideas? Thanks everyone, Tyler
> Any ideas? Yes - get it to output the actual SQL that's running. That way you can execute it yourself, and see what's going wrong. Jason
On Tue, 24 Apr 2001 11:50, Tyler Longren wrote: > Hello everybody, > > My host seems to be having some weird problems. > Here's a piece of code: > > if (($this_month_sql = mysql_query("SELECT * FROM $mysql_shows_table > WHERE month = '$thismonth' ORDER BY timestamp ASC")) && > ($next_month_sql = mysql_query("SELECT * FROM $mysql_shows_table WHERE > month = '$nextmonth' ORDER BY timestamp ASC"))) { > do this(); > } > else { > print ("<font face=Arial size=2>MySQL query <b>DIDN'T RETURN > DATA</b><br>Error No.:". mysql_errno(). "<br>MySQL Error:". > mysql_error(). "</font><Br>"); > } > > Now, this is the error that I get from this: > MySQL query DIDN'T RETURN DATA > Error No.:1064 > MySQL Error:You have an error in your SQL syntax near 'WHERE month = > '4' ORDER BY timestamp ASC' at line 1 > > Why I get this, I don't know. The code hasn't changed in a few days, > and it just started doing that today. This also works on my home Win2k > box, and Slackware box. The versions of PHP, MySQL, and apache are the > same on my host and on my Linux box. The version of php and mysql are > the same on ALL of the machines (host, Win2k, Slackware). > > Any ideas? > > Thanks everyone, > Tyler IIRC the syntax error is just before the snippet returned by mysqlerror so you might check the value in $mysql_shows_table is correct. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
hey guys, I have this simple if else statement going and depending on a var it executes a funtion, but for some reason its not running the function or so I think... heres code snippet : -------------------- <? function add_user() { global $user_name; global $pass; global $full_name; global $email; global $age; global $icq; global $aim; $date = gmdate("M d Y H:i:s"); $connection = mysql_connect("localhost", "mylog", "mypass") or die ("Could not connect to database"); $db = mysql_select_db("nydma_cust", $connection); //$sql = "INSERT INTO nydma_users (user_name, pass, full_name, email, age, icq, aim, date) VALUES (\"$user_name\",\"$pass\",\"$full_name\",\"$email\",\"$age\",\"$icq\",\"$aim \",\"$date\")"; $sql = "INSERT INTO nydma_users SET user_name='$user_name', pass='$pass', full_name='$full_name', email='$email', age='$age', icq='$icq', aim='$aim', date='$date'"; $result = mysql_query($sql, $connection ) or die ("Couldnt run query"); session_start(); } function log_user() { global $user_name; global $pass; $date = gmdate("M d Y H:i:s"); $connection = mysql_connect("localhost", "mylog", "mypass") or die ("Could not connect to database"); $db = mysql_select_db("nydma_cust", $connection); $sql = "SELECT * FROM nydma_users WHERE user_name='$user_name' AND pass='$pass'"; $user_result = mysql_query($sql, $connection) or die ("Couldnt run query"); while($row=mysql_fetch_array($user_result)){ $id =$row[0]; $user_name =$row[1]; $pass_w =$row[2]; $full_name =$row[3]; $email =$row[4]; $age =$row[5]; $icq =$row[6]; $aim =$row[7]; session_start(); } if($l=="d") { log_user(); } else if($r=="d") { add_user(); } else { $r ="y"; } ?> ----------------- TIA Andy _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
> if($l=="d") { > log_user(); > } else if($r=="d") { > add_user(); > } else { > $r ="y"; > } looks like: 1. $l is not set to "d". 2. $r is not set to "d". $r may be set to "y" by this code. Did you check it? Jason
actually yes, the r is "register" the l is "login" and r to y is "yes" r to d is "done" if that makes sense? :) the actual problem is coming from a missing { or an } I just actually found a misplaced "}" other then that Im still at a loss ----- Original Message ----- From: "Jason Murray" <[EMAIL PROTECTED]> To: "'PHPhyperboy'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, April 23, 2001 10:25 PM Subject: RE: [PHP] function in if statement not executed ?-->> Help > > if($l=="d") { > > log_user(); > > } else if($r=="d") { > > add_user(); > > } else { > > $r ="y"; > > } > > looks like: > > 1. $l is not set to "d". > > 2. $r is not set to "d". > > $r may be set to "y" by this code. Did you check it? > > Jason _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Also, I ran this SQL on the regular mysql client, and it returned the correct data...for some reason if I run it in PHP, I get the SQL syntax error. Tyler > -----Original Message----- > From: Tyler Longren [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 23, 2001 9:20 PM > To: PHP-General > Subject: [PHP] Now, why doesn't this work? > > > Hello everybody, > > My host seems to be having some weird problems. > Here's a piece of code: > > if (($this_month_sql = mysql_query("SELECT * FROM $mysql_shows_table WHERE > month = '$thismonth' ORDER BY timestamp ASC")) && ($next_month_sql = > mysql_query("SELECT * FROM $mysql_shows_table WHERE month = '$nextmonth' > ORDER BY timestamp ASC"))) { > do this(); > } > else { > print ("<font face=Arial size=2>MySQL query <b>DIDN'T RETURN > DATA</b><br>Error No.:". mysql_errno(). "<br>MySQL Error:". > mysql_error(). > "</font><Br>"); > } > > Now, this is the error that I get from this: > MySQL query DIDN'T RETURN DATA > Error No.:1064 > MySQL Error:You have an error in your SQL syntax near 'WHERE month = '4' > ORDER BY timestamp ASC' at line 1 > > Why I get this, I don't know. The code hasn't changed in a few > days, and it > just started doing that today. This also works on my home Win2k box, and > Slackware box. The versions of PHP, MySQL, and apache are the same on my > host and on my Linux box. The version of php and mysql are the > same on ALL > of the machines (host, Win2k, Slackware). > > Any ideas? > > Thanks everyone, > Tyler > > > -- > 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] >
Hi all I have variable that store date like this : $First = "$year" . "$month" . "$date"; ( which return 20010201 for Feb 1,2001) . I wanna do the loop 8 times that will add 7 more days to the begining date and keep adding it for 8 times. The looping thing is okay but I am not sure if I simply plus 7 on top of date value will give me the date value I want to have. I try the sniplet below and it did not work, always return zero. What should I do here??? ************** $First = "$year" . "$month" . "$date"; for ($i=1; $i < 9 ; ++$i){ $First = $First + 7 ; } ******************* cheers Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
hehe ... here I am again: mySQL? if yes then do date+INTERVAL 8 DAYS. PHP? then convert everything into UNIX timestamp with mktime() and do a plus of (60*60*24 for each day) and then reconvert it back into the time format you want. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -----Original Message----- From: Jacky [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 24, 2001 11:27 PM To: [EMAIL PROTECTED] Subject: [PHP] date add more 7 days, help needed. Hi all I have variable that store date like this : $First = "$year" . "$month" . "$date"; ( which return 20010201 for Feb 1,2001) . I wanna do the loop 8 times that will add 7 more days to the begining date and keep adding it for 8 times. The looping thing is okay but I am not sure if I simply plus 7 on top of date value will give me the date value I want to have. I try the sniplet below and it did not work, always return zero. What should I do here??? ************** $First = "$year" . "$month" . "$date"; for ($i=1; $i < 9 ; ++$i){ $First = $First + 7 ; } ******************* cheers Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"
Yup...it was the table. I have 2 sets of variables on my config.inc file. One is for my local servers, the others are for remote servers (the host). I didn't have $mysql_shows_table defined in the remote servers section. Sorry about that everyone. This thread can die now. Tyler > -----Original Message----- > From: Jason Murray [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 23, 2001 9:27 PM > To: 'Tyler Longren' > Subject: RE: [PHP] Now, why doesn't this work? > > > > :) > > read the updated message..forgot to say that I've done that > > already in the orig message. > > You said you'd executed it yourself - you didn't say that you'd > executed the SQL that PHP is sending to MySQL. Get it to output > that SQL, copy it from the web browser and execute it. > > I suspect the $mysql_shows_table or whatever it's called is not > being set. > > Jason >
Forgive me for my ignorance, but I've noticed some unwanted behavior (IMO, at least) with the is_link() function. Given the simple code.. if ( is_link ("/tmp/this_is_a_symlink") ) print ("Success\n"); and the file.. lrwxrwxrwx 1 root root 5 Apr 23 21:19 /tmp/this_is_a_symlink -> /bin/ the above obviously prints 'Success\n'. However, if I break the symlink, with something like the following.. lrwxrwxrwx 1 root root 4 Apr 23 21:21 /tmp/this_is_a_symlink -> foo the script fails with.. Warning: stat failed for /tmp/this_is_a_symlink (errno=2 - No such file or directory) in ./test.php on line 3. The file /tmp/this_is_a_symlink is still a symlink, so it seems to me that the is_link() function should still return true, whether or not the symlink's target exists. Is there perhaps a function I have yet to discover that provides that behavior, without verifying the link's target? I ask this because much of linux's /proc contains (intentionally) broken symlink's and is_link()'s behavior is making the scouring of /proc very difficult on me. ;) Thanks for any input.. J. Jones
J. Jones wrote: > Forgive me for my ignorance, but I've noticed some unwanted behavior (IMO, > at least) with the is_link() function. Given the simple code.. > > if ( is_link ("/tmp/this_is_a_symlink") ) > print ("Success\n"); > > and the file.. > lrwxrwxrwx 1 root root 5 Apr 23 21:19 /tmp/this_is_a_symlink -> /bin/ > the above obviously prints 'Success\n'. > > However, if I break the symlink, with something like the following.. > lrwxrwxrwx 1 root root 4 Apr 23 21:21 /tmp/this_is_a_symlink -> foo > the script fails with.. > > Warning: stat failed for /tmp/this_is_a_symlink (errno=2 - No such file or > directory) in ./test.php on line 3. Do you have permission to read the /tmp catalog? Otherwise you may get that error I suppose. M.
On Tue, Apr 24, 2001 at 05:31:04AM +0200, Martin Skjöldebrand wrote: > > Warning: stat failed for /tmp/this_is_a_symlink (errno=2 - No such file or > > directory) in ./test.php on line 3. > > Do you have permission to read the /tmp catalog? Otherwise you may get that > error I suppose. > > M. Yes.. the script was executed as root, so permissions aren't an issue. ;) The error, I believe, is generated from is_link() trying to do a stat() on the link's target, which doesn't exist. The symlink is broken the second time around (foo doesn't exist).
What's the best (secure?) way of transmitting sensitive information over email? I'm helping some friends build an online order form. They have a Thawte certificate and are already using it for the order form, but they would like the information to be emailed to them when an order is placed. The problem is, the information contains everything, the person's name, address, credit card information. Obviously I can't just email this over over the ether, so how do people deal with this type of stuff? The server is a unix machine, and they are using winblows to read email. -- H | Hi, I'm currently out of my mind. Please leave a message. BEEEEP! |____________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 Director of Internet Operations / SysAdmin . 800.441.3873 x130 Photo Craft Laboratories, Inc. . eFax 248.671.0909 http://www.pcraft.com . 3550 Arapahoe Ave, #6 .................. . . . . Boulder, CO 80303, U.S.A.
> What's the best (secure?) way of transmitting sensitive > information over email? I'm helping some friends build an online > order form. They have a Thawte certificate and are already using > it for the order form, but they would like the information to be > emailed to them when an order is placed. The problem is, the > information contains everything, the person's name, address, > credit card information. Obviously I can't just email this over > over the ether, so how do people deal with this type of stuff? Use PGP to encrypt the mail. The web server will need to have a PGP environment set up for the user running the httpd (usually "nobody" on a Linux box). Thus, PHP and access and execute PGP. Set up PGP on the recipients' computer. Probably a good idea to make the email address "[EMAIL PROTECTED]" or "sales@", and not an individual user - makes it easier to manage a bunch of people receiving orders. Export the public key for the recipient's address, and send it to the web server. Have the sysadmin import the public key into the web server's user's PGP keyring with full trust and privileges, as this will stop PGP asking "do you really want to trust this user?" in the middle of a batch process and thus breaking everything. Once you can PGP encrypt a text file to that public key without having PGP ask for confirmation of anything, you need to hook PHP up to it. You need the environment variable PGPPATH set, so: <? putenv("PGPPATH=".where_you_installed_the_web_server_users'_pgp); ?> Then you can write out the original mail with all the naughty info in it to a file, run PGP over it to produce an encrypted version, delete the original and mail the encrypted version. Jason
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Have the email be a "you've got an order" email that has a URL in it which the then can view the order via SSL. That way you don't have to put all the information in the email. PGP is another option, but I find it beyond the abilities of many winblows users. - -- Aaron Turner <[EMAIL PROTECTED]|synfin.net|linuxkb.org> URI:www.synfin.net They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin pub 1024D/F86EDAE6 Sig: 3167 CCD6 6081 0FFC B749 9A8F 8707 9817 F86E DAE6 All emails by me are PGP signed; a lack of a signature indicates a forgery. I have retired my PGP 2.6.2 key: FBE1 CEED 57E4 AB80 596E 60BF 451B 20E8 On Mon, 23 Apr 2001, Ashley M. Kirchner wrote: > > What's the best (secure?) way of transmitting sensitive information > over email? I'm helping some friends build an online order form. They > have a Thawte certificate and are already using it for the order form, > but they would like the information to be emailed to them when an order > is placed. The problem is, the information contains everything, the > person's name, address, credit card information. Obviously I can't just > email this over over the ether, so how do people deal with this type of > stuff? > > The server is a unix machine, and they are using winblows to read > email. > > -- > H | Hi, I'm currently out of my mind. Please leave a message. BEEEEP! > |____________________________________________________________________ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 > Director of Internet Operations / SysAdmin . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . eFax 248.671.0909 > http://www.pcraft.com . 3550 Arapahoe Ave, #6 > .................. . . . . Boulder, CO 80303, U.S.A. > > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: Public key at: http://www.synfin.net/aturner/pgpkey.asc iEYEARECAAYFAjrk9FwACgkQhweYF/hu2uaojACfQB0rb/s6fE2TJdc0JVIfgOAD ZdkAn15Cly3vZ2cwUwOFZrmEt+T7ZP/G =fORj -----END PGP SIGNATURE-----
> What's the best (secure?) way of transmitting sensitive information > over email? Leave the messages on the server and get them via pop3s. Outlook is capable of pop3 via ssl. Best regards Niklas Neumann
> Leave the messages on the server and get them via pop3s. > Outlook is capable of pop3 via ssl. I wouldn't do that - it makes the server a great hack target. Jason
Can anyone help me? The sintax of function file_exists is: if(file_exists("ttttt.txt")) { print... } Does anybody knows how can work with remote files? This is not working: if(file_exists("http://www.ttttttt.com/ttttt.txt")) { print... } Thanks for any help, Paulo Roberto Ens - Brazil Bruc Sistemas para Internet Ltda mailto:[EMAIL PROTECTED] http://www.bruc.com.br ------------------------------------ Diversão ou Cultura? CuritibaWeb.com - O Melhor Guia de Curitiba! http://www.curitibaweb.com
On Tue, Apr 24, 2001 at 12:20:01AM -0300, Paulo - Bruc Internet wrote: > Can anyone help me? > > The sintax of function file_exists is: > > if(file_exists("ttttt.txt")) > { > print... > } > > Does anybody knows how can work with remote files? > This is not working: > if(file_exists("http://www.ttttttt.com/ttttt.txt")) > { > print... > } > > Thanks for any help, > > Paulo Roberto Ens - Brazil > Bruc Sistemas para Internet Ltda > mailto:[EMAIL PROTECTED] > http://www.bruc.com.br > ------------------------------------ > Diversão ou Cultura? CuritibaWeb.com - O Melhor Guia de Curitiba! > http://www.curitibaweb.com >From the manual.. file_exists() will not work on remote files; the file to be examined must be accessible via the server's filesystem. Try something like this instead: if (($fd = fopen ("http://url/file.ext", "r"))) { print... }
I have a function on an include page that says function update_stuff($database) { include("includes/connect.inc.php"); include("config/db.conf.php"); $query="SELECT * FROM $database"; $query_res=mysql_query($query, $mysql_link); $isequip=mysql_num_rows($query_res); } If I call it from a script as update_stuff(equipment); I don't get any result (I want to page to automagically update it's contents) while if I include the query lines after each edit case it does update the page contents. I'm missing something basic, but what? Martin S.
On Tue, 24 Apr 2001 12:57, Martin Skjöldebrand wrote: > I have a function on an include page that says > > function update_stuff($database) > { > include("includes/connect.inc.php"); > include("config/db.conf.php"); > $query="SELECT * FROM $database"; > $query_res=mysql_query($query, $mysql_link); > $isequip=mysql_num_rows($query_res); > } > > If I call it from a script as > update_stuff(equipment); > > I don't get any result (I want to page to automagically update it's > contents) while if I include the query lines after each edit case > it does update the page contents. > > I'm missing something basic, but what? > > Martin S. Your function isn't doing anything to return values of the rows you are selecting. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA I'm no stranger, just a friend you haven't met...
Looks like you have a scope issue : $a = 'foo'; function bar() { $a = 'bar'; } bar(); print $a; // prints foo outside of the function, $a has not been affected. want it to be? then try something like : $a = 'foo'; function bar() { global $a; $a = 'bar'; } bar(); print $a; // prints bar see how that works? now if you're just wanting to get a row count then try something like : function getRowCount($table) { $r = mysql_query("SELECT count(*) FROM $table"); return mysql_result($r,0); } print getRowCount('tablename'); it's much faster to rely on sql count function as opposed to selecting all data and using x_num_rows. regarding functions and scope, see : http://www.php.net/manual/en/functions.php http://www.php.net/manual/en/language.variables.scope.php regards, philip On Tue, 24 Apr 2001, Martin [ISO-8859-4] Skjöldebrand wrote: > I have a function on an include page that says > > function update_stuff($database) > { > include("includes/connect.inc.php"); > include("config/db.conf.php"); > $query="SELECT * FROM $database"; > $query_res=mysql_query($query, $mysql_link); > $isequip=mysql_num_rows($query_res); > } > > If I call it from a script as > update_stuff(equipment); > > I don't get any result (I want to page to automagically update it's > contents) while if I include the query lines after each edit case > it does update the page contents. > > I'm missing something basic, but what? > > Martin S. > > -- > 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] >
> Actually it's not "dangerous" per se. > > However if can be very dangerous if you aren't being careful in your code, > for instance, consider this. > > Let's say I've conditionally set $sql somewhere else in the code based upon > certain conditions, which works fine. But let's say those conditions aren't > met so $sql doesn't get set to anything since it's not really used. Now > consider this code: > > if ($sql) > { > $result = mysql_query($sql); > } > > Now that would be fine for all normal instances. But now what if someone > appends this onto the end of your url: > > ?query= > > ...plus something like "DROP databasename". It doesn't take too much > imagination to see what kind of things could happen if someone just had a > little bit of knowledge about how your code works. > > Thus you have two options. One is of course to turn register_globals off, > but ALWAYS ALWAYS _ALWAYS_ set a default for every variable you refer to in > your script at some point before doing anything with it. So if you use $sql > be 100% sure that it has been set $sql explicitly in your code before doing > anything with it. Whether you turn register_globals off or not, you need to always watch cases like this. I have seen many people say that register_globals is inherently insecure and then they turn it off and go through and use something like $HTTP_POST_VARS['sql'] everywhere they used to use $sql. This only makes it slightly more tedious to inject bogus variables into since the attacker now needs to make a trivial little form to inject stuff into the POST data instead of just sticking it onto the URL. Security-wise there is no difference whatsoever. Never never never trust user-supplied data implicitly. Always check anything that could possibly come from the user. For internal variables, always initialize them and just generally think things through as you write your scripts. This is no different in PHP than in any other scripting language used for web work. -Rasmus
Francois Legare [EMAIL PROTECTED] > -----Original Message----- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: April 23, 2001 9:30 PM > To: Plutarck > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Why is it dangerous to have register_globals on? > Never never never trust user-supplied data implicitly. Always check > anything that could possibly come from the user. For internal variables, > always initialize them and just generally think things through as you > write your scripts. This is no different in PHP than in any other > scripting language used for web work. > > -Rasmus Hi Rasmus, can you, or anyone else, give more examples to help me understand what you mean by "generally think things through" or give pointer(s) on the web where this topic is being discussed and plenty of examples are given. Actually, any advices, tips and tricks on how to code securely and how to make sure user-supplied data are never implicitly trusted would be more than welcomed. thanks
On Monday 23 April 2001 11:56, Greig, Euan wrote: > I have read in several places that is dangerous to have register_globals > on, but I have not understood the (short) explanations given. Can anyone > enlighten me? keep it a rule to either unset any variable that you use or set them with a default value. how awfully nice register_globals is, I've started to be more aware and use of HTTP_POST_VARS and HTTP_GET_VARS in case someone get a wild idea to abuse some of my products. they might get some dangerous stuff, I can't imagine their fantasy so I just let them have as little chance as possible :) -- php developer / CoreTrek AS | TV is chewing gum for the eyes. -- Sandnes / Rogaland / Norway | Frank Lloyd Wright web: http://www.moijk.net/ |
Previously, Ashley M. Kirchner said: > > I have a bunch of variables (through a POST form) that I need to > loop through and check for content. Right now, each one is being > evaluated separately: > > if ($var1 == '') { > $url .= "&var1="; > $error = 1; > } else { > $url .= "&var1=".urlencode(stripslashes($var1)).""; > } > > Then repeat for $var2, $var3, etc., etc... > > Is there a better way of doing this looping instead of writing the > same routine over and over again? // List of variable names $var_list = array ( 'var1', 'var2', 'var3', 'var4' ); while (list($key,$val) = each($var_list)) { if ($$val == '') { $url .= "&".$val."="; $error = 1; } else { $url .= "&".$val."=". urlencode(stripslashes($$val)) .""; } } Of course, if this is all POST variables then you should be able to just use the pre-built array $HTTP_POST_VARS (if track_vars is on). Then you'd do something like this instead: while (list($key,$val) = each($HTTP_POST_VARS)) { if ($val == '') { $url .= "&".$key."="; $error = 1; } else { $url .= "&".$key."=".urlencode(stripslashes($val)).""; } } If you're using GET rather than post, just subtitute $HTTP_GET_VARS. -d -- If a man is standing in the middle of the forest speaking and there is no woman around to hear him... is he still wrong? -George Carlin
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 23 Apr 2001, Andreas Landmark wrote: > > country the corresponding cities should only be listed in the second > > dropdown box. Can some one guide me. Right below is my table > > structure. > > If you want to do this with pure php you'll need to reload the page after > the user selects the country from the dropdownbox, to get the webbrowser > to switch the cities in the city-dropdown w/o reloading you'll need to > use javascript or similar evil measures... I want to do it in pure php, how do I do this. I tried it in javascripts but I could not get javascript to pass the results back to php. My knowledge is limited TIA Adrian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.2 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE65R4X/f1mUNueu/oRAmMWAJ0fwyRUjYHehZVr2y6yp+7ZcD+HVACeOINX 1TUK0JkhUygsXC2uawoxikM= =2c/I -----END PGP SIGNATURE-----
I missed this thread but check out : http://zend.com/zend/tut/drop-down.php regards, philip On Tue, 24 Apr 2001, Adrian D'Costa wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Mon, 23 Apr 2001, Andreas Landmark wrote: > > > > country the corresponding cities should only be listed in the second > > > dropdown box. Can some one guide me. Right below is my table > > > structure. > > > > If you want to do this with pure php you'll need to reload the page after > > the user selects the country from the dropdownbox, to get the webbrowser > > to switch the cities in the city-dropdown w/o reloading you'll need to > > use javascript or similar evil measures... > > I want to do it in pure php, how do I do this. > > I tried it in javascripts but I could not get javascript to pass the > results back to php. My knowledge is limited > > TIA > > Adrian > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.2 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE65R4X/f1mUNueu/oRAmMWAJ0fwyRUjYHehZVr2y6yp+7ZcD+HVACeOINX > 1TUK0JkhUygsXC2uawoxikM= > =2c/I > -----END PGP SIGNATURE----- > > > -- > 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] >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanks. This is what I was looking for. I will try and hack the example Adrian On Tue, 24 Apr 2001, Philip Olson wrote: > > I missed this thread but check out : > > http://zend.com/zend/tut/drop-down.php > > regards, > philip > > On Tue, 24 Apr 2001, Adrian D'Costa wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > On Mon, 23 Apr 2001, Andreas Landmark wrote: > > > > > > country the corresponding cities should only be listed in the second > > > > dropdown box. Can some one guide me. Right below is my table > > > > structure. > > > > > > If you want to do this with pure php you'll need to reload the page after > > > the user selects the country from the dropdownbox, to get the webbrowser > > > to switch the cities in the city-dropdown w/o reloading you'll need to > > > use javascript or similar evil measures... > > > > I want to do it in pure php, how do I do this. > > > > I tried it in javascripts but I could not get javascript to pass the > > results back to php. My knowledge is limited > > > > TIA > > > > Adrian > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.0.2 (GNU/Linux) > > Comment: For info see http://www.gnupg.org > > > > iD8DBQE65R4X/f1mUNueu/oRAmMWAJ0fwyRUjYHehZVr2y6yp+7ZcD+HVACeOINX > > 1TUK0JkhUygsXC2uawoxikM= > > =2c/I > > -----END PGP SIGNATURE----- > > > > > > -- > > 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] > > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.2 (GNU/Linux) Comment: For info see http://www.gnupg.org iD4DBQE65Sv4/f1mUNueu/oRAi3JAJit2Ny3NHZ7n6bFZZGMDqGewdHrAKDUuOc2 /X7LTzPXuVggiinSZ4TATA== =49Be -----END PGP SIGNATURE-----
Hi, I am working on a newsletter module. What I want to know is that how can we send a newsletter via email to all the subscribers in html format with images in the htm too??? Well I am able to send an html file as attachment using the php mail() function. But I still can't see the images in the htm file. What I think is the mail function just sends the file as text only and it will not pick up the images in the html file. So is there a way that I can send the html format with images via email. Please reply asap. regards George _____________________________________________________ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.com
have something like mail("$address", "$subject", "$body", "$headers \nContent-Type: text/HTML; charset=iso-8859-1\nContent-Transfer-Encoding: 64bit" )in your mail mail( -----Original Message----- From: George Alexander [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 24, 2001 4:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Want to send email in html format Hi, I am working on a newsletter module. What I want to know is that how can we send a newsletter via email to all the subscribers in html format with images in the htm too??? Well I am able to send an html file as attachment using the php mail() function. But I still can't see the images in the htm file. What I think is the mail function just sends the file as text only and it will not pick up the images in the html file. So is there a way that I can send the html format with images via email. Please reply asap. regards George _____________________________________________________ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.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]
is it possible to change the Content-Type and Content-Transfer-Encoding in a mail you recieve??? this way you can convert mails written with html-codes, sent from a mail-program that doesn't support it...... "Peter Houchin" <[EMAIL PROTECTED]> skrev i meldingsnyheter:[EMAIL PROTECTED] > have something like > > mail("$address", "$subject", "$body", "$headers \nContent-Type: text/HTML; charset=iso-8859-1\nContent-Transfer-Encoding: 64bit" )in your mail > > mail( > > -----Original Message----- > From: George Alexander [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 24, 2001 4:37 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Want to send email in html format > > > Hi, > > I am working on a newsletter module. What I want > to know is that how can we send a newsletter via > email to all the subscribers in html format > with images in the htm too??? > > Well I am able to send an html file as attachment > using the php mail() function. But I still can't > see the images in the htm file. What I think is > the mail function just sends the file as text only > and it will not pick up the images in the html file. > So is there a way that I can send the html format > with images via email. > > Please reply asap. > > regards > George > > _____________________________________________________ > Chat with your friends as soon as they come online. Get Rediff Bol at > http://bol.rediff.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] > >
is it possible to change the Content-Type and Content-Transfer-Encoding in a mail you recieve??? this way you can convert mails written with html-codes, sent from a mail-program that doesn't support it...... "Peter Houchin" <[EMAIL PROTECTED]> skrev i meldingsnyheter:[EMAIL PROTECTED] > have something like > > mail("$address", "$subject", "$body", "$headers \nContent-Type: text/HTML; charset=iso-8859-1\nContent-Transfer-Encoding: 64bit" )in your mail > > mail( > > -----Original Message----- > From: George Alexander [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 24, 2001 4:37 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Want to send email in html format > > > Hi, > > I am working on a newsletter module. What I want > to know is that how can we send a newsletter via > email to all the subscribers in html format > with images in the htm too??? > > Well I am able to send an html file as attachment > using the php mail() function. But I still can't > see the images in the htm file. What I think is > the mail function just sends the file as text only > and it will not pick up the images in the html file. > So is there a way that I can send the html format > with images via email. > > Please reply asap. > > regards > George > > _____________________________________________________ > Chat with your friends as soon as they come online. Get Rediff Bol at > http://bol.rediff.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] > >
is it possible to change the Content-Type and Content-Transfer-Encoding in a mail you recieve??? this way you can convert mails written with html-codes, sent from a mail-program that doesn't support it...... "Peter Houchin" <[EMAIL PROTECTED]> skrev i meldingsnyheter:[EMAIL PROTECTED] > have something like > > mail("$address", "$subject", "$body", "$headers \nContent-Type: text/HTML; charset=iso-8859-1\nContent-Transfer-Encoding: 64bit" )in your mail > > mail( > > -----Original Message----- > From: George Alexander [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 24, 2001 4:37 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Want to send email in html format > > > Hi, > > I am working on a newsletter module. What I want > to know is that how can we send a newsletter via > email to all the subscribers in html format > with images in the htm too??? > > Well I am able to send an html file as attachment > using the php mail() function. But I still can't > see the images in the htm file. What I think is > the mail function just sends the file as text only > and it will not pick up the images in the html file. > So is there a way that I can send the html format > with images via email. > > Please reply asap. > > regards > George > > _____________________________________________________ > Chat with your friends as soon as they come online. Get Rediff Bol at > http://bol.rediff.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] > >
Hello! I generate a text file from a mysql database. I'm trying to send this file by mail. Is this possible with mail() function ??? I read the documentation, but I didn't find anything yet. Thanks. Calin
On Wed, 25 Apr 2001 00:02, Calin Rotaru wrote: > Hello! > > I generate a text file from a mysql database. > I'm trying to send this file by mail. Is this possible with mail() > function ??? I read the documentation, but I didn't find anything yet. > Thanks. > > > Calin You'll need to read the data from the file into a variable which you can then process and send with mail() -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Fact is solidified opinion
On Tuesday 24 April 2001 03:37, David Robley wrote: > On Wed, 25 Apr 2001 00:02, Calin Rotaru wrote: > > Hello! > > > > I generate a text file from a mysql database. > > I'm trying to send this file by mail. Is this possible with mail() > > function ??? I read the documentation, but I didn't find anything yet. > > Thanks. > > > > > > Calin > > You'll need to read the data from the file into a variable which you can > then process and send with mail() I read the file in $body;Then I wrote thees lines: mail($address,$message,$body,"$headers \nContent-Type: text/PLAIN; charset=US_ASCII; name=\"fisier.txt\"\nContent-Transfer-Encoding: BASE64\nContent-Dispositon: attachment; filename=\"fisier.txt\"\n"); and this is the message which I received Content-Type: text/PLAIN; Status: charset=US_ASCII; name="fisier.txt" Content-Transfer-Encoding: BASE64 Content-Dispositon: attachment; filename="fisier.txt" and then the lines from file. I didn'l receive an attachment. What am I doing wrong? Calin
Hi all. How can I convert this: 10000250 into this: 10.000.250? I must manage numbers rangin from some million to... well, too much to read them without points (or colons for USA guys). I'm looking in the docs but printf doesn't seem to be able to do that. Thank you. -- Liman - [EMAIL PROTECTED]
> I'm looking in the docs but printf doesn't seem to be able to do that. You want http://www.php.net/manual/en/function.number-format.php. Jason
Yes. It was just that. Thankx a lot. -- Liman - [EMAIL PROTECTED]
Hello everyone, Quick question: I would like to install a standalone web server can run PHP, I'm looking for guidance on how to do this. Basically, I want to add a PHP application on a CD-ROM, for demonstration purposes. I know PHP can be runed as a standalone, but what about the server? Can apache do something like this? Will a person have install apache when they run the disk? Do you know of a server that can do this? I'm currently looking at the SimpleServer, by AnalogX-www.analogX.com, but that only allow CGI and is not too configurable. I would appreciate any information that you can share. Thanks. __________John Monfort_________________ _+-----------------------------------+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+___________________________________+-
Don't really... know...why don't you try PWS+PHP4 for windows? it will take up like max 50MB on the CDrom and it's easy installable... -elias http://eassoft.cjb.net "John Monfort" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hello everyone, > > Quick question: > > I would like to install a standalone web server can run PHP, I'm looking > for guidance on how to do this. > > Basically, I want to add a PHP application on a CD-ROM, for > demonstration purposes. > > I know PHP can be runed as a standalone, but what about the server? Can > apache do something like this? Will a person have install apache when > they run the disk? Do you know of a server that can do this? > I'm currently looking at the SimpleServer, by AnalogX-www.analogX.com, > but that only allow CGI and is not too configurable. > > I would appreciate any information that you can share. > > Thanks. > > > > > __________John Monfort_________________ > _+-----------------------------------+_ > P E P I E D E S I G N S > www.pepiedesigns.com > "The world is waiting, are you ready?" > -+___________________________________+- > > > -- > 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] >
hello... just asking...what is better in this case: i got lots of scripts and almost all of them needs to connect to the DB and some of thems are accessed lots of times what is better to use in such cases: mysql_connect() or mysql_pconnect()... i mean will speed factor play a role when lots and lots of user tries to connect to the DB? -elias http://eassoft.cjb.net
[PHP] what is better? mysql_connect() or mysql_pconnect()? mysql_pconnect() is better for a web application because is lighter for the server, (the connection is not permanent)
hi how can i delete the browser-cache in PHP thanks -- Mohammed Oda Leibniz str. 76 55118 Mainz Tel.06131-638350 GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net
I don't understand why you want to connect IPCHAINS to your PHP script. Normally your IPCHAINS (or IPTABLES) firewall would be running anyway, wouldn't it? Maybe I've missed something, but I don't see how the two are linked. I'd have the PHP script check username and password, and if valid, go ahead and do whatever the script determines. I'd also have IPCHAINS running the whole time and configured to let any authorised user out/in. But there would be no direct link between the two. Mick On Tue, 24 Apr 2001, Faryal wrote: > Hi > I wanted o ask u about a problem regarding my project. The project is related to >"Cyber Cafe Authentication". Here we have to chk whether a set of user name & >password is valid and if valid allow this user access to internet. All the scripitng >has been done in PHP and the operating system is linux. Now we just have to link "IP >CHAINS" to our php script. That is when the user is allowed to access internet, ip >chains should start running through the script. However we are stuck at this problem >& cannot find a sound solution. Can u plz help us? That would be very nice :) > Waiting anxiuosly for ur reply..... > Regards > Faryal > >
> > And I see no reason why we should not be allowed to handle most of the > > fatal errors we get on our own. Especially annoying is the xslt_process() > > function that returns something like "<br><b>Fatal error</b>: XML parser > > error 7: mismatched tag in <b>/var/www/[...]". As far as I can see, this > http://www.php.net/manual/en/features.error-handling.php > have you taken a deeper look into this? Well, I have tried... > beside, use @ in front of the command to pipe away the current error or stop > on-screen display of errors in general. My problem is that not displaying anything in case of an error is a completely unacceptable solution. I *MUST* return a valid XML message in a predefined format. If not, I am violating the standard we are following. And if I do not find a way to comply with the standard, it means that we have to scrap PHP alltogether for this project. Svein Roar