[PHP] Compile problem
could anybody help me out, while compiling and Making PHP its going fine, but I couldn't get any php binary file instead a file named 'libphp4.la' was created. I want to compile it as a standalone binary as a normal user. Thanks in Advance. <[EMAIL PROTECTED]> --- We must use time wisely and forever realize that the time is always ripe to do right." -- Nelson Mandela --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dynamically fill list box
A real newbie would be grateful for some help. I have a sports club membership database (Mysql) with first and last names, address and paid or not paid. In edit.php I would like to be able to pre-fill a list box with whether the person has paid or not, change if necessary, update the database and view the resultant changes in members.php I have tried the following in edit.php but can't get it to work. Update Update a members record "; include("mydb1.inc"); mysql_connect(localhost,$user,$password); $query1 = "select * from contact where id = '$id'"; $result1 = mysql_db_query('mydb',$query1); while($row = mysql_fetch_object($result1)) { print "First Name:"; print "Last Name:"; print "Address:"; print "Paid: paid not paid "; $id = $row->id; } echo ""; echo ""; ?> You left one or more fields blank."); } $query2 = "update contact set first='$first', last='$last', address='$address', paid='$paid' where id='$id'"; mysql_db_query('mydb',$query2); echo "Your record has been updated"; } mysql_close(); ?> Thank you for any help Gee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Variables within a string
On Tue, Mar 12, 2002 at 05:42:12PM +0800, Jason Wong wrote: > On Tuesday 12 March 2002 12:27, Analysis & Solutions wrote: > > The source of the data *does* matter. That is why the latest releases of > PHP (> 4.0.6) recommends having register_globals OFF by default. > ... snip snip snip ... > To see why the source of data matters, see the chapter "Security::Using > Register Globals" The examples on that page are lame. For example: if($HTTP_COOKIE_VARS['username']){ // can only come from a cookie, forged or otherwise $good_login = 1; fpassthru ("/highly/sensitive/data/index.html"); } Naturally, just because someone submits a user name doesn't make their submission valid. I know, they're just using that as an example. But, in the real world, you need to first make sure the username submitted fits within your expected parameters of length and character types. Plus, if you're about to put that user name into a query, doesn't contain any characters which will trick the query. Then, you need to check that the user name is valid. Then, and only then, would you permit the user to get the sensitive data. Regardless of where the data comes from, all of those steps need to be taken. Thus, it doesn't matter where the data came from. > But if you don't know where the data came from then it's not secure. Consider > a "real-life" example. Robin Hood steals the Sheriff's ATM card, and the > Sheriff stupidly enough has written the PIN onto the back of the card. Now > Robin can go and withdraw all the money from the Sheriff's account because > the ATM has no way of knowing that the card was stolen (it doesn't know where > the source of the data came from), all it knows is that the data is valid > (right card, right PIN). Hmm. You're correct. At the same time, the point I'm trying to make is not about the person transmitting the data, but rather, the means they're doing so. My issue is the thief would also be able to use that pin to (hypothetically, of course) access the Sheriff's account via debit card purchases in stores, the bank's website and bank-by-phone services. Regardless of the means used to transmit the PIN, the bank still needs to ensure the data is clean before they perform the check to see if the PIN is the right PIN for that account. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Get row number from mysql
In article <000701c1cb06$3b54f3b0$0101a8c0@nightengale>, [EMAIL PROTECTED] says... > Hello, > > How can I get the number of the current row, something like this: > > $sql = mysql_query("SELECT * FROM table ORDER BY id DESC"); > while ($row = mysql_fetch_array($sql)) { > $id = $row["id"]; > $name = $row["name"]; > print "$current_row_number. $name"; > } > ?> > I can't just use the id field, because the ID's might not always be 1, 2, 3, > 4, 5, 6, etc...they could go 1, 2, 4, 5, 8. > > I need it to look like this: > 1. first person > 2. second person > 3. third person > > and so on and so forth. > > Can anyone advise me on how I should do this? > > thanks, > Tyler > > Given that the data is not stored in the table in any particular order (that is likely to be useful to you), perhaps you could add another field which has a value allocated by you that you can use for your purpose. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: explode() - quick question
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Im trying to take this string, "hello", and explode it into an array > with each cell in the array containing one character. > > $array[0] = 'h' > $array[1] = 'e' > etc.. > > How does this work? When is use... > > $character = explode('', $string) or > $character = explode($string) > > ...it doesn't seem to work. ANY HELP!?!? THANKS!! > You don't need to do that if you just want to reference a particular position in the string. Each character in a string variable can be referenced as though the variable is an array of characters. Try: -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Connecting Form result to PHP query?
If you use the get method, it will pass the variables in the query string. if you use post it will pass them in the server variable. Either way, you can reference them via the form name on the first page. For example: On the first page you have a field with the name: subject1 (). The user submits the first page. On the results page you can reference the value of "subject1" as $subject1 Hope that helps. Jeff "Phplist" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On first page, there is a form where > > User must select choice from Subject1 (mandatory) > User may select choice from Geographic Area (optional) > > When you click on Go, you go to Results page where there will be > instructions for PHP: > > Search database where Subject1=$subject1 OR Subject2=$subject1 AND > Geographic=$geographic > > Whenever there is a match in Subject1 OR Subject2 AND MAYBE a match in > Geographic > > Then display results in an HTML-format. > > Q: How do I send the results from the form on first page to the results > page? > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Connecting Form result to PHP query?
On first page, there is a form where User must select choice from Subject1 (mandatory) User may select choice from Geographic Area (optional) When you click on Go, you go to Results page where there will be instructions for PHP: Search database where Subject1=$subject1 OR Subject2=$subject1 AND Geographic=$geographic Whenever there is a match in Subject1 OR Subject2 AND MAYBE a match in Geographic Then display results in an HTML-format. Q: How do I send the results from the form on first page to the results page? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: What permissions for uploading?
Not to but in, but you might want to check on your version. www.php.net published an advisory on a possible flaw on that very issue: http://www.php.net/release_4_1_2_win32.php http://security.e-matters.de/advisories/012002.html Leif K-Brooks wrote: > I have a script that allows the user to upload a file. Right now, though, > it says permission denied when I try to upload. The permissions for the > folder I want to upload to is 755 right now. What should I change it to? -- John Taylor-Johnston - ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Double slash
>looks good to me - only screwy thing I can think of is the backslash thing - >REALLY annoying - and confusing sometimes Yeah, no kidding. Thanks Martin! What about if I try copying $to_path onto a Network server? Do you see any problems with the code and $to_path? (Not that I have a server to test it on yet. Not that Works & Services are going to take 2 weeks :-( to replace my stolen server! But I have to prepare for the inevitable.) ---snip- $date = date ("Ymd"); $from_path = getcwd()."\\mysql\\"; $to_path = "/sirius/data/usager/ccl/backups/".$date."/"; if(!is_dir($from_path)) { echo "failed"; exit; }else{ rec_copy($from_path, $to_path); echo "files copies from $from_path and backed up to $to_path"; } # function rec_copy ($from_path, $to_path) { if(!is_dir($to_path)) mkdir($to_path, 0777); #if(mkdir($to_path, 0777)) # {mkdir($to_path, 0777);} $this_path = getcwd(); if (is_dir($from_path)) { chdir($from_path); $handle=opendir('.'); while (($file = readdir($handle))!==false) { if (($file != ".") && ($file != "..")) { if (is_dir($file)) { rec_copy ($from_path.$file."/", $to_path.$file."/"); chdir($from_path); }else{ # echo "error if (is_dir($file))"; } if (is_file($file)) { copy($from_path.$file, $to_path.$file); }else{ # echo "error copy($from_path.$file, $to_path.$file)"; } }#end (($file != ".") }#end while (($file closedir($handle); }# end if (is_dir else{ # echo "if (is_dir($from_path))"; } }# end function -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] rand()
Use two rand()'s. $foo = rand(2); if ($foo == 0) rand(first_set); else rand(second_set); Niklas -Original Message- From: Jeff Sittler [mailto:[EMAIL PROTECTED]] Sent: 14. maaliskuuta 2002 7:50 To: [EMAIL PROTECTED] Subject: Re: [PHP] rand() the min and max would work if I wanted the number between 33 and 146, but I am wanting to specify two ranges, not just one. Please RTFP Jeff "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Thursday 14 March 2002 13:31, Jeff Sittler wrote: > > I am wanting to use rand() to generate a number between 33-90 OR 125-146. > > Is there a way to do this? I don't want any numbers before 33 or between > > 91-124 or after 146. Could someone point me in the direction I need > > to look to accomplish this. > > rand(min, max); > > Please RTFM. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > /* > Man and wife make one fool. > */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] rand()
Just do the obvious: $rand = rand(33,111); $num = ($rand>90) ? $rand+35 : $rand; On Wed, 13 Mar 2002, Jeff Sittler wrote: > I am wanting to use rand() to generate a number between 33-90 OR 125-146. > Is there a way to do this? I don't want any numbers before 33 or between > 91-124 or after 146. Could someone point me in the direction I need to look > to accomplish this. > > Thanks, > Jeff > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] rand()
the min and max would work if I wanted the number between 33 and 146, but I am wanting to specify two ranges, not just one. Please RTFP Jeff "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Thursday 14 March 2002 13:31, Jeff Sittler wrote: > > I am wanting to use rand() to generate a number between 33-90 OR 125-146. > > Is there a way to do this? I don't want any numbers before 33 or between > > 91-124 or after 146. Could someone point me in the direction I need to > > look to accomplish this. > > rand(min, max); > > Please RTFM. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > /* > Man and wife make one fool. > */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] rand()
$n = rand(33, 112); if ($n > 90) $n += 34; not tested in code, but logically, this should work Martin -Original Message- From: Jeff Sittler [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 4:31 PM To: [EMAIL PROTECTED] Subject: [PHP] rand() I am wanting to use rand() to generate a number between 33-90 OR 125-146. Is there a way to do this? I don't want any numbers before 33 or between 91-124 or after 146. Could someone point me in the direction I need to look to accomplish this. Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] rand()
And I just realized how redundant the checks for less then and grater then the rand min and rand max are... Oh well... I'm tired :) -Original Message- From: Demitrious S. Kelly [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 9:45 PM To: 'Jeff Sittler'; [EMAIL PROTECTED] Subject: RE: [PHP] rand() Something to the effect of $num=0; do { $num=rand(33,146); if ( $num > 90 && $num < 125 ) { $num=0; } else if ( $num > 146 || $num < 33 ) { $num=0; } } while ( $num == 0 ); note: ths is just off the top of my head... check for validity and syntax. -Original Message- From: Jeff Sittler [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 9:31 PM To: [EMAIL PROTECTED] Subject: [PHP] rand() I am wanting to use rand() to generate a number between 33-90 OR 125-146. Is there a way to do this? I don't want any numbers before 33 or between 91-124 or after 146. Could someone point me in the direction I need to look to accomplish this. Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] rand()
Something to the effect of $num=0; do { $num=rand(33,146); if ( $num > 90 && $num < 125 ) { $num=0; } else if ( $num > 146 || $num < 33 ) { $num=0; } } while ( $num == 0 ); note: ths is just off the top of my head... check for validity and syntax. -Original Message- From: Jeff Sittler [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 9:31 PM To: [EMAIL PROTECTED] Subject: [PHP] rand() I am wanting to use rand() to generate a number between 33-90 OR 125-146. Is there a way to do this? I don't want any numbers before 33 or between 91-124 or after 146. Could someone point me in the direction I need to look to accomplish this. Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Double slash
looks good to me - only screwy thing I can think of is the backslash thing - REALLY annoying - and confusing sometimes Martin -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 4:44 PM To: [EMAIL PROTECTED] Subject: [PHP] Double slash On a windows server, echo getcwd().""; gives me: C:\WINDOWS\Bureau\php\microweb How do I double slash it? Is this ok: $test_path = getcwd()."\\test1\\"; echo $test_path; It seems ok, when I echo it? Any screwy Windows thing I need to know about? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] rand()
On Thursday 14 March 2002 13:31, Jeff Sittler wrote: > I am wanting to use rand() to generate a number between 33-90 OR 125-146. > Is there a way to do this? I don't want any numbers before 33 or between > 91-124 or after 146. Could someone point me in the direction I need to > look to accomplish this. rand(min, max); Please RTFM. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Man and wife make one fool. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Double slash
On a windows server, echo getcwd().""; gives me: C:\WINDOWS\Bureau\php\microweb How do I double slash it? Is this ok: $test_path = getcwd()."\\test1\\"; echo $test_path; It seems ok, when I echo it? Any screwy Windows thing I need to know about? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] rand()
I am wanting to use rand() to generate a number between 33-90 OR 125-146. Is there a way to do this? I don't want any numbers before 33 or between 91-124 or after 146. Could someone point me in the direction I need to look to accomplish this. Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] rec_copy
So I just declare at the beginning: if(!is_dir($to_path)) mkdir($to_path, 0777); The code works. But how can I make sure $from_path exists first and fails if not? Same thing? if(!is_dir($from_path)) { echo "failed"; exit; } The first time I ran it, I ran it with a non-existing $from_path directory and the function ran anyways. I thought the function had a built-in safe-guard? -snip-- if(!is_dir($from_path)) { echo "failed"; exit; }else{ rec_copy($from_path, $to_path); echo "files copies from $from_path and backed up to $to_path"; } # function rec_copy ($from_path, $to_path) { if(!is_dir($to_path)) mkdir($to_path, 0777); #if(mkdir($to_path, 0777)) # {mkdir($to_path, 0777);} $this_path = getcwd(); if (is_dir($from_path)) { chdir($from_path); $handle=opendir('.'); while (($file = readdir($handle))!==false) { if (($file != ".") && ($file != "..")) { if (is_dir($file)) { rec_copy ($from_path.$file."/", $to_path.$file."/"); chdir($from_path); }else{ # echo "error if (is_dir($file))"; } if (is_file($file)) { copy($from_path.$file, $to_path.$file); }else{ # echo "error copy($from_path.$file, $to_path.$file)"; } }#end (($file != ".") }#end while (($file closedir($handle); }# end if (is_dir else{ # echo "if (is_dir($from_path))"; } }# end function > > http://www.php.net/manual/en/function.copy.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: What permissions for uploading?
That'd depend upon who owns the directory and what user your web server is running as. If the folder, or directory is owned by the user the server is running as then the permissions should be OK. Due to your error message I'd guess they don't have write access. Permissions of 766 might be enough. Although I'd make sure that the directory is owned by the user the server is running as and then make it 700. You're in a non-Windows environment - yes ?? Jim. "Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have a script that allows the user to upload a file. Right now, though, > it says permission denied when I try to upload. The permissions for the > folder I want to upload to is 755 right now. What should I change it to? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] rec_copy
On Thursday 14 March 2002 11:37, jtjohnston wrote: > You might have seen a version of this function: > > http://www.php.net/manual/en/function.copy.php > > I would like to rework this line: > > mkdir($to_path, 0777); > > where mkdir will ignore $to_path if > the directory already exists. I have already tried this: > > #if(!mkdir($to_path, 0777)) > # {mkdir($to_path, 0777);} > > but that doesn't work. I suppose that is because the > function calls itself when it creates sub-directories. Can't you just check whether the directory exists before calling mkdir()? is_dir() -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* The good (I am convinced, for one) Is but the bad one leaves undone. Once your reputation's done You can live a life of fun. -- Wilhelm Busch */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What permissions for uploading?
I have a script that allows the user to upload a file. Right now, though, it says permission denied when I try to upload. The permissions for the folder I want to upload to is 755 right now. What should I change it to? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ANNOUNCE: validateEmail 2.0 & validateEmailFormat 1.0
Announcing a couple of PHP scripts that I think have been a long time in coming ... validateEmail - 2.0 A much needed updating of the validateEmail function created in '98 by Jon S. Stevens, and updated by Shane Gibson, berber, and Frank Vogel over time. Several new features have been added, including an improved "wait" routine for sluggish hosts, and RFC 2821-compliant SMTP command formatting to eliminate "hang" problems caused by attempts to validate on certain hosts. I realize there is quite a bit of controversy over the validation methods used by this script -- therefore, some people may not favor it. However, I feel it's an effective first line of defense against the "[EMAIL PROTECTED]" sort of garbage, etc. Those who use validateEmail now will find this to be a useful upgrade. validateEmailFormat - 1.0 The PHP online docs say the following in the "add a note" section: "(And if you're posting an example of validating email addresses, please don't bother. Your example is almost certainly wrong for some small subset of cases. See this information from O'Reilly Mastering Regular Expressions book for the gory details.)" Good advice, I think. So good, in fact, that I figured it was time someone just went ahead and translated that regex into PHP. This code is distributed in accordance with O'Reilly's policy on re-use of code examples from their books. (http://www.oreilly.com/ask_tim/codepolicy_1101.html) # # # I fully recognize that there is no foolproof way to validate an e-mail address (either its functionality or formatting) without actually sending a message and requiring the user to respond. In the cases where that tactic is not considered acceptable, I believe the combination of these two functions is the next best thing. validateEmail and validateEmailFormat are freely available at: http://www.killersoft.com/contrib/index.html Comments, suggestions and questions encouraged. Enjoy! Regards, -Clay __ Clay Loveless KillerSoft - http://www.killersoft.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mini CMS (content management system) (plase cc me, I'm on digest)
If the webserver is Apache you can do this: ServerName myserver.mydomain.org DocumentRoot /usr/local/www/myserver Action php-parse /path-to/script.php Action php-parse /path-to/script.php SetHandler php-parse SetHandler "application/x-httpd-php" *Every* request (whether the file exists or not) is handled by /path-to/script.php. Note that this is *every* request so either modify the above to only handle PHP files or do some work in /path-to/script.php to quickly readfile() non PHP files (ie, all the images on your site). -philip On Wed, 13 Mar 2002, Dennis Gearon wrote: > I'm trying to get all requests from a DOMAIN to go through one file, > something like: > > http://www.mydomain.com/all_accesses.php > > They can come IN as http requests of: > > http://www.mydomain.com/any_directory/any_filename?any_vars with any > POST or COOKIE vars. > > Anyone have any ideas? I'm trying to make this as DROP in as possible on > a shared ISP, i.e. asking for as little help/sys mods as possible from > the ISP. Zope can be run this way, but it's in Python, and I don't want > to learn that now. > > > > The reason why .. is that: > this allows me to keep the directory structure in the data base, keep > very granular role based permissions on the directory structure, down to > the file, and have a web based interface to upload/download content, > with a powerful auth/perm system. The only files to get into the file > system are binary ones, images, flash, that sort of stuff. I haven't > quite figured out the permissions system for accessing those, yet. > -- > > If You want to buy computer parts, see the reviews at: > http://www.cnet.com/ > **OR EVEN BETTER COMPILATIONS**!! > http://sysopt.earthweb.com/userreviews/products/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Get row number from mysql
hmmm, I never thought of that. Thanks for the help. ;-) Tyler - Original Message - From: "michael kimsal" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Tyler Longren" <[EMAIL PROTECTED]> Cc: "PHP-General" <[EMAIL PROTECTED]> Sent: Wednesday, March 13, 2002 9:57 PM Subject: [PHP] Re: Get row number from mysql > Tyler Longren wrote: > > Hello, > > > > How can I get the number of the current row, something like this: > > > > > $sql = mysql_query("SELECT * FROM table ORDER BY id DESC"); > > while ($row = mysql_fetch_array($sql)) { > > $id = $row["id"]; > > $name = $row["name"]; > > print "$current_row_number. $name"; > > } > > ?> > > I can't just use the id field, because the ID's might not always be 1, 2, 3, > > 4, 5, 6, etc...they could go 1, 2, 4, 5, 8. > > > > I need it to look like this: > > 1. first person > > 2. second person > > 3. third person > > > > and so on and so forth. > > > > Can anyone advise me on how I should do this? > > > > thanks, > > Tyler > > > > > > > > Why not just put a counter in there? > > while ($row = mysql_fetch_array($sql)) { > ++$counter; > $id = $row["id"]; > $name = $row["name"]; > print "$counter. $name"; > } > > > > Michael Kimsal > http://www.phphelpdesk.com > PHP support when you need it > 734-480-9961 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] explode() - quick question
just use $string{0} and $string{1} , etc. note the type of brackets -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 2:06 PM To: [EMAIL PROTECTED] Subject: [PHP] explode() - quick question Im trying to take this string, "hello", and explode it into an array with each cell in the array containing one character. $array[0] = 'h' $array[1] = 'e' etc.. How does this work? When is use... $character = explode('', $string) or $character = explode($string) ...it doesn't seem to work. ANY HELP!?!? THANKS!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Get row number from mysql
Tyler Longren wrote: > Hello, > > How can I get the number of the current row, something like this: > > $sql = mysql_query("SELECT * FROM table ORDER BY id DESC"); > while ($row = mysql_fetch_array($sql)) { > $id = $row["id"]; > $name = $row["name"]; > print "$current_row_number. $name"; > } > ?> > I can't just use the id field, because the ID's might not always be 1, 2, 3, > 4, 5, 6, etc...they could go 1, 2, 4, 5, 8. > > I need it to look like this: > 1. first person > 2. second person > 3. third person > > and so on and so forth. > > Can anyone advise me on how I should do this? > > thanks, > Tyler > > Why not just put a counter in there? while ($row = mysql_fetch_array($sql)) { ++$counter; $id = $row["id"]; $name = $row["name"]; print "$counter. $name"; } Michael Kimsal http://www.phphelpdesk.com PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode() - quick question
On Wed, Mar 13, 2002 at 10:06:01PM -0500, Phil Schwarzmann wrote: > > $array[0] = 'h' > $array[1] = 'e' > > $character = explode('', $string) or You need to explode the array: $character = explode('', $array); --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] rec_copy
You might have seen a version of this function: http://www.php.net/manual/en/function.copy.php I would like to rework this line: mkdir($to_path, 0777); where mkdir will ignore $to_path if the directory already exists. I have already tried this: #if(!mkdir($to_path, 0777)) # {mkdir($to_path, 0777);} but that doesn't work. I suppose that is because the function calls itself when it creates sub-directories. Any ideas? John ##--- snip $date = date ("Ymd"); rec_copy($from_path, $to_path); echo "files copies from $from_path and backed up to $to_path"; function rec_copy ($from_path, $to_path) { mkdir($to_path, 0777); #if(!mkdir($to_path, 0777)) # {mkdir($to_path, 0777);} $this_path = getcwd(); if (is_dir($from_path)) { chdir($from_path); $handle=opendir('.'); while (($file = readdir($handle))!==false) { if (($file != ".") && ($file != "..")) { if (is_dir($file)) { rec_copy ($from_path.$file."/", $to_path.$file."/"); chdir($from_path); }else{ # echo "error if (is_dir($file))"; } if (is_file($file)) { copy($from_path.$file, $to_path.$file); }else{ # echo "error copy($from_path.$file, $to_path.$file)"; } }#end (($file != ".") }#end while (($file closedir($handle); }# end if (is_dir else{ echo "if (is_dir($from_path))"; } }# end function -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: getting values from multiple select
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Hi gang- > > I am working on a javascript box that will allow the user to drag values > from one select box to another. I will use this box to set the values. > This is a standard, multiple select box. On the next page I need to > figure out what PHP is doing with the data coming in. > > If I send 5 fields to the next page PHP will show me one when I echo the > variable to the page. If I try to split the varaiable I still get only > one value in the echo. Tried to reponse.write it in asp and I get the > string with comma seperate values. > > Help! If you are using a SELECT MULTIPLE you need to name the item as an array, e.g. NAME="multi[]" - then loop through the array in the target script to extract the values. Don't forget to either define a default selection or check for 'none selected' -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Splitting Header and Body of an Email?
In article <01C1CA7C.C4DA97A0@P01>, [EMAIL PROTECTED] says... > Hello List, > > I'm trying aroung to split the header and the body of an email but > can't get it to work. > > First I read in the email: > > $fp = fopen("php://stdin","r"); > $count = 0; > while (!feof($fp)) > { $data = fgets($fp,4096); > $data = chop($data); > $count = $count + 1; > $content[] = "$data"; > } > fclose($fp); > > and then > > for ($x=0; $x <= $count; $x++) > { $sent_data .= "$content[$x]\n"; > } > > Then I tried stuff like > > $mail_split = explode("\r\n\r\n",$sent_data); > > > How would it work? > > Thanks a lot, > Juergen Get rid of the chop - that strips \r and \n amongst other things -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Digital Certificate
Hi, I am connecting to LinkPoint for accepting credit card. They gave me this instruction : -- BELOW IS A COPY OF YOUR DIGITAL CERTIFICATE: Your ISP requires a digital certificate to complete the setup of your website in order for you to begin accepting credit card payments. A copy of your digital certificate has been emailed to your ISP. - How do i setup digital certificate, we have SSL. Do i need to something in the Apache's httpd.conf file to make this work. Looking forward for response on how to go about this job. Regards, karthikeyan.
[PHP] DHTML Trouble please help
Hi all, I am no DHTML expert and don't even know the language also didn't know where to post this. But after today I am going to learn. I downloaded a tetris game from Dynamic Drive: http://www.dynamicdrive.com/dynamicindex12/tetris/index.htm Have a look. I would add it here but it's too long. I want to add the high score to a users data in the database. Would one of you DHTML and PHP Gurues (SP) please point out what section of the code I would use to get the high score. I would like to (I can do this part if someone would show what I use from the DHTML) echo or print the score to the bottom of the browser window and then have that added to the db. TIA GC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] explode() - quick question
Im trying to take this string, "hello", and explode it into an array with each cell in the array containing one character. $array[0] = 'h' $array[1] = 'e' etc.. How does this work? When is use... $character = explode('', $string) or $character = explode($string) ...it doesn't seem to work. ANY HELP!?!? THANKS!!
[PHP] Get row number from mysql
Hello, How can I get the number of the current row, something like this: "; } ?> I can't just use the id field, because the ID's might not always be 1, 2, 3, 4, 5, 6, etc...they could go 1, 2, 4, 5, 8. I need it to look like this: 1. first person 2. second person 3. third person and so on and so forth. Can anyone advise me on how I should do this? thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question on functions finding out about caller
I've checked google and the PHP manual, with no results, so i thought i'd ask here: Is there any functionality in PHP to allow a function to find out what function/file/line called it? AFAIK, perl can do this, and i've always found it a big help when debugging to have functions die with a call to a standard error handler. (for example) function one() { if ($badstuff) death("I died for this reason"); } i know that calling death(__FILE__, __LINE__) will accomplish this, but i really don't want to do that. thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
- Original Message - From: "Analysis & Solutions" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Thursday, March 14, 2002 8:36 AM Subject: Re: [PHP] Targetted redirection? > On Thu, Mar 14, 2002 at 07:58:29AM +0800, Michael P. Carel wrote: > > > I have that kind of problem before, but it whould be much better to use > > javascripts rather than the HTTP Header function when redirecting to cover > > over the frame page. Use this instead: > > > > echo"top.location.href=http://your.page.direction; "; > > > > I've already tried and using this kind of redirection and it just works fine > > with me. > > Sure it works... execpt when people who have Java'sCrap turned off come > to your site. Oh, and then there's the folks with browsers that don't > have JS at all? HTTP headers work across all browsers. > header('Location: http://foo.org/') is the real solution. > > For more info on why not to use Java'sCrap and how accomplish the same > things without it, see >http://www.analysisandsolutions.com/code/weberror.htm?j=y > > Enjoy, > > --Dan > oh yes i've got your point, but i've tried what you've told us before but still it does not redirect to cover over the frame page. Here's what i've did: header('Window-target: _top'); header('Location: http://my.directed.page'); or either header('Window-target: _blank'); header('Location: http://my.directed.page'); this source doesnt redirect to cover the frame, instead it just shows within the frame, and upon refresh it will cover the frame page. what should be the problem? --Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Thu, Mar 14, 2002 at 07:58:29AM +0800, Michael P. Carel wrote: > I have that kind of problem before, but it whould be much better to use > javascripts rather than the HTTP Header function when redirecting to cover > over the frame page. Use this instead: > > echo"top.location.href=http://your.page.direction; "; > > I've already tried and using this kind of redirection and it just works fine > with me. Sure it works... execpt when people who have Java'sCrap turned off come to your site. Oh, and then there's the folks with browsers that don't have JS at all? HTTP headers work across all browsers. header('Location: http://foo.org/') is the real solution. For more info on why not to use Java'sCrap and how accomplish the same things without it, see http://www.analysisandsolutions.com/code/weberror.htm?j=y Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] Random Selecting from mySQL
Hi! Do you have a primary key field in the table? If yes, you can after displaying the first 10 records you can put the primary key values of those records in an array and have "primary_key_fiels NOT IN (array_values_seperated_by_commas)" in your quesry.. So when you display your first page with 10 records, then you won't have any restricting values because the array will be empty. When you display it second time then you will have the first 10 records excluded and your array will be populated 20 values so that when you display the third page thos 20 will be excluded and vice versa.. Did I confuse you enough?:) I hope this helps.. Gurhan -Original Message- From: Georgie Casey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 7:11 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Random Selecting from mySQL yea, i know how to display 10 results per page, but that doesnt work when you want to do a ORDER BY rand() query. "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > are you just looking for a way to display 10 results per page? If yes then > you can just use LIMIT to limit your result to 10 .. So, for the first page, > you can do "SELECT LIMIT 1, 10;" and for the second page "SELECT ... > LIMIT 11, 20" etc etc . > You can sure use "ORDER BY" with "LIMIT" to to sort the results for a > given criteria .. > > Gurhan > > > -Original Message- > From: Georgie Casey [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 13, 2002 2:00 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: [PHP-DB] Random Selecting from mySQL > > > I know how to use the "ORDER BY rand()" command on the end of queries to > randomize selection, but that's no good when you want to only display 10 > results per page. The next page the user chooses, randomizes again and could > show duplicate fields and not at all show other fields. > > Does anyone know a way round this? > > -- > Regards, > Georgie Casey > [EMAIL PROTECTED] > > *** > http://www.filmfind.tv > Ireland's Online Film Production Directory > *** > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] Random Selecting from mySQL
Pass along a hidden form which documents exactly what rows have already been shown then you could use $seen=explode(':', $seen); to break it into an array... after that use a foreach to add a 'and id != '.$seen into the sql query for every element in $seen... thus not allowing duplicates on a per visit basis... -Original Message- From: Georgie Casey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 4:11 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Random Selecting from mySQL yea, i know how to display 10 results per page, but that doesnt work when you want to do a ORDER BY rand() query. "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > are you just looking for a way to display 10 results per page? If yes then > you can just use LIMIT to limit your result to 10 .. So, for the first page, > you can do "SELECT LIMIT 1, 10;" and for the second page "SELECT ... > LIMIT 11, 20" etc etc . > You can sure use "ORDER BY" with "LIMIT" to to sort the results for a > given criteria .. > > Gurhan > > > -Original Message- > From: Georgie Casey [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 13, 2002 2:00 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: [PHP-DB] Random Selecting from mySQL > > > I know how to use the "ORDER BY rand()" command on the end of queries to > randomize selection, but that's no good when you want to only display 10 > results per page. The next page the user chooses, randomizes again and could > show duplicate fields and not at all show other fields. > > Does anyone know a way round this? > > -- > Regards, > Georgie Casey > [EMAIL PROTECTED] > > *** > http://www.filmfind.tv > Ireland's Online Film Production Directory > *** > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: setcookie problem: Cannot add header information - headers already sent by
You can't send use setcookie after headers have been sent to the browser, you can have white space in a php block because this is not sent to the browser. The exception is if you have output buffering enabled. Jason From: qartis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 5:14 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: setcookie problem: Cannot add header information - headers already sent by I don't think you can have an empty line (even in the php) before cookies are set "Frank Ramsay" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Cookies have to be set before the block begins. > > -fjr > > Bob wrote: > > > here is the example: > > > > > // Beginning php > > > > // Saving the page header in the variable $head. > > $head = << > > > > > > > Feedback form > > > > > > > > Feedback form > > ENDH; > > // End of page header > > > > // Saving the page footer in the variable $tail. > > $tail = << > > > > > > > ENDT; > > // End of page footer > > > > // Set up variables that will be saved in the cookies > > // Define unique cookie prefix > > $ID = "My_ID"; > > // Cookie lifetime in seconds (in this example, three days) > > $cookie_life = 60; > > // Name of cookie that holds the user's name > > $n_name = $ID . "_Name"; > > // Name of cookie that holds the user's email > > $n_email = $ID . "_Email"; > > // Name of cookie that holds the user's last login > > $n_last = $ID . "_Last"; > > > > // These lines print the form with user input and mails to the > > webmaster. > > if( isset($sfeedback)) { > > Setcookie($n_last,Date("H:i d/m/Y"),time()+$cookie_life); > > print $head; > > ?> > > Thanks for your feedback, . Here is what you > > said: > > Name: > > Email: > > Feedback: > > > // Mails the feedback to the webmaster. > > $subject = "Feedback from your site"; > > $sendto = "[EMAIL PROTECTED]"; > > $header = "From: $email"; > > mail($sendto, $subject, $feedback, $header); > > print "Thank you. Your comments have been sent to the > > webmaster\n"; > > // Print end and leave > > print $tail; > > exit(); > > } > > > > // This loop treats users who have not been to the site before. > > if(!$$n_last) { > > if( ! isset($name)) { // if no name - display the form > > echo $head; > > ?> > > Welcome to our system! Please fill in the following information: > > > > > > Name: > > Email: > > > > > > > echo $tail; > > exit; > > } else { > > // Set cookies and continue > > Setcookie($n_name,$name,time()+$cookie_life); > > Setcookie($n_email,$email,time()+$cookie_life); > > $$n_name = $name; > > $$n_email = $email; > > } > > } > > > > // This loop treats repeat users. > > Setcookie($n_last,Date("H:i d/m/Y"),time()+$cookie_life); > > echo $head; > > ?> > > Welcome back to our system, . > > > // Have previous login > > if($$n_last) > > echo "Your last login was on " . $$n_last . "."; > > > > // User fills in feedback form > > ?> > > > > Name: > > Email: > > Feedback: > > > > > > > > > > > > > > > > > > > > Warning: Cannot add header information - headers already sent by > > (output started at C:\WebShare\wwwroot\last\cookie.php:59) in > > C:\WebShare\wwwroot\last\cookie.php on line 75 > > > > Warning: Cannot add header information - headers already sent by > > (output started at C:\WebShare\wwwroot\last\cookie.php:59) in > > C:\WebShare\wwwroot\last\cookie.php on line 76 > > > > Warning: Cannot add header information - headers already sent by > > (output started at C:\WebShare\wwwroot\last\cookie.php:59) in > > C:\WebShare\wwwroot\last\cookie.php on line 83 > > > > what' wrong? > > thanks! > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COOKIES QUESTION
do you have to delete cookies on the same level (directory) you created them? coz mine dont seem to be deleting -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] Random Selecting from mySQL
could you perhaps do the select on the first page, then store the results in a session (array) and just load different indexed portions of the resultset each page? only problem there is that you wouldn't get any refreshed results while browsing those pages - but i don't know if this matters for you or not. HTH Beau // -Original Message- // From: Georgie Casey [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 14 March 2002 3:00 AM // To: [EMAIL PROTECTED]; [EMAIL PROTECTED] // Subject: [PHP-DB] Random Selecting from mySQL // // // I know how to use the "ORDER BY rand()" command on the end // of queries to // randomize selection, but that's no good when you want to // only display 10 // results per page. The next page the user chooses, randomizes // again and could // show duplicate fields and not at all show other fields. // // Does anyone know a way round this? // // -- // Regards, // Georgie Casey // [EMAIL PROTECTED] // // *** // http://www.filmfind.tv // Ireland's Online Film Production Directory // *** // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php // -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] Random Selecting from mySQL
yea, i know how to display 10 results per page, but that doesnt work when you want to do a ORDER BY rand() query. "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > are you just looking for a way to display 10 results per page? If yes then > you can just use LIMIT to limit your result to 10 .. So, for the first page, > you can do "SELECT LIMIT 1, 10;" and for the second page "SELECT ... > LIMIT 11, 20" etc etc . > You can sure use "ORDER BY" with "LIMIT" to to sort the results for a > given criteria .. > > Gurhan > > > -Original Message- > From: Georgie Casey [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 13, 2002 2:00 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: [PHP-DB] Random Selecting from mySQL > > > I know how to use the "ORDER BY rand()" command on the end of queries to > randomize selection, but that's no good when you want to only display 10 > results per page. The next page the user chooses, randomizes again and could > show duplicate fields and not at all show other fields. > > Does anyone know a way round this? > > -- > Regards, > Georgie Casey > [EMAIL PROTECTED] > > *** > http://www.filmfind.tv > Ireland's Online Film Production Directory > *** > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: setcookie problem: Cannot add header information - headers already sent by
I don't think you can have an empty line (even in the php) before cookies are set "Frank Ramsay" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Cookies have to be set before the block begins. > > -fjr > > Bob wrote: > > > here is the example: > > > > > // Beginning php > > > > // Saving the page header in the variable $head. > > $head = << > > > > > > > Feedback form > > > > > > > > Feedback form > > ENDH; > > // End of page header > > > > // Saving the page footer in the variable $tail. > > $tail = << > > > > > > > ENDT; > > // End of page footer > > > > // Set up variables that will be saved in the cookies > > // Define unique cookie prefix > > $ID = "My_ID"; > > // Cookie lifetime in seconds (in this example, three days) > > $cookie_life = 60; > > // Name of cookie that holds the user's name > > $n_name = $ID . "_Name"; > > // Name of cookie that holds the user's email > > $n_email = $ID . "_Email"; > > // Name of cookie that holds the user's last login > > $n_last = $ID . "_Last"; > > > > // These lines print the form with user input and mails to the > > webmaster. > > if( isset($sfeedback)) { > > Setcookie($n_last,Date("H:i d/m/Y"),time()+$cookie_life); > > print $head; > > ?> > > Thanks for your feedback, . Here is what you > > said: > > Name: > > Email: > > Feedback: > > > // Mails the feedback to the webmaster. > > $subject = "Feedback from your site"; > > $sendto = "[EMAIL PROTECTED]"; > > $header = "From: $email"; > > mail($sendto, $subject, $feedback, $header); > > print "Thank you. Your comments have been sent to the > > webmaster\n"; > > // Print end and leave > > print $tail; > > exit(); > > } > > > > // This loop treats users who have not been to the site before. > > if(!$$n_last) { > > if( ! isset($name)) { // if no name - display the form > > echo $head; > > ?> > > Welcome to our system! Please fill in the following information: > > > > > > Name: > > Email: > > > > > > > echo $tail; > > exit; > > } else { > > // Set cookies and continue > > Setcookie($n_name,$name,time()+$cookie_life); > > Setcookie($n_email,$email,time()+$cookie_life); > > $$n_name = $name; > > $$n_email = $email; > > } > > } > > > > // This loop treats repeat users. > > Setcookie($n_last,Date("H:i d/m/Y"),time()+$cookie_life); > > echo $head; > > ?> > > Welcome back to our system, . > > > // Have previous login > > if($$n_last) > > echo "Your last login was on " . $$n_last . "."; > > > > // User fills in feedback form > > ?> > > > > Name: > > Email: > > Feedback: > > > > > > > > > > > > > > > > > > > > Warning: Cannot add header information - headers already sent by > > (output started at C:\WebShare\wwwroot\last\cookie.php:59) in > > C:\WebShare\wwwroot\last\cookie.php on line 75 > > > > Warning: Cannot add header information - headers already sent by > > (output started at C:\WebShare\wwwroot\last\cookie.php:59) in > > C:\WebShare\wwwroot\last\cookie.php on line 76 > > > > Warning: Cannot add header information - headers already sent by > > (output started at C:\WebShare\wwwroot\last\cookie.php:59) in > > C:\WebShare\wwwroot\last\cookie.php on line 83 > > > > what' wrong? > > thanks! > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
Ben, I have that kind of problem before, but it whould be much better to use javascripts rather than the HTTP Header function when redirecting to cover over the frame page. Use this instead: echo"top.location.href=http://your.page.direction; "; I've already tried and using this kind of redirection and it just works fine with me. Hope this will help you. Regards, Mike - Original Message - From: "Ben Cheng" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 14, 2002 4:15 AM Subject: [PHP] Targetted redirection? > I have a page within a frame that uses Header() to redirect to another page. > However, I don't want the redirection to take place just within that frame > set. I want the page that it redirects to to cover over the frame. Is this > possible? > > -Ben > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mini CMS (content management system) (plase cc me, I'm on digest)
I'm trying to get all requests from a DOMAIN to go through one file, something like: http://www.mydomain.com/all_accesses.php They can come IN as http requests of: http://www.mydomain.com/any_directory/any_filename?any_vars with any POST or COOKIE vars. Anyone have any ideas? I'm trying to make this as DROP in as possible on a shared ISP, i.e. asking for as little help/sys mods as possible from the ISP. Zope can be run this way, but it's in Python, and I don't want to learn that now. The reason why .. is that: this allows me to keep the directory structure in the data base, keep very granular role based permissions on the directory structure, down to the file, and have a web based interface to upload/download content, with a powerful auth/perm system. The only files to get into the file system are binary ones, images, flash, that sort of stuff. I haven't quite figured out the permissions system for accessing those, yet. -- If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XSLT parsing causes "passed by reference" error
I get the error: Fatal error: Only variables can be passed by reference in /home/tanguay/test/testxslt.php on line 7 when I run this code: \n"; print "\n"; print $result; print "\n"; } else { print "Sorry, sample.xml could not be transformed by sample.xsl into"; print " the \$result variable the reason is that " . xslt_error($xh) . print " and the error code is " . xslt_errno($xh); } xslt_free($xh); ?> Can anyone tell me why? Is this a problem with the parser or some other problem. I am new to the XSLT functions. Thanks, Edward -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ICAP/ MCAL Calendaring
I am having a hard time finding recent mentions of using MCAL or ICAP with PHP. I need to add some shared calendaring to an project I am working on. I have been looking at MCAL and ICAP hoping to find out if they are viable. Is the best way to do calendaring in PHP to use a database or is there a better way (and is it MCAL or ICAP?)? Thanks, -Jackson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect?
You can do it by modifying the setting of your HTTP server. But if you want to do it by PHP, write header("Location; http://www.boo.com/v2";); in your PHP script of http://www.boo.com/index.php. Regards , Hiroshi Ayukawa http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Redirect?
Hi there, I have recently finished a redesign of a website which I have = put in the directory "v2". If I get someone going to http://www.boo.com is it possible to = automatically redirect it to http://www.boo.com/v2 and so on? Basically I need the basehref to be http://www.boo.com/v2 NOT = http://www.boo.com is this possible? Regards, Ian. DJ / Producer / Reviewer / Webdesigner, DancePortal (UK) Limited [EMAIL PROTECTED] - 07814 364277 (new number) Webmaster: http://www.randumian.co.uk Webmaster: http://www.randumiancharts.co.uk Webmaster: http://www.danceportal.co.uk Webmaster: http://www.vivienmarkey.com Webmaster: http://www.yamnd.org.uk Webdesigner: http://www.allstargambling.co.uk
[PHP] getting values from multiple select
Hi gang- I am working on a javascript box that will allow the user to drag values from one select box to another. I will use this box to set the values. This is a standard, multiple select box. On the next page I need to figure out what PHP is doing with the data coming in. If I send 5 fields to the next page PHP will show me one when I echo the variable to the page. If I try to split the varaiable I still get only one value in the echo. Tried to reponse.write it in asp and I get the string with comma seperate values. Help! Thanks, -Scott -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] finding and appending txt files on server
I'm adapting some ecard code for my site so that users can save the position of various objects within my flash movie. At the moment I create a random file name for the text file which is saved to my server. The user is sent an email saying to go to this.swf?theinfo=randomtextfile.txt. The info in the text file saves a string separated by commas of what objects are on the stage. No text or _x or _y positions are needed e.g - itemString=blue,red,square,triangle&contentLoaded=true This part works fine. What I do want to do though is create a gallery feature so what I believe I need to do is to append the info above into a textfile named total.txt or something. So that everytime a separate file is saved on to the server, it's info is added to this total file. Is this the way to go about it? Or is there a php function that can see what files are in the directory, open them and then use the info that way? I was told that a database is the way to go but I have no experience of these at all. Any help is appreciated. Gav -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Wed, Mar 13, 2002 at 03:52:42PM -0500, Erik Price wrote: > > On Wednesday, March 13, 2002, at 03:15 PM, Ben Cheng wrote: > > >However, I don't want the redirection to take place just within that > >frame > >set. I want the page that it redirects to to cover over the frame. Is > >this > >possible? > > Hm... I don't think that frames were ever intended to be manipulated at > the level of headers! Weird. This is the third time this question has been asked and answered in the past couple days... Put the following in before your header('Location: ...') call something along the lines of... header('Window-target: _top'); or... header('Window-target: _blank'); Does that do what you want? --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] banner ads
Hi, does anyone know of a simple banner ad rotation script that can rotate animated gifs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] --enable-xslt
On Wednesday, March 13, 2002, at 01:58 PM, Anas Mughal wrote: > http://www.devshed.com/Server_Side/XML/XSLTrans/print Actually, that's the very tutorial that led me to ask about installing with XSLT configure parameters. I'm building it now, as I write this. But I was wondering about some XSLT/PHP style advice... How much of a burden does on-the-fly XSLT place on the server? I mean, relative to a typical setup. I'm playing with the idea of changing all my old HTML to proper XML files, and having PHP generate XML rather than HTML (seems trivial, since PHP doesn't really care what markup language I use to output data -- I could even do it in plain text if I was so inclined). But as PHP generates the XML, there is another step now, and that is the step of running the XML data through one of the XSLT functions (such as xslt_create && xslt_run or xslt_process). I'm sure that it all depends on the strength of the server being used, but does anyone have a rough estimate of what kind of burden this extra processing has? Or a reference? Speed isn't the biggest concern, since I don't have a large number of users like some public sites. Mine is an internal site, run off a Linux server w/256MB RAM. But it seems like a lot of work for Apache to process the incoming request, hit up the PHP script, fetch data from MySQL, format the database output into XML, and then run the XML through XSLT to get HTML. And to answer the question "do you really need your data in XML?", the answer is no, but this kind of thing gives my boss something to brag about to visitors: "this is our temp, he's building our internal schedule-managing database-driven XML-based web application...we pay him little more than minimum wage and he gets no benefits, but he's happy with the work." Plus, it'll look good in the portfolio. Thanks in advance, Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] accessing data from classes
In <[EMAIL PROTECTED]>, Samuel Ottenhoff wrote: > It is good that you are looking into classes and functions. The > concept you are missing is that of "returning" a result. > > At the end of your function mysql_query, add a line: > > return $result; > > Then, when you call that function, make it like this: > > $resultArray = $TemplateTable->mysql_query("select "); > > Now you can pass $resultArray on to a different function. > > Sam > Alternatively, you can define a class variable where you will be storing the query results and then access that variable from outside. so, class foo { var $results; function bar($query) { while { $this->results[] = $row; } } } Then, from outside the class, you can access the variable. $bar = new foo(); $bar->bar("select foo..."); print($bar->results); etc... Jeff > > On 3/12/02 3:48 PM, "caspar kennerdale" <[EMAIL PROTECTED]> wrote: > >> I am just getting my head around classes, so forgive me if this is a >> schoolboy error! >> >> In order to learn I am re-writing my content management system and am >> in the process of writing an HTML.class and a MYSQL.class. >> >> so far so good. I spawn new instances of a table for example, sending >> parameter,and a table is output. >> >> now in my MYSQL.class- I want to send a query to my class which then >> returns an array- my database row or rows. >> >> the problem is that whilst my array is created- I only seem to be able >> to manipulate it within my MYSQL class. This is not satisfactory as I >> really want to be able to send it on to my HTML.class for formatting >> etc. >> >> I obvioulsy do not want to format any 'echoed' output from within my >> databasee class. >> >> Here is a bit of sample code- >> >> Once my database is open I call my query like this- >> >> $TemplateTable = new DB; >> $TemplateTable->mysql_query('SELECT * FROM template ORDER BY name ASC >> LIMIT 10'); >> >> This is the function within my MYSQL.class >> >> function mysql_query($query){ >> $a= 0; >> while($row=mysql_fetch_row($SQL)) { >> $new_row = join('***',$row); >> $result[] = $new_row; >> echo $result[$a].""; >> $a++; >> } >> } >> >> >> So here I am creating a string with each row in my database which is >> delimted by *** -> $new_row.and am placing each row in anew array >> called $result. >> >> I can evaluate and format either $new_row or $result from within >> mysql_query() but I really want to do is to send it on to another >> funtion or even better another class- or access the values glabbally as >> variables. >> >> Any ideas or am I missing something really obvious? >> >> Thanks in advance >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Targetted redirection?
Some browsers (IE I think) understand a "Window-target: targetname" header. I don't think it works very reliably nor do I remember exactly what versions, but if you search for "Window-target" you might find some more info. I'd go the javascript route if you can or find another solution... On Wed, 13 Mar 2002, Ben Cheng wrote: > I have a page within a frame that uses Header() to redirect to another page. > However, I don't want the redirection to take place just within that frame > set. I want the page that it redirects to to cover over the frame. Is this > possible? > > -Ben > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
If you were going to use javascript to do that, use _parent as the target -- that should reuse the window rather than making a new window. -Joe "Erik Price" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On Wednesday, March 13, 2002, at 03:15 PM, Ben Cheng wrote: > > > I have a page within a frame that uses Header() to redirect to another > > page. > > However, I don't want the redirection to take place just within that > > frame > > set. I want the page that it redirects to to cover over the frame. Is > > this > > possible? > > Hm... I don't think that frames were ever intended to be manipulated at > the level of headers! Otherwise you could use a "target" attribute or > something. If you're willing to use a bit of JavaScript, you might be > able to reference a new window or something like a target="_blank" and > THEN call the header() function from there... but that's more of a > workaround than a solution. > > Good luck, sorry I don't have any other ideas. > > > Erik > > > > > > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Wednesday, March 13, 2002, at 03:15 PM, Ben Cheng wrote: > I have a page within a frame that uses Header() to redirect to another > page. > However, I don't want the redirection to take place just within that > frame > set. I want the page that it redirects to to cover over the frame. Is > this > possible? Hm... I don't think that frames were ever intended to be manipulated at the level of headers! Otherwise you could use a "target" attribute or something. If you're willing to use a bit of JavaScript, you might be able to reference a new window or something like a target="_blank" and THEN call the header() function from there... but that's more of a workaround than a solution. Good luck, sorry I don't have any other ideas. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Own ErrorHandler but standard ErrorMsg
On Wed, 2002-03-13 at 11:06, Malte Hübner wrote: > Hi! > > I've got a little Problem with my ErrorHandler. > > set_error_handler('ErrorHandler'); is executed on top of my script. Right > after it the ErrorHandler function. > > After the ErrorHandler function there is a require('foo.php'); > > foo.php does not exist, so there should be an error message thrown out from > my ErrorHandler - but the error message which i get is the standard-php > error message. > > My ErrorHandler function works really fine and i only get the php-standard > error from not existing includes or requires. > Does anyone know how to solve this? > > error_reporting is set to 2039 in php.ini > > Thanks for helping! > > malte >From the manual (http://www.php.net/manual/en/function.require.php): require() and include() are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error. In other words, don't hesitate to use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless. Be sure to have an appropriate include_path setting as well. And since you can't catch Fatal errors, you can't do this. If you want to prevent the script from displaying this error, set display_errors = Off. If you want the script to not halt there, use include. Hope this helps, Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Targetted redirection?
I have a page within a frame that uses Header() to redirect to another page. However, I don't want the redirection to take place just within that frame set. I want the page that it redirects to to cover over the frame. Is this possible? -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Random number Question
In article <[EMAIL PROTECTED]>, Jennifer Downey wrote: > > > you've got the "Name" attribute attached to the wrong INPUT element: > if($guess = = $number) { > incorrect syntax here. that should be: if ($guess == $number) { better would be: if (trim($guess) == $number { this will assure that there's no whitespace in $guess -- Rgds Ralph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] Random Selecting from mySQL
are you just looking for a way to display 10 results per page? If yes then you can just use LIMIT to limit your result to 10 .. So, for the first page, you can do "SELECT LIMIT 1, 10;" and for the second page "SELECT ... LIMIT 11, 20" etc etc . You can sure use "ORDER BY" with "LIMIT" to to sort the results for a given criteria .. Gurhan -Original Message- From: Georgie Casey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 2:00 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Random Selecting from mySQL I know how to use the "ORDER BY rand()" command on the end of queries to randomize selection, but that's no good when you want to only display 10 results per page. The next page the user chooses, randomizes again and could show duplicate fields and not at all show other fields. Does anyone know a way round this? -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Own ErrorHandler but standard ErrorMsg
Hi! I've got a little Problem with my ErrorHandler. set_error_handler('ErrorHandler'); is executed on top of my script. Right after it the ErrorHandler function. After the ErrorHandler function there is a require('foo.php'); foo.php does not exist, so there should be an error message thrown out from my ErrorHandler - but the error message which i get is the standard-php error message. My ErrorHandler function works really fine and i only get the php-standard error from not existing includes or requires. Does anyone know how to solve this? error_reporting is set to 2039 in php.ini Thanks for helping! malte -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Random Selecting from mySQL
You could store the results in a session var to carry along the pages. Then on the second just retrieve them. Or maybe a second table with this info. Give each search an ID and store the results there. It would be easy to implement: INSERT INTO table ('',field) SELECT field FROM table ORDER BY rand() The first '' is for the autoincrement that will be used as your search id. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 "Georgie Casey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I know how to use the "ORDER BY rand()" command on the end of queries to > randomize selection, but that's no good when you want to only display 10 > results per page. The next page the user chooses, randomizes again and could > show duplicate fields and not at all show other fields. > > Does anyone know a way round this? > > -- > Regards, > Georgie Casey > [EMAIL PROTECTED] > > *** > http://www.filmfind.tv > Ireland's Online Film Production Directory > *** > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php setup questions
When the apache server goes to an error document, specifically, 404, do the post variables go with it? Could I 'vector' off of the 404 document and serve virtual pages out of the database? Also, what's the best way to execute php code that resides in a database? -- If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Random Selecting from mySQL
I know how to use the "ORDER BY rand()" command on the end of queries to randomize selection, but that's no good when you want to only display 10 results per page. The next page the user chooses, randomizes again and could show duplicate fields and not at all show other fields. Does anyone know a way round this? -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] --enable-xslt
http://www.devshed.com/Server_Side/XML/XSLTrans/print --- Erik Price <[EMAIL PROTECTED]> wrote: > A few days ago I upgraded to 4.1.2 on my RH 7.2 > server. > > I used --enable-xslt and --with-sablot in my > configure parameters > because I thought it would be fun to learn more > about XSLT with PHP. > But there were problems (I don't have the actual > error message, and > would like to avoid re-configuring to reproduce it > if possible), and I > needed to drop both of these parameters to the > configure script. > > I was thinking of recompiling with these parameters, > and was wondering > if anyone on this list knows what is required to do > this -- do I need to > install a program called Sablotron first? It seems > like it. > > If anyone has a resource or somewhere I should be > looking, please by all > means point me in the right direction. > > > Erik > > > > > > > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > = Anas Mughal [EMAIL PROTECTED] [EMAIL PROTECTED] Tel: 973-249-6665 __ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re: passing inputs
> echo ''; First of all, $_POST will only work in PHP 4.1.x so make sure you are running a recent version. And second, I bet you mean $_POST['inp'] there. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP based search engine
I've gone to the mnoGoSearch page - it does look like it would do the job nicely, however my hosting company absolutely refuses to upgrade to anything above PHP 3.0.16, also it appears as though I'd have to compile a good portion of mnoGoSearch on the server itself - another thing I'm not allowed to do. I think I've got the Fluid Dynamics search engine working fairly well now - its not perfect, but it'll do until I can come up with something better. Thanks -Tim At 11:39 AM 3/13/2002 +0100, you wrote: >David Robley wrote: >>PHP from around 4.05 has functions available to interface with the >>mnoGOSearch search engine, available from http://www.mnogosearch.ru/ >>I recommend you look at this combination. > >I recommend this one to, its a very good alternative which I used for >several projects. > >The nice thing is that you can easily update and keep the index updated by >yourself, no need for that stupid indexer that comes along to crawl around >your site. > >I have a small script which inserts new keywords/descriptions/titles >directly in the index on update of something that should be searchable. >This is probably easiest to do when you're using a database as a backend >for the search. > >Another soloution is to have a hourly cronscript that updates the index. I >have used that on bookmarks.egp.cx . Since I have a modification >timestamp on each link there I only need to update those who where changed >since the last indexinground. Often there are no links modified in the >last hour, so its not very resourcehungry, but that depends on the data >off course. :) > >Just my ideas. :) > >Good luck! > Eric > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Credit Card Processing
I was just wondering what people thought was the best credit card processing place. I've been looking at Authorize.net and PayFlow Pro and I was just wondering if people had any experience with them and had any thoughts on which one was easiest to work with and which one worked best. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to access arrays from $GLOBAL?
> -Original Message- > From: Richard Davey [mailto:[EMAIL PROTECTED]] > Sent: 13 March 2002 17:12 > > "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I don't understand why you think it is illogical. How else > would you > > dereference a multi-dimensional array? > > Because in my mind (which I know is totally wrong in this > instance, I'm just > explaining for your benefit) using: > > $GLOBALS['mtxt'][1]; > > is like saying "give me element 1 of the globals array" when > I was thinking > "but I want element 1 of the mtxt array" But $GLOBALS['mtxt'] *is* the mtxt array -- so logically element 1 of it can only be $GLOBALS['mtxt'][1]. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Comparing two dynamic dates
> -Original Message- > From: Erick [mailto:[EMAIL PROTECTED]] > Sent: 12 March 2002 01:47 > > > I've been working on this for a little while now, without success. I > want to compare the current date to a certain recurring date (ie: > compare todays date to the date of the second Sunday of the a certain > month). I have an event that happens on the second Sunday of > each month, > and I want to show the next date on which the event occurs, > without just > listing the next few months. Can anyone help? Amazingly, I believe the following will do the trick: $second_sun_next_month = strtotime('2sunday', strtotime('+month 1 '.date('F'))); Or, breaking it down into understandable chunks: $this_month = date('F'); // 'March', as I write this! $first_of_next_month = strtotime("+month 1 ${this_month}"); // interpreted by strtotime as "one month after the 1st of this month" -- i.e. 1st April // returned value is a UNIX timestamp $second_sun_next_month = strtotime('2sunday', $first_of_next_month); // returns date of second Sunday counting from 1st of next month. strtotime is actually quite a powerful beast, especially in its range of "relative" dates -- go to http://uk.php.net/manual/en/function.strtotime.php and follow the "Date Input Formats" link to get the full picture. HTH Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: passing inputs
THANKS TO ERIK PRICE ! You ablility to explain php concepts in simple langauge is exactly why I signed up for this list! I will be deeply greatful for any other tutorials like this one on passing imputs. THANKS AGAIN, Jim Long >Erik Price wrote: > John, > > It seems that you're using two different conventions here. This is > inconsistent, and confusing to me (at least, and possibly others trying > to help you). Let me show you what I am talking about: > Please don't be insulted if I make an assumption about what you know > about the use of variables within scripts, I'm going to do my best to > explain this and I can't know how much you know or don't. Here's how it > works: > On a script, you have access to any variable that you create within that > script. Thus, if you create a variable named "$inp", you can then echo > that variable or manipulate it in any way. Like this: > > $inp = "blue"; // this assigns the string "blue" to the $inp variable > echo $inp; // this echoes "blue" > $outp = "green"; // this assigns "green" (a string) to the $outp > variable > $outp . $inp; // this combines ("concatenates") the two variables > together > // and results in the string "greenblue" > > Okay, you probably already know all of that. But my point is that these > variables are accessible to this particular script. NOT TO OTHER > SCRIPTS. If you need a variable to be accessible to another script, you > must "pass" the variable along. There are a few ways to do this: > > etc..etc..etc.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] --enable-xslt
A few days ago I upgraded to 4.1.2 on my RH 7.2 server. I used --enable-xslt and --with-sablot in my configure parameters because I thought it would be fun to learn more about XSLT with PHP. But there were problems (I don't have the actual error message, and would like to avoid re-configuring to reproduce it if possible), and I needed to drop both of these parameters to the configure script. I was thinking of recompiling with these parameters, and was wondering if anyone on this list knows what is required to do this -- do I need to install a program called Sablotron first? It seems like it. If anyone has a resource or somewhere I should be looking, please by all means point me in the right direction. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to access arrays from $GLOBAL?
to add that $GLOBALS has reference to itself but when used in non-function context. Try and Regards, Andrey Hristov - Original Message - From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Hunter, Ray" <[EMAIL PROTECTED]> Cc: "Richard Davey" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, March 13, 2002 7:09 PM Subject: RE: [PHP] How to access arrays from $GLOBAL? > I am not sure there is any. $GLOBALS is simply an array that contains > individual references to each global variable. > > For example: > > $a = 1; > $GLOBALS['a'] = 2; > echo $a; > > gives you 2 > > The best documentation is probably the basic explanation of how references > work. http://php.net/references > > -Rasmus > > On Wed, 13 Mar 2002, Hunter, Ray wrote: > > > Where is some good documentation on how $GLOBALS works and what is really > > going on in the background? > > > > > > Thank you, > > > > Ray Hunter > > Firmware Engineer > > > > ENTERASYS NETWORKS > > > > > > -Original Message- > > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 13, 2002 9:53 AM > > To: Richard Davey > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] How to access arrays from $GLOBAL? > > > > > > I don't understand why you think it is illogical. How else would you > > dereference a multi-dimensional array? > > > > On Wed, 13 Mar 2002, Richard Davey wrote: > > > > > "Mike Ford" <[EMAIL PROTECTED]> wrote in message > > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]. > > > .. > > > > $GLOBALS['mtxt'][1] > > > > > > Fantastic :) > > > > > > That's totally illogical but it works a treat. > > > PHP has some weird syntax rules sometimes! > > > > > > Cheers, > > > > > > Rich > > > -- > > > Fatal Design > > > http://www.fatal-design.com > > > Atari / DarkBASIC / Coding / Since 1995 > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to access arrays from $GLOBAL?
I am not sure there is any. $GLOBALS is simply an array that contains individual references to each global variable. For example: $a = 1; $GLOBALS['a'] = 2; echo $a; gives you 2 The best documentation is probably the basic explanation of how references work. http://php.net/references -Rasmus On Wed, 13 Mar 2002, Hunter, Ray wrote: > Where is some good documentation on how $GLOBALS works and what is really > going on in the background? > > > Thank you, > > Ray Hunter > Firmware Engineer > > ENTERASYS NETWORKS > > > -Original Message- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 13, 2002 9:53 AM > To: Richard Davey > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] How to access arrays from $GLOBAL? > > > I don't understand why you think it is illogical. How else would you > dereference a multi-dimensional array? > > On Wed, 13 Mar 2002, Richard Davey wrote: > > > "Mike Ford" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]. > > .. > > > $GLOBALS['mtxt'][1] > > > > Fantastic :) > > > > That's totally illogical but it works a treat. > > PHP has some weird syntax rules sometimes! > > > > Cheers, > > > > Rich > > -- > > Fatal Design > > http://www.fatal-design.com > > Atari / DarkBASIC / Coding / Since 1995 > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to access arrays from $GLOBAL?
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I don't understand why you think it is illogical. How else would you > dereference a multi-dimensional array? Because in my mind (which I know is totally wrong in this instance, I'm just explaining for your benefit) using: $GLOBALS['mtxt'][1]; is like saying "give me element 1 of the globals array" when I was thinking "but I want element 1 of the mtxt array" which is why I tried the various combinations of mtxt[1] _inside_ of the globals[]. Hope that explains a little. Cheers, Richard -- Fatal Design http://www.fatal-design.com Atari / DarkBASIC / Coding / Since 1995 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to access arrays from $GLOBAL?
Sources. Andrey - Original Message - From: "Hunter, Ray" <[EMAIL PROTECTED]> To: "'Rasmus Lerdorf'" <[EMAIL PROTECTED]>; "Richard Davey" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, March 13, 2002 6:59 PM Subject: RE: [PHP] How to access arrays from $GLOBAL? > Where is some good documentation on how $GLOBALS works and what is really > going on in the background? > > > Thank you, > > Ray Hunter > Firmware Engineer > > ENTERASYS NETWORKS > > > -Original Message- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 13, 2002 9:53 AM > To: Richard Davey > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] How to access arrays from $GLOBAL? > > > I don't understand why you think it is illogical. How else would you > dereference a multi-dimensional array? > > On Wed, 13 Mar 2002, Richard Davey wrote: > > > "Mike Ford" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]. > > .. > > > $GLOBALS['mtxt'][1] > > > > Fantastic :) > > > > That's totally illogical but it works a treat. > > PHP has some weird syntax rules sometimes! > > > > Cheers, > > > > Rich > > -- > > Fatal Design > > http://www.fatal-design.com > > Atari / DarkBASIC / Coding / Since 1995 > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Renaming files after a name in the db field
On Wed, Mar 13, 2002 at 01:45:21PM +0100, Andy wrote: > > How could I generate a php script which scannes the dir for matching > Countrycode patterns and renames the filename ? > E.g.: Make out of CA-map.gif -> canada-map.gif? First, make an array of countries codes and names (see below for one I created for you). Second, loop through each file in the directory. Third, do a preg_replace() which grabs the existing country code out of the name and replaces it with the value of the corresponding array. Fourth, rename the file with the new name. Untested example of the Third step (assuming the array has already been created before going into the while loop of the directory listing): $New = preg_replace('/^(\w\w)(-map\.gif)$/i', "$Countries[\\1]\\2", $FileName); The array with Country Codes as the key and the Country Name as the value (put this before the other steps): $Countries['AF'] = 'Afghanistan'; $Countries['AL'] = 'Albania'; $Countries['DZ'] = 'Algeria'; $Countries['AS'] = 'American Samoa'; $Countries['AD'] = 'Andorra'; $Countries['AO'] = 'Angola'; $Countries['AI'] = 'Anguilla'; $Countries['AQ'] = 'Antarctica'; $Countries['AG'] = 'Antigua and Barbuda'; $Countries['AR'] = 'Argentina'; $Countries['AM'] = 'Armenia'; $Countries['AW'] = 'Aruba'; $Countries['AU'] = 'Australia'; $Countries['AT'] = 'Austria'; $Countries['AZ'] = 'Azerbaijan'; $Countries['BS'] = 'Bahamas'; $Countries['BH'] = 'Bahrain'; $Countries['BD'] = 'Bangladesh'; $Countries['BB'] = 'Barbados'; $Countries['BY'] = 'Belarus'; $Countries['BE'] = 'Belgium'; $Countries['BZ'] = 'Belize'; $Countries['BJ'] = 'Benin'; $Countries['BM'] = 'Bermuda'; $Countries['BT'] = 'Bhutan'; $Countries['BO'] = 'Bolivia'; $Countries['BA'] = 'Bosnia and Herzegovina'; $Countries['BW'] = 'Botswana'; $Countries['BV'] = 'Bouvet Island'; $Countries['BR'] = 'Brazil'; $Countries['IO'] = 'British Indian Ocean Territory'; $Countries['BN'] = 'Brunei'; $Countries['BG'] = 'Bulgaria'; $Countries['BF'] = 'Burkina Faso'; $Countries['BI'] = 'Burundi'; $Countries['KH'] = 'Cambodia'; $Countries['CM'] = 'Cameroon'; $Countries['CA'] = 'Canada'; $Countries['CV'] = 'Cape Verde'; $Countries['KY'] = 'Cayman Islands'; $Countries['CF'] = 'Central African Republic'; $Countries['TD'] = 'Chad'; $Countries['CL'] = 'Chile'; $Countries['CN'] = 'China'; $Countries['CX'] = 'Christmas Island'; $Countries['CC'] = 'Cocos (Keeling) Islands'; $Countries['CO'] = 'Colombia'; $Countries['KM'] = 'Comoros'; $Countries['ZR'] = 'Congo, Democratic Republic of the'; $Countries['CG'] = 'Congo, Republic of the'; $Countries['CK'] = 'Cook Islands'; $Countries['CR'] = 'Costa Rica'; $Countries['CI'] = 'Cote dIvoire'; $Countries['HR'] = 'Croatia'; $Countries['CU'] = 'Cuba'; $Countries['CY'] = 'Cyprus'; $Countries['CZ'] = 'Czech Republic'; $Countries['DK'] = 'Denmark'; $Countries['DJ'] = 'Djibouti'; $Countries['DM'] = 'Dominica'; $Countries['DO'] = 'Dominican Republic'; $Countries['TP'] = 'East Timor'; $Countries['EC'] = 'Ecuador'; $Countries['EG'] = 'Egypt'; $Countries['SV'] = 'El Salvador'; $Countries['GQ'] = 'Equatorial Guinea'; $Countries['ER'] = 'Eritrea'; $Countries['EE'] = 'Estonia'; $Countries['ET'] = 'Ethiopia'; $Countries['FK'] = 'Falkland Islands (Islas Malvinas)'; $Countries['FO'] = 'Faroe Islands'; $Countries['FJ'] = 'Fiji'; $Countries['FI'] = 'Finland'; $Countries['FR'] = 'France'; $Countries['GF'] = 'French Guiana'; $Countries['PF'] = 'French Polynesia'; $Countries['TF'] = 'French Southern and Antarctic Lands'; $Countries['GA'] = 'Gabon'; $Countries['GM'] = 'Gambia'; $Countries['GE'] = 'Georgia'; $Countries['DE'] = 'Germany'; $Countries['GH'] = 'Ghana'; $Countries['GI'] = 'Gibraltar'; $Countries['GR'] = 'Greece'; $Countries['GL'] = 'Greenland'; $Countries['GD'] = 'Grenada'; $Countries['GP'] = 'Guadeloupe'; $Countries['GU'] = 'Guam'; $Countries['GT'] = 'Guatemala'; $Countries['GN'] = 'Guinea'; $Countries['GW'] = 'Guinea-Bissau'; $Countries['GY'] = 'Guyana'; $Countries['HT'] = 'Haiti'; $Countries['HM'] = 'Heard Island and McDonald Islands'; $Countries['VA'] = 'Holy See (Vatican City)'; $Countries['HN'] = 'Honduras'; $Countries['HK'] = 'Hong Kong'; $Countries['HU'] = 'Hungary'; $Countries['IS'] = 'Iceland'; $Countries['IN'] = 'India'; $Countries['ID'] = 'Indonesia'; $Countries['IR'] = 'Iran'; $Countries['IQ'] = 'Iraq'; $Countries['IE'] = 'Ireland'; $Countries['IL'] = 'Israel'; $Countries['IT'] = 'Italy'; $Countries['JM'] = 'Jamaica'; $Countries['JP'] = 'Japan'; $Countries['JO'] = 'Jordan'; $Countries['KZ'] = 'Kazakhstan'; $Countries['KE'] = 'Kenya'; $Countries['KI'] = 'Kiribati'; $Countries['KP'] = 'Korea, North'; $Countries['KR'] = 'Korea, South'; $Countries['KW'] = 'Kuwait'; $Countries['KG'] = 'Kyrgyzstan'; $Countries['LA'] = 'Laos'; $Countries['LV'] = 'Latvia'; $Countries['LB'] = 'Lebanon'; $Countries['LS'] = 'Lesotho'; $Countries['LR'] = 'Liberia'; $Countries['LY'] = 'Libya'; $Countries['LI'] = 'Liechtenstein'; $Countries['LT'] = 'Lithuania'; $Countries['LU'] = 'Luxembourg'; $C
RE: [PHP] How to access arrays from $GLOBAL?
Where is some good documentation on how $GLOBALS works and what is really going on in the background? Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 9:53 AM To: Richard Davey Cc: [EMAIL PROTECTED] Subject: Re: [PHP] How to access arrays from $GLOBAL? I don't understand why you think it is illogical. How else would you dereference a multi-dimensional array? On Wed, 13 Mar 2002, Richard Davey wrote: > "Mike Ford" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]. > .. > > $GLOBALS['mtxt'][1] > > Fantastic :) > > That's totally illogical but it works a treat. > PHP has some weird syntax rules sometimes! > > Cheers, > > Rich > -- > Fatal Design > http://www.fatal-design.com > Atari / DarkBASIC / Coding / Since 1995 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to access arrays from $GLOBAL?
IMO it is not weird. Think about $GLOBALS['mtxt'] as a pointer to array(it is not but this is a good example). $GLOBALS is a hash list. So it has sub elements - zvals (internal _zend_value ). Every from these zvals can hold zvals. In C the syntax is arFooBar[1][2], not arFooBar[[1][2]] I am not nagging(not sure for the word) at you. Best regards, Andrey Hristov - Original Message - From: "Richard Davey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 13, 2002 6:52 PM Subject: Re: [PHP] How to access arrays from $GLOBAL? > "Mike Ford" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > $GLOBALS['mtxt'][1] > > Fantastic :) > > That's totally illogical but it works a treat. > PHP has some weird syntax rules sometimes! > > Cheers, > > Rich > -- > Fatal Design > http://www.fatal-design.com > Atari / DarkBASIC / Coding / Since 1995 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to access arrays from $GLOBAL?
I don't understand why you think it is illogical. How else would you dereference a multi-dimensional array? On Wed, 13 Mar 2002, Richard Davey wrote: > "Mike Ford" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > $GLOBALS['mtxt'][1] > > Fantastic :) > > That's totally illogical but it works a treat. > PHP has some weird syntax rules sometimes! > > Cheers, > > Rich > -- > Fatal Design > http://www.fatal-design.com > Atari / DarkBASIC / Coding / Since 1995 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to access arrays from $GLOBAL?
"Mike Ford" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > $GLOBALS['mtxt'][1] Fantastic :) That's totally illogical but it works a treat. PHP has some weird syntax rules sometimes! Cheers, Rich -- Fatal Design http://www.fatal-design.com Atari / DarkBASIC / Coding / Since 1995 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to access arrays from $GLOBAL?
> -Original Message- > From: Richard Davey [mailto:[EMAIL PROTECTED]] > Sent: 13 March 2002 16:02 > > I have a global array $mtxt that is created in my script. > I have a function from which I want to access a value from that array: > > $mtxt[1] = "Test"; > $text = $GLOBALS['mtxt[1]']; > > Except that gives me the Warning "Undefined index"; > > I can use $GLOBALS['mtxt'] to access a global variable > without an error, > just not a specific element of a global array. > Does anyone know the correct syntax for this? $GLOBALS['mtxt'][1] Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opening new browser window.
> Is there anyway that I can open a new browser window in php, like you > are > able to do in JavaScript (window.open()). I have had a look around and > can't > find any information on how this can be done. PHP can't control browser objects like windows. You have to use JavaScript for stuff like that, or you could use the frames properties of HTML like this: Click Here Essentially, you're having the new file open up in a new frame, but instead of the frame being defined in the current window, it's in a new window. Not really JavaScript, but same effect. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] register_globals and E_ALL error reporting
> -Original Message- > From: Richard Ellerbrock [mailto:[EMAIL PROTECTED]] > Sent: 13 March 2002 14:25 > > The following code generates a warning when register_globals=off and > error reporting is set to E_ALL. How do I define the constant > in another > way not to generate a warning? This is with php 4.1.1. I use defines > extensively throughout my code and it is making my debugging difficult > through the transition to register_global=off code. > > > define(DBF_HOST, "localhost"); > > echo DBF_HOST; > > ?> > > Warning: Use of undefined constant DBF_HOST - assumed 'DBF_HOST' in > var/www/html/iptrackdev/test.php on line 3 localhost That has nothing to do with register_globals! You're getting the error because you have error_reporting set to E_ALL. The error is that both arguments to define should be strings, thus: define('DBF_HOST', 'localhost'); The way you have it, the naked DBF_HOST looks like a reference to a constant, but when PHP looks it up it can't find it because it hasn't been defined yet because the define contains a reference to the constant DBF_HOST which hasn't been defined yet so when PHP looks it up it can't find it because... oh, well, you get the idea! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Opening new browser window.
embed the javascript within the php using echo or print -Original Message- From: Way, Paul [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 16:26 To: '[EMAIL PROTECTED]' Subject: [PHP] Opening new browser window. Is there anyway that I can open a new browser window in php, like you are able to do in JavaScript (window.open()). I have had a look around and can't find any information on how this can be done. Many thanks. PW.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Opening new browser window.
Is there anyway that I can open a new browser window in php, like you are able to do in JavaScript (window.open()). I have had a look around and can't find any information on how this can be done. Many thanks. PW.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re: passing values
On Wednesday 13 March 2002 23:37, John Gurley wrote: > Thanks everyone for the help. Finally got it working using this: > > > echo ' echo '>'; > > ?> > > Don't hhave a clue why this worked and the others didn't?!?!? This isn't working correctly. The fact that it 'works' is just a fluke. I asked many posts earlier what version of PHP you was using, I don't seem to have gotten an answer. But your subsequent posts seems to suggest that you're using php < 4.1.1 and hence why $_POST['inp'] does not work. php <= 4.0.6 used $HTTP_POST_VARS[] to hold the values which are the result of a POST. With php >= 4.1.1 $HTTP_POST_VARS[] has become $_POST[]. So if my assumption is correct in that you're using php < 4.1.1 then echo ("$_POST '$inp'"); is in fact equivalent to: echo (" '$inp'"); ## because $_POST is most likely undefined That is why it seems to work, but you're getting an extra space and single quotes around your value. To really get it working, you should probably use: echo ("$HTTP_POST_VARS[inp]"); -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* To the landlord belongs the doorknobs. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] registering $_REQUEST variables as session variables.
> -Original Message- > From: Gonzalez, Zara E [mailto:[EMAIL PROTECTED]] > Sent: 11 March 2002 17:54 > > I was just wondering if anyone knew an easy way to register > all $_REQUEST > variables as session variables. I haven't seen this solution on the list, but what about: foreach ($_REQUEST as $key=>$val): $_SESSION[$key] = $val; endforeach; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array
> -Original Message- > From: Roman Duriancik [mailto:[EMAIL PROTECTED]] > Sent: 13 March 2002 08:40 > > I have one small problem. I have array e.g $array but I don't know > how to finding arguments and values of this array. > > e.g > > $array["aa"] = 1; > $array["ab"] = "some"; > ... > > and script send me : > > arguments aa : values 1 > arguments bb : values some foreach ($array as $arg=>$val): echo "arguments $arg : values $val\n"; endforeach; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to access arrays from $GLOBAL?
Hi all, I have a global array $mtxt that is created in my script. I have a function from which I want to access a value from that array: $mtxt[1] = "Test"; $text = $GLOBALS['mtxt[1]']; Except that gives me the Warning "Undefined index"; I can use $GLOBALS['mtxt'] to access a global variable without an error, just not a specific element of a global array. Does anyone know the correct syntax for this? I have tried: $text = $GLOBALS["mtxt[1]"]; $text = $GLOBALS["{mtxt[1]}"]; But both fail too. Cheers, Richard -- Fatal Design http://www.fatal-design.com Atari / DarkBASIC / Coding / Since 1995 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions & concurrency
Hi If I set up a session while generating a page, and I store some data in it, when does that data become available for other connections from the same user (same session)? I.e. If I have a complex page with some session data that is used to dynamically generate some of the images in the page, it is conceivably possible that the browser could receive the HTML and IMG tags for the images before the page itself finishes building. I'm thinking that the session data probably isnt written until the PHP script exits, and that there probably isnt any locking. Is this the case? I imagine that if this is true I could write my own session save/load handlers to install with session_set_save_handler() and handle locking/concurrency issues - if so would these work if written in C as a php extension? Any info appreciated, Thanks -- Shane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re: passing inputs
John, It seems that you're using two different conventions here. This is inconsistent, and confusing to me (at least, and possibly others trying to help you). Let me show you what I am talking about: On Wednesday, March 13, 2002, at 09:20 AM, John Gurley wrote: > Sorry, > Didn't mean to keep everyone in the dark here is the code: ... snip ... > > > echo $inp; > ?> Okay, see above? You've used "$inp". Now read on to another part of your code: > echo $inp; > echo ' "'.$_POST['$inp'].'">'; > ?> Okay, now here, you're echoing "$inp" again, but then in the second echo statement you are echoing "$_POST['$inp']" Please don't be insulted if I make an assumption about what you know about the use of variables within scripts, I'm going to do my best to explain this and I can't know how much you know or don't. Here's how it works: On a script, you have access to any variable that you create within that script. Thus, if you create a variable named "$inp", you can then echo that variable or manipulate it in any way. Like this: $inp = "blue"; // this assigns the string "blue" to the $inp variable echo $inp; // this echoes "blue" $outp = "green"; // this assigns "green" (a string) to the $outp variable $outp . $inp; // this combines ("concatenates") the two variables together // and results in the string "greenblue" Okay, you probably already know all of that. But my point is that these variables are accessible to this particular script. NOT TO OTHER SCRIPTS. If you need a variable to be accessible to another script, you must "pass" the variable along. There are a few ways to do this: 1) You can make the value of this variable a form field value, like this: echo ""; (or this way, with single quotes:) echo ''; note that in the above example, I have jumped out of the string being echoed and concatenated the $inp variable to the string, then concatenated the last part of the string ('" />'). This is because within single-quotes, variables won't expand -- the buck ($) is treated as a literal buck, not a variable marker. 2) You can put the variable name and value into the querystring of a hyperlink, like this: echo "Next"; (or this way, with single quotes:) echo 'Next'; see how I've again jumped out of the singlequoted string and concatenated the variable? Same reason -- variables don't expand within singlequoted strings (though they do within doublequoted strings). 3) You can put the variable's value into a session variable. How you do this depends on which version of PHP you are using. You can learn more about session variables later, it's easy but you should get the hidden form field technique or querystring technique down first. These are ways you can pass variables to other scripts. Ignore the session bit if you haven't yet learned sessions. So in your example, you are echoing the value of $inp. But I don't see where you've done the ASSIGNMENT of any value to $inp. For this reason, you will simply get an empty string: echo $inp; // this results in nothing echo "; // this results in '' If you had passed the $inp variable from a previous script to this one, then you would use either $_GET['inp'] or $_POST['inp'] to access the variable, assuming you have register_globals turned off in your php.ini (if you don't then don't worry about this). echo $_POST['inp']; // if the form from the previous script was 'method="post"' echo $_GET['inp']; // if the form from the previous script was 'method="get"' But if you do this: echo $_POST['$inp']; Then nothing will happen because the $inp part is between single quotes, and single quotes don't expand variables -- the buck is treated as part of the variable name (when it's not, it's supposed to be an indicator). Even this: echo $_POST["$inp"]; probably won't do what you want, because what will happen is the variable $inp (inside of the brackets) will evaluate first, and then whatever that evaluates to will become the name within $_POST[' and']. Unless you have defined "$inp" somewhere, that's just a mistake. Don't use the $ symbol within $_POST or $_GET variables until you have a reason to do so. So, in your script, you've called the "inp" variable both $inp and $_POST['$inp']. You probably really only want to use one or the other -- use the first one if register_globals is turned on, and the second one if register_globals is turned off. But remember, this trick is used only for accessing variables that have been passed to this script from another script, not for accessing variables that have been defined within this script. This may have been overly explanatory and confusing, but if you have a question about it, ask us. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: passing values
Thanks everyone for the help. Finally got it working using this: '; ?> Don't hhave a clue why this worked and the others didn't?!?!? thanks John _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and Pay Flow Pro
Thanks, great place to start. Has anyone else done this stuff? Seems like a big pain in the butt. -Mike > > The php.net site > (http://www.php.net/manual/en/ref.pfpro.php) has all the > information you'll need to implement Payflow Pro. Check out > the User Contributed Notes. > > __ > Mike Krisher > Technical Director > > hyperQUAKE > 312 West 4th Street > Cincinnati, OH 45202 > Tel: 513.563.6555 > Cel: 513.254.7821 > > AOLIM: twopeoplecom > ICQ: 83891383 > MSN: [EMAIL PROTECTED] > Yahoo: mike_krisher > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include() & .htaccess
> -Original Message- > From: Patrick Teague [mailto:[EMAIL PROTECTED]] > Sent: 13 March 2002 10:48 > > > I'm having problems with .htaccess files setting up the php_value > include_dir on both my development & test servers. I'm using > php4 under > apache on win2k for development & php4 under apache on unix as a test > server. I've currently done the following on the win server > > > php_value include_dir ".;C:/home/plugged/common/" > > > & done the following on the unix server > > > php_value include_dir ".:/home/plugged/common/" > > > neither works... am I doing something wrong here or am I forgetting > something? Uh, well, including the name of the Directory you want it to apply to might be nice: just because the .htaccess file is in a particular directory doesn't mean that's used as the default -- you still have to specify it in full in the tag. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php