[PHP] Help with COM objects in PHP
I have included my code below. This is my first experience trying to use COM objects in PHP. My problem is that the foreach loop does not output anything, regardless of whether or not there are files in the folder. Can anyone tell me what is wrong with my script? Thanks for any help. Kyle FolderExists($objPath)) { print "folder exists"; $objFolder = $objFileManager->GetFolder($objPath); $objFolder->Path; $fileCollection = $objFolder->Files; foreach ( $fileCollection as $file ){ print $file->Path; } } else print "doesnt exist"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Warning: mail() is not supported in this PHP build
Warning: mail() is not supported in this PHP build in testmail.php on line 1 I don't remember disabling it when I compiled, and I can't find anything to specifically enable it when compiling. I'm running PHP 4.0.6. My sendmail_path is correct in my php.ini. I tried recompiling php4 and apache but it seems that it isn't overwriting the php modules. What files are used? I tried deleting the /src/modules/php4 folder. Any help would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Warning: mail() is not supported in this PHP build
Somebody mentioned that PHP checks to see if sendmail was installed when it was installing. Just I have another question, does anyone know where PHP puts everything when it installs? I keep recompiling PHP and Apache, and every time I run phpinfo() it still has the original build date. I tried deleting: /usr/local/lib/php /usr/local/include/php /src/modules/php4/ - Kyle "Kyle" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Warning: mail() is not supported in this PHP build in testmail.php on line 1 > > I don't remember disabling it when I compiled, and I can't find anything to > specifically enable it when compiling. I'm running PHP 4.0.6. My > sendmail_path is correct in my php.ini. > > I tried recompiling php4 and apache but it seems that it isn't overwriting > the php modules. What files are used? I tried deleting the src>/src/modules/php4 folder. > > Any help would be greatly appreciated. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Warning: mail() is not supported in this PHP build
Tried both of those. Tommorrow I'll try to redownload the source to another directory and install. "Kyle" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Somebody mentioned that PHP checks to see if sendmail was installed when it > was installing. > > Just I have another question, does anyone know where PHP puts everything > when it installs? I keep recompiling PHP and Apache, and every time I run > phpinfo() it still has the original build date. I tried deleting: > > /usr/local/lib/php > > /usr/local/include/php > > /src/modules/php4/ > > - Kyle > > "Kyle" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Warning: mail() is not supported in this PHP build in testmail.php on line > 1 > > > > I don't remember disabling it when I compiled, and I can't find anything > to > > specifically enable it when compiling. I'm running PHP 4.0.6. My > > sendmail_path is correct in my php.ini. > > > > I tried recompiling php4 and apache but it seems that it isn't overwriting > > the php modules. What files are used? I tried deleting the > src>/src/modules/php4 folder. > > > > Any help would be greatly appreciated. > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Execute mixed php code from mysql?
For example I have in a database: - In database: welcome -- Also in Database: --- Now how could i make it so that I have another page that has the following: index.php - Jump out and have some html content -- end page -- For some reason it converts the tags on the php code as it pulls it out, i figure echo isn't the right function to do this and echo is converting the 'http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] file locking over NFS?
Hi all, Is there any simple, safe, and efficiency way to do file locking over NFS? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file locking over NFS?
Thanks a lot , your information is really useful for me. "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > kyle wrote: > > Hi all, > > > > Is there any simple, safe, and efficiency way to do file locking over NFS? > > > > Thanks. > > > > You can mysql locks (maybe it works in other databases too): > > GET_LOCK(str,timeout); > RELEASE_LOCK(str); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file locking over NFS?
I found this from php function list manual: "flock() will not work on NFS and many other networked file systems. Check your operating system documentation for more details." I wish flock can do NFS file locking, but offical manual says no to "Brent Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi there > > If i am not mistaken, that is a standard part of the nfs suite. > All you need to make sure is that your export is correct, and the you are > not using the > -nolock option. > Other than that if its PHP you more interested in, look at the flock() > function. > > Kind Regards > Brent Clark > > -Original Message- > From: kyle [mailto:[EMAIL PROTECTED] > Sent: Monday, July 05, 2004 6:54 PM > To: [EMAIL PROTECTED] > Subject: [PHP] file locking over NFS? > > > Hi all, > > Is there any simple, safe, and efficiency way to do file locking over NFS? > > Thanks. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file locking over NFS?
Hi Manuel, Do you mean I can just use flock over NFS ? "Manuel Lemos" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > On 07/06/2004 05:25 AM, Kyle wrote: > > I found this from php function list manual: > > "flock() will not work on NFS and many other networked file systems. Check > > your operating system documentation for more details." > > > > I wish flock can do NFS file locking, but offical manual says no to > > This is not accurate. There NFS systems that were meant to support locking. > > -- > > Regards, > Manuel Lemos > > PHP Classes - Free ready to use OOP components written in PHP > http://www.phpclasses.org/ > > PHP Reviews - Reviews of PHP books and other products > http://www.phpclasses.org/reviews/ > > Metastorage - Data object relational mapping layer generator > http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD2
It could be that the PHP you are using for testing does not have GD support (whoever packaged it didn't have it compiled in). The quick way to check would be a quick phpinfo() script. That should at least give you somewhere to start. Kyle Steve Marquez wrote: > Does anyone know anything about the gd2 for imagecreatetruecolor? > > I have written a script that uploads an image to a directory and displays a > thumbnail of the image to the viewer. It works when I am using the live > site, but on the testing server, on my machine, it does not work. We will be > using an in-house machine for future use and we were wondering if anyone has > run into this issue before. > > Could it be that we need to create a module in the php.ini file? > > I am kind of new to the back-end of PHP. You could probably tell. I > appreciate any help. > > Thanks, > > Steve Marquez > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Months between two dates
I will assume that your dates are stored in two variables $date1 and $date2 $date1array = explode("/",$date1); $date2array = explode("/",$date2); // Assume Date 2 is later than Date 1 $months_apart = ($date2array[2] - $date1array[2])*12; // Month is later in date 1 than in date 2 // Find the difference of months if( $date1array[0] > $date2array[0] ) { $months_apart -= $date1array[0] - $date2array[0]; } else { $months_apart += $date2array[0] - $date1array[0]; } // $months_apart should now contain months apart And there is your quick and dirty method, I haven't really debugged it, but I am pretty sure that should work. Some (int) casting my be necessary, but I think PHP will automatically do that for you. Good luck, Kyle Phillip Baker wrote: > Greetings Gents, > > I want to take two dates formatted as > 11/1/1998 > 10/1/2008 > > And find out how many months have elapsed between them. > I was wondering if there was a quick and dirty way to do this without a for > loop. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5 Hosting
Hello, I would suggest dreamhost at www.dreamhost.com. Their prices look a bit hefty at first but there are referral codes all over the internet and you can end up saving $97. Their plans have tons of bandwidth and space and I haven't had any trouble with it. But I would suggest them highly, their service is quite impressive. And if you don't like the PHP features they let you compile you own! Good Luck with it! Kyle Ed Lazor wrote: > Anyone ever use A2Hosting.com? Or better yet, any recommendations on a > PHP 5 web hosting company that you're happy with - measured in terms of > quality support, they know what they're doing, and they have good > prices? Bonus points for good drive space, bandwidth, and SSH access. > > I ran a Google search and came up with several options. A2Hosting.com > seems the best so far. My only reservation is that they offer 24/7 > support through a message service who will page a tech who in turn will > call you back - seems sketchy and I can imagine trying to talk someone > into going to the server room at 2am. I also checked out many of the > other options, but some of them seemed even more sketchy... like > VisualWebHosting.com... you click on their link for a BBB review and it > brings up another company entirely... and you call their number and all > the greeting says is "Please leave a message... bep"... pretty > scary if you ask me. > > Anyway, thanks in advance for any recommendations you have. > > -Ed > > --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] Does flock over nfs work with linux kernel > 2.6.12 ?
Hi, from php function manual. I found: flock() will not work on NFS and many other networked file systems. Check your operating system documentation for more details. And from http://nfs.sourceforge.net/#section_d: flock()/BSD locks act only locally on Linux NFS clients prior to 2.6.12. Use fcntl()/POSIX locks to ensure that file locks are visible to other clients. The NFS client in 2.6.12 provides support for flock()/BSD locks on NFS files by emulating the BSD-style locks in terms of POSIX byte range locks. Other NFS clients that use the same emulation mechanism, or that use fcntl()/POSIX locks, will then see the same locks that the Linux NFS client sees. So, does it means that flock over nfs with several clients should work if the nfs clients are all using kernel > 2.6.12? Thanks, Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Creating file & file permissions
Hi All I'm trying to create temp files with my script. I'm using the line $fp = fopen("users/temp123", "w+"); which produces the follow error Warning: fopen("users/temp123", "w+") - Permission denied in /webSite/signup.php on line 71 How do I get around this?? Make sure the 'users' directory is chmod'd correctly (777) so your PHP script has the ability (ie: permissions) to write/create files inside. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: dynamic arraynames
Please can someone offer an idea. I am trying to generate arrays to hold inputs to columns. Column titles are input to a table as needed. They are read by the program and placed across the page. Then an array goes under each column name to collect the inputs to the various rows. Everything works except to dynamically change the name of the array. while($foo=mysql_fetch_array($mysql_result)){ print "";} I can't see how to change the name of the array on the fly. Or maybe their is a better way? Still trying to grasp what you're doing, but I think what you need falls under the category of variable variables. For instance: ${"this"} = "some value"; ...is the same as... $this = "some value"; ...which is the same as... $text = "this"; ${$text} = "some value"; So dynamic arrays could be generated simply by... ${$name} = array(". http://www.php.net/manual/en/language.variables.variable.php Might help too... -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: strings and vars
Hi; i have a string and I want to set it as a variable name. like tahat i have string like: "string"; how can i get variable $string; I suppose you are trying to do the following: $variable = "some value"; So if you wish to assign "string" as $string, simply do the following: $string = "string"; -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Newbie: element index array
If I declared an element indexed array and put some values into it: $a['element1'] = array('btime' => '19D', 'etime' => '22D', 'dayname' => 4); $a['element2'] = array('btime' => '12D', 'etime' => '20D', 'dayname' => 2); $a['element3'] = array('btime' => '15D', 'etime' => '17D', 'dayname' => 3); I would like to ask that how can I completely delete the $a['element2'] in the array? That's mean I will get 'false' in 'isset($a['element2']) after the delete process is taken place. Thanks for your help. Use unset() http://www.php.net/manual/en/function.unset.php -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] does //commenting reduce performance?
I have always had the opinion that the more comments you put into php scripts, the slower they will run because there is more data to be read... Can someone tell me if there is any truth in this or whether commenting has absolutely 'no' impact on the performance of a script? The comments are ignored, except the characters that initiate the actual comment. //some comment $somevar="va"; "some comment" wouldn't even be looked at. PHP sees the //, and goes to the next line. I suppose on a large scale this could reduce performance, but the performance that is lost in standard applications is minuscule. One thing you might want to avoid is using comments inside loops. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Another cookie question
In the purpose of getting access to mydomain.se/ha/ I will set a cookie: setcookie ("login", "OK", time()+3600, "/ha/"); Not sure if this is the case, but try this instead: setcookie ("login", "OK", time()+3600, "/ha/","mydomain.se"); -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] perplexed as to why this is happening...
Howdy, I'm doing a simple db check.. grabbing a db value, in this case $sec, based on the user name registered in the session, I've created a user called test with $sec equal to "2" but when i get to the second echo of $sec the value has changed to "1" and I can't understand why... can some one please give me some idea as to why this is happening? elseif ($_POST['cost'] >=11){ //query db $res = mysql_query("SELECT sec FROM users WHERE uname='$_SESSION[uname]'"); $num = mysql_numrows($res) ; if ($num == 1) { //get results $sec = mysql_result($res, 0, 'sec'); echo $sec; // pulls out sec as 2 ( as is sposed to ) } if (!$sec = "1"){ Right there. Should be... if ($sec != "1"){ -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is wrong here?
I'm making a site which will reside in a remote server and had several problems... most of them where solved once I saw that register_globals are OFF, but now I dont know which other settings are affecting my scripts. I have trouble with header("Location... because the browser is NOT redirected. If I set an echo statement after I detected that the username and password using $_POST[""], the echo goes OK but if I comment the echo and un-comment the header("Location: http://www.domainname.com";); exit; nothing happens... and no, there isn't anything before that... what can be wrong? Thanks in advance, The headers for the page might have already been sent. If there is a space at the top of your PHP file like below, any type of header change wont work: ---top of file header("Location: ..."); exit; ?> -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: BBCode?
Leif K-Brooks wrote: I'm working on adding simple BBCode to my site. I'm currently using the [i] tag for testing, with the following code: function bbcode($text){ $text = ereg_replace('\\[i\\](.{1,})\\[/i\\]','\\1',$text); return $text; } print bbcode('[i]This[/i] is a [i]test[/i].'); ?> But it prints "This[/i] is a [i]test". Is there a better way to do this? ",$text); return $text; } print bbcode("[i]This[/i] is a [i]test[/i]."); ?> -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: BBCode?
Thanks, but that isn't what I want. The point behind BBCode is allowing a small, simpler, securer, subset of HTML. I.e. [img=http://domain.com/image.gif] changes to http://domain.com/image.gif"; alt="" /> In that case: \\2',$text); return $text; } print bbcode('[i]This[/i] is a [i]test[/i].'); ?> Prints: This is a test. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: BBCode?
This code is simply not suitable. The object is to replace tags as an entity as opposed to simply replacing '[' with '<'. Obviously not. I was not fully aware of what he required. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: BBCode?
Thanks a lot, but do you know how to do the same with ereg_replace? I'm trying to learn PCRE, but until I do, I won't be able to add anything to this... \\2',$text); return $text; } print bbcode('[i]This[/i] is a [i]test[/i].'); ?> Works... -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Newbie: ereg
I still havent found a site that shows what I need. I dont think php.net explain how ereg works. I only want to publish stuff from the stringvariable $text thats inside tags looking like this This shall be visible or This shall be visible too thanks Martin Try the following: ]+>)([^<]+)(]+>)",'\\2',$text); return $text; } print format_text('This shall be visible.'); ?> -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: BBCode?
Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] tag, for example). Nested tags? Do you mean [ib] ? Or [i[b]]? If you mean [ib], then I'm afraid what you want cannot be done in ereg_replace. As far as I am aware, that is. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: BBCode?
I think he means: "[i]A sentence in italics, with a word in [b]bold[/b][/i]" Yeah he told me. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: BBCode?
Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] tag, for example). Try this: \2',$text); while($temp != $text) { $temp = $text; $text = ereg_replace($pattern,'<\1>\2',$text); } return $text; } print format_text('[i] this is a [b]bold[/b] test [/i]'); ?> -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: More mail() questions.
I am trying to get the message portion of the email to have line breaks, but whatever I do it displays on one line. This is what I have. $message = "1st Line\n"; $message .= "2nd Line\n"; $message .= "\n"; $message .= "3rd Line\n"; $message .= "\n"; $message .= "4th Line\n"; mail ("", $subject, $message, $headers); TIA As far as I've encountered, you can simply do the following: -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: deleting a record.
".$myrow['id']." ".$myrow['company'].""; printf("(DELETE)", $PHP_SELF, $myrow["id"]); }?> There's an easier way to display this. It should make your life easier...made mine. Take a look: // get the list of resellers from the db $res = mysql_query("SELECT * FROM resellers ORDER BY id"); // print all records in the DB while ($myrow = mysql_fetch_array($res)): ?> (DELETE) now when I click on delete it just reloads the page and doesn't delete the record. I have this code before anything else on the page to handle the delete... if($delete){ $res= mysql_query("DELETE FROM resellers WHERE id=$id"); header("Location: admin2.php?op=resellers"); } What you should do here is check to see if $res is failing, simply by doing the following: if(!$res) echo "error"; Then, place an 'exit;' after the header(...) command to see if the $delete variable is actually being passed. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: testing for empty array
I have an array $keywords, how do I test to see if it is empty? $keywords == '' seems to throw out an error. Maybe... if(count($keywords) <= 0) { //... } -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: string
hi everyone.. how to get the part of string and make it into a variable.. sample : "determine" now, i want to take just "mine" or 4 word from right, or "deter" (for left function). and after i got it, i want to make the "mine" into $x variable my mind.. $x = "mean" help please... $x = substr("determine",-4); For more information on SUBSTR, http://www.php.net/manual/en/function.substr.php ;) -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP & Javascript compatibilty
I'm developing a WYSIWYG editor using PHP and Javascript (for COM). However, I start having problems when I try to display the page using the .php extension. The Javascript is not working. However, when I save it to HTML, it worked fine. Can anyone please help me? Why is this so? What can I do to get Javascript working with PHP with ease? Any articles on this? Thanks a lot... again. :) If you show me some code I can look at, I might be able to assist you. You should have no trouble executing JS on a file with a .php extension, so long as it is incorporated into HTML. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing arguments to the same script
Thanks for responding. I think I'm still doing something wrong. Take a peek: if(isset($_GET['questions'])) { echo "Questions link content will go here"; } elseif(isset($_GET['samples'])) { echo "Samples link content will go here"; } elseif(isset($_GET['rates'])) { echo "Rates link content will be here"; } elseif(isset($_GET['contact'])) { echo "Contact information will go here."; } else { echo "Main content goes here."; } The only thing that EVER gets displayed is the final else. (Main content goes here.) What am I doing wrong? Once again, the links are in this format: This string merely filles the $HTTP_SERVER_VARS["QUERY_STRING"] variable. So you should rather check to see if $HTTP_SERVER_VARS["QUERY_STRING"] equals 'questions', 'samples', etc... $_GET['var'] requires that the link look like this: You could then call $_GET['page'], which would contain the value samples. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Detecing a Number
I have a repeating function to add. The user enters the number of how many numbers they want to add, then it repeats a form field. What I want to do is detect to make sure that the value they enter is a number. If not, don't do the do while loop and if it is, then go ahead and do it. How can I do this? If you don't want to deal with any JavaScript, I suggest you try a simple ereg function like below: //$num = number entered by user if(ereg("[^0-9]+",$num): //returns true, a non numeric character was found else: //returns false, the string is all numbers endif; I haven't tested the above, so it may not work syntactically but the concept is the same... -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Just Curious
I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Fun Fact # 14: Netscape 7.0 ;) -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Execute a cgi inside of php?
include(""); If you wish for this to be a correct PHP statement, it should be: include(""); Otherwise it will error. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Google and php
Hi! If i have made all my sub pages in my webpage by an include in index.php, like http://example.com/index,php?page=subpage34 How can i make google to recognize my subpages allso? Long as there is a link *somewhere* that google can come across to get to each sub-page, it will index every page of your site, regardless of what the URL is unless you specifically state otherwise in the robots.txt file. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: can I mail unlimited in one click?
Hi, I wonder if I can mail 300 customers in one click? part of script: while($listrow = mysql_fetch_array($listresult)) { $recipient = $listrow[epost]; $subject = "$subj"; $message = "$mess"; $headers .= "From: $admail\n"; $headers .= "Reply-To: $admail\n"; $headers .= "X-Mailer: PHP\n"; mail($recipient, $subject, $message, $headers); } or is there a limit? Thanks for any help Jan Grafstrom Why not just put all the email address into the BCC header field? $headers .= "Bcc: $email[0], $email[1],,$email[n]\n"; Of course the BCC list could be filled programmatically... -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: nested if in a for statement
snip /* variables in array set earlier in script */ $userVars = array($nameFirst, $nameLast, $pass, $pass2, $auth, $dob_year, $dob_month, $dob_day); for ($i=0; $i <= count($userVars); $i++) { if (empty($userVars[$i])) { echo "please enter all required info"; break; } } --- snip count($array) returns the number of items in the array. $array[$i] retreives the item at location $i, but remember, this location is ZERO-BASED. That means if we have an array of 10 items, the positions would be from 0 to 9. In the above code you have $i <= count($userVars) The problem is that when $i = count($userVars), $i has surpassed the position of the last time, thus causing it to return as being empty. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: nested if in a for statement
count($array) returns the number of items in the array. $array[$i] retreives the item at location $i, but remember, this location is ZERO-BASED. That means if we have an array of 10 items, the positions would be from 0 to 9. In the above code you have $i <= count($userVars) The problem is that when $i = count($userVars), $i has surpassed the position of the last time, thus causing it to return as being empty. Basically, just remove the '=' from $i <= count($userVars) -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: recommendation needed for dedicated server hosting
Hi, I recently went through a horrendous experience with two different hosting providers. I'd like some recommendations on excellent hosting providers if anybody has some. My key priorities in order are: 1) around-the-clock, technically competent TELEPHONE support (webchat support, message boards, email based support etc. will not do!) 2) reasonable hosting fees (no more than 300/month) for a dedicated server 3) services for the following - backup, OS upgrades/patching, security If anybody has been with a company that they're happy with for at least a year please leave some feedback. Thanks! I've been with RackShack for a little more than a year now and I and very satisfied with them. www.rackshack.net Servers @ $99 per month -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: \Z characters
$connection = db_connect("Could not connect DB"); $SQL="SELECT id,PVLN from lhpl_side WHERE PVLN =\"\\Z\" "; $result= mysql_query($SQL,$connection) or die (mysql_error()); $num = mysql_numrows($result); Not too sure on this, but it might solve the problem. Use single quotes instead... $connection = db_connect("Could not connect DB"); $SQL="SELECT id,PVLN from lhpl_side WHERE PVLN ='\Z'"; $result= mysql_query($SQL,$connection) or die (mysql_error()); $num = mysql_numrows($result); -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem with the List?
Are my posts getting through? They appear to come back on the list but I also get this response... I see them, so I suppose the list has received them. I got that same error yesterday. Hmmm. :\ -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Function returning a reference - how ?!?
I'll try. /* This function instantiates and returns a new Parent class. */ function createParent() { return new Parent; } /* $p is a reference of the Parent object created by createParent(). */ $p = &createParent(); I believe the problem occurs here. $p becomes a reference to the createParent() function whose return value is the Parent object. This *should* work: function createParent() { //the lack of the '()' might have caused other problems return &new Parent(); } $p = createParent(); That way $p equals the value that is returned by the function createParent, which is a reference to the Parent object. Then again, I haven't tested any of this, just going on some instinct here. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cheap Hosting
Hello, I need a nice, reliable host for my new website. It needs to be fast, reliable, needs a good uptime, and some features. PHP and MySQL are the two I really need. Does anyone recomend one that's really cheap? So far I've found on, $5 a month, but it's slower then what'd I like. If nothing else pops up, I'll go with it. I'd also like domain parking and/or domain registration (don't really need the registration though). Thanks in advance! Thanks, Stephen Craton http://www.melchior.us "What is a dreamer that cannot persevere?" -- http://www.melchior.us Try www.frozeonline.com ;) -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple Form Processing
I just broke skin with php and I'm learning forms, which I'm not good with at all. These are snippets from post.html: and but how would I pass the actual image on because when I do something like this: as you could probably guess only the filename prints. So how do I take the image instead of just the filename? Thank you, -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple Form Processing
This is what I tried: if (is_uploaded_file($HTTP_POST_FILES['image1']['image1']) { move_uploaded_file($HTTP_POST_FILES['image1']['image1'], "$DOCUMENT_ROOT/images/$file"); } and also this: if (is_uploaded_file($_FILES['image1']['image1']) { move_uploaded_file($_FILES['image1']['image1'], "$DOCUMENT_ROOT/images/$file"); } and this: if (is_uploaded_file($_FILES['image1']['image1'])) { copy($_FILES['image1']['image1'], "$DOCUMENT_ROOT/images"); } ,the image (which was within the size range) was never uploaded. I have a feeling that I am makeing 1 or 2 of the same mistakes in all three but through my experimenting and reading I am having no luck. I also bought Programming PHP but I trust it less and less as I even find simple mistakes like missing quotes in example code. So what's going wrong? Thank you again, Kyle On Sun, 12 Jan 2003 15:17:42 +1100, "Justin French" <[EMAIL PROTECTED]> said: > Hi, > > the files themselves are available in the $_FILES array, but it's not as > simple as that. > > may i recommend you start by copying the Examples 18-1 and 18-2 from this > page: > http://www.php.net/manual/en/features.file-upload.php > > Once you've got THAT code working smoothly and understand what's > happening, > THEN start modifying it to a 3-file form. > > I'd personally push forms through using POST method rather than get > whenever > possible -- especially when dealing with files... the manual does it this > way too :) > > > Justin > > > > on 12/01/03 12:18 PM, Kyle Babich ([EMAIL PROTECTED]) wrote: > > > I just broke skin with php and I'm learning forms, which I'm not good > > with at all. These are snippets from post.html: > > > > > > and > > > > > > > > > > but how would I pass the actual image on because when I do something like > > this: > > > ?> > > as you could probably guess only the filename prints. > > > > So how do I take the image instead of just the filename? > > > > Thank you, > > -- > > Kyle > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting a dynamic IP address
Hello all, Newbie here I need to know if there is a way I can get my dynamic IP address for use in a php script? -- Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file pointer
How would I set the file pointer to the very end of the last line of the file? ex. ahkjhff asdjfhlkajf sdfhaksljdh kasjdhkjlfh asdjfhklajs askjdhjfdjf//here Thanks, -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] .inc.php
When .inc.php files are included they are also executed whenever the script is executed right? -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] .inc.php
And when functions are defined in *.inc.php they can be executed in the main program? (I just finished writing a logging system and php isn't giving me any errors so I'm trying to figure out what is gong wrong.) On 01 Jul 2003 17:43:16 -0400, "Yann Larrivee" <[EMAIL PROTECTED]> said: > Yes beacause the real extension is .php > > > On Tue, 2003-07-01 at 17:38, Kyle Babich wrote: > > When .inc.php files are included they are also executed whenever the > > script is executed right? > > -- > > Kyle > -- > Yann Larrivee <[EMAIL PROTECTED]> > > -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] have some free time?
Any php programmers out there have a little free time? I've been trying to find the bug in my logging system forever and I've all but given up. If anyone else wants to try their luck then... http://babich.us/log/source/log.php.txt http://babich.us/log/source/config.inc.php.txt http://babich.us/log/source/test.php.txt http://babich.us/log/source/clearLogs.inc.php.txt http://babich.us/log/source/logIpData.inc.php.txt http://babich.us/log/source/logAgentData.inc.php.txt http://babich.us/log/source/logLangData.inc.php.txt I have a feeling that it is an obvious, simple error that I am missing. Anyway, back to the bug hunting... -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] have some free time?
I think this is short example of my problem... Right now this returns: hello x != 1 What do I have to do to get bye() to return 'x = 1'? I tried declaring the x = 1 in hello() global and I tried declaring it static. On Tue, 01 Jul 2003 17:27:48 -0500, "Kyle Babich" <[EMAIL PROTECTED]> said: > Any php programmers out there have a little free time? I've been trying > to find the bug in my logging system forever and I've all but given up. > If anyone else wants to try their luck then... > > http://babich.us/log/source/log.php.txt > http://babich.us/log/source/config.inc.php.txt > http://babich.us/log/source/test.php.txt > http://babich.us/log/source/clearLogs.inc.php.txt > http://babich.us/log/source/logIpData.inc.php.txt > http://babich.us/log/source/logAgentData.inc.php.txt > http://babich.us/log/source/logLangData.inc.php.txt > > I have a feeling that it is an obvious, simple error that I am missing. > Anyway, back to the bug hunting... > -- > Kyle > > -- > 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] Snarl, hiss, growl (frustration)
Why does this not work? It is just a simple hit counter (hence the snarls, hissing, and growling). It logs the ips address but does not increment $current or log it. I do have counter.txt and ips.txt chmod'd to 777. Ips.txt starts blank and counter.txt starts with just a 0 in it. -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Snarl, hiss, growl (frustration)
No, because if i did that the counter would increment no matter what the IP address is. The way I have it the counter will only increment if it is a new ip address to the site. I just fixed it by switching $current++; to $current += 1; Apparently there is some small difference between the two. On Sat, 5 Jul 2003 00:42:59 +1000, "Tom Rogers" <[EMAIL PROTECTED]> said: > Hi, > > Saturday, July 5, 2003, 12:33:25 AM, you wrote: > KB> Why does this not work? It is just a simple hit counter (hence the > KB> snarls, hissing, and growling). It logs the ips address but does not > KB> increment $current or log it. I do have counter.txt and ips.txt > chmod'd > KB> to 777. Ips.txt starts blank and counter.txt starts with just a 0 in > it. > > KB> KB> $current = fread($counter, filesize('counter.txt')); > KB> fclose($counter); > > KB> $ip = getenv('REMOTE_ADDR'); > KB> $ipCheck = file('ips.txt'); > KB> if (!in_array($ip, $ipCheck)) { > KB> $ipAdd = fopen('ips.txt', 'a'); > KB> fwrite($ipAdd, "\n$ip"); > KB> fclose($ipAdd); > > KB> $current++; > KB> $counter = fopen('counter.txt', 'w'); > KB> fwrite($counter, $current); > KB> fclose($counter); > KB> } > > print $current; ?>> > KB> -- > KB> Kyle > > > maybe you need to end the if() statement before incrementing the > counter. > $ip = getenv('REMOTE_ADDR'); > $ipCheck = file('ips.txt'); > if (!in_array($ip, $ipCheck)) { > $ipAdd = fopen('ips.txt', 'a'); > fwrite($ipAdd, "\n$ip"); > fclose($ipAdd); > } > $current++; > $counter = fopen('counter.txt', 'w'); > fwrite($counter, $current); > fclose($counter); > print $current; ?> > > -- > regards, > Tom > > -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Snarl, hiss, growl (frustration)
FYI there were no newlines involved in my program. (go back to the message and read the code) On Fri, 4 Jul 2003 12:06:46 -0700 (PDT), "Rasmus Lerdorf" <[EMAIL PROTECTED]> said: > On Fri, 4 Jul 2003, Robert Cummings wrote: > > Undoubtedly the above will work as we both know, the output will be > > "123"; however, if you look at the original code in question, there is > > no "\n" tailing the output written to the counter file and thus the > > increment works fine (unless of course when he created the file to begin > > he had a newline - something I did not do in my test :) > > which is exactly what it looked like he did since he said that switching > to $counter+=1; fixed it for him which would force it to be an integer. > > -Rasmus > -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Authorization script
I am making an authorizatoin script for the control panel of a loggin system I have been writing. Here is what I have right now: The problem is that if a user clicks cancel the control panel loads instead of the program dying. Why and how do I stop it? Thank you, -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] another big, juicy, delicious bug
For a logging system that I've been writing I came up with a way to asign a unique id number to every IP address that visits the site. What I do is append every *new* IP to a new line in a file (ips.txt). Then when I have an IP and need the id I file() the ip log to put it in an array, array_flip() it to make the IP the key and the index the value. Then the ID is dataArray[$ip] + 1. The +1 is so there isn't an IP with the ID of 0. When I have the id and need the IP I do the same thing except no array_flip and subtract 1 from the ID before dataArray[$id]. This has been working fine throughout the site in testing except in one spot. What I have is the IP and what I need is the ID. This is what is done: // Use IP address to get id function getId ($ip) { $ipData = file('idData/ips.txt'); $ipData = array_flip($ipData); $id = $ipData[$ip] + 1; return $id; } But for some (and only some) IPs this won't work. So for debugging I printed the array, the flipped array, the ip, $ipData[$ip] and $id. The first IP will work fine, like this: Array ( [0] => 172.170.69.74 [1] => 172.141.183.231 [2] => 172.137.79.102 [3] => 172.151.144.242 [4] => 172.150.212.129 [5] => 172.158.154.92 ) // correct array Array ( [172.170.69.74 ] => 0 [172.141.183.231 ] => 1 [172.137.79.102 ] => 2 [172.151.144.242 ] => 3 [172.150.212.129 ] => 4 [172.158.154.92] => 5 ) // correct flipped 172.137.79.102 // correct ip 2 // correct $ipData[$ip] 3 // correct $id But then it will go and do something like this: Array ( [0] => 172.170.69.74 [1] => 172.141.183.231 [2] => 172.137.79.102 [3] => 172.151.144.242 [4] => 172.150.212.129 [5] => 172.158.154.92 ) // correct array Array ( [172.170.69.74 ] => 0 [172.141.183.231 ] => 1 [172.137.79.102 ] => 2 [172.151.144.242 ] => 3 [172.150.212.129 ] => 4 [172.158.154.92] => 5 ) // correct flipped 172.151.144.242 // correct ip // complete nothingness where $ipData[$ip] should equal 3 1 // wrong $id, should be 4 I have been trying to figure this out for three days and have come up with nothing. Where is the function going wrong? -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] another big, juicy, delicious bug
This function is what I used: function getId ($ip) { $ipData = file('idData/ips.txt'); $ipData = array_flip($ipData); $id = $ipData[$ip] + 1; return $id; } It is defined in idData.inc.php which is required in the file with the problem (controlPanel.php). I decided to ban a third IP just to see what would happen and when I banned the third it worked fine, and it fixed the other banned IP. So, that just adds to the problem. Why would it work with 1 and 3 banned IPs but not 2... Anyway here is the part of controlPanel.php where the function is called... Banned Users = 2) { ?> :: Unban All Unban IP Address"; ?> On Tue, 8 Jul 2003 08:00:35 -0500, "Jay Blanchard" <[EMAIL PROTECTED]> said: > [snip] > But then it will go and do something like this: > Array ( > [0] => 172.170.69.74 > [1] => 172.141.183.231 > [2] => 172.137.79.102 > [3] => 172.151.144.242 > [4] => 172.150.212.129 > [5] => 172.158.154.92 > ) // correct array > > Array ( > [172.170.69.74 ] => 0 > [172.141.183.231 ] => 1 > [172.137.79.102 ] => 2 > [172.151.144.242 ] => 3 > [172.150.212.129 ] => 4 > [172.158.154.92] => 5 > ) // correct flipped > > 172.151.144.242 // correct ip > > // complete nothingness where $ipData[$ip] should equal 3 > > 1 // wrong $id, should be 4 > [/snip] > > First of all this is probably not a bug. > > Second, where is the code that tests for the condition? Do the other > IP's in the array output their id properly in this same set? This info > will help us to solve the problem. > > Jay > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Processing Form Data /w $_POST
I have a form (setup.php) that passes values to processSetup.php when they are written into setup.txt. I'm trying to instead of writing every idividual value into setup.txt from setup.php, write a loop that will take as many values as there are in the $_POST array and write them all into a single array in logical order in setup.txt. I'm new to php and can't figure out how to do this. I'm thinking of something like... for ($_POST) { fwrite($setup, /*something to add current $_POST value to the end of an array within $setup*/); } How should I go about this? Thank you, -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Processing Form Data /w $_POST
> What kind of 'logical' order do you need for the Post array? > > To clarify: > Do you need to write to a file the POST variables passed to the script? Yes, setup.php -> processSetup.php -> setup.txt > > > "Kyle Babich" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > I have a form (setup.php) that passes values to processSetup.php when they > are written into setup.txt. I'm trying to instead of writing every > idividual value into setup.txt from setup.php, write a loop that will take > as many values as there are in the $_POST array and write them all into a > single array in logical order in setup.txt. I'm new to php and can't figure > out how to do this. I'm thinking of something like... > > for ($_POST) { > fwrite($setup, /*something to add current $_POST value to the end of an > array within $setup*/); > } > > How should I go about this? > > Thank you, > -- > Kyle > > > > -- > 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] explode, split, or what?
Thank you to those of you who helped me with my last problem earlier today. Now I have a text file (setup.txt) that has a series of values all seperated by \r\n's. Inside of another file I'm trying to read setup.txt into $rawSetupData and explode that with \r\n's into an array called $setupData. My problem is that the explode function doesn't seem to be doing anything, and neither is split which I tried also. Here is my code: setup.txt *** John\'s X Log 10 5 example.com treeclimber56 ab3c45def *** test.php *** *** Actual results of running test.php *** John\'s X Log 10 5 example.com treeclimber56 ab3c45def 61 *** Desired reults of running test.php *** John's X Log *** Other problem: In the actual results of running test.php where is the 61 coming from? Thank you, -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing Date/Time
I have a input field in a form that is disabled by javascript but is assigned a value in the code that is the RFC 822 formated date. Why is this field not included in the $HTTP_POST_VARS? Here is the page I am talking about: http://babich.us/xlog/post.php When the page is submitted all other values are passed except the date/time value, why? How do I fix it? Thanks, -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Date/Time
Nothing passes when it is disabled via HTML either. > just for shits and giggles, why not manually disable the field without using > javascript and see what happens. just add the word "disabled" to the tag. > > > >From: "Kyle Babich" <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: [EMAIL PROTECTED] > >Subject: [PHP] Passing Date/Time > >Date: Fri, 20 Jun 2003 16:55:29 GMT > > > >I have a input field in a form that is disabled by javascript but is > >assigned a value in the code that is the RFC 822 formated date. Why is > >this field not included in the $HTTP_POST_VARS? > > > >Here is the page I am talking about: > >http://babich.us/xlog/post.php > > > >When the page is submitted all other values are passed except the date/time > >value, why? How do I fix it? > > > >Thanks, > >-- > >Kyle > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > _ > The new MSN 8: advanced junk mail protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Date/Time
That works, thanks. > Try setting that date as a type="hidden" value instead. Do a > print_r($_POST) at the other end to see what comes up! > > -Michael > On Fri, 2003-06-20 at 08:55, Kyle Babich wrote: > > I have a input field in a form that is disabled by javascript but is assigned a > > value in the code that is the RFC 822 formated date. Why is this field not > > included in the $HTTP_POST_VARS? > > > > Here is the page I am talking about: > > http://babich.us/xlog/post.php > > > > When the page is submitted all other values are passed except the date/time value, > > why? How do I fix it? > > > > Thanks, > > -- > > Kyle > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Not incrementing?
I have a file, current.txt, that at the start has only the digit 1 in it. Here is my code: $current = readfile('setupData/current.txt'); foreach ($HTTP_POST_VARS as $index => $value) { $index = $HTTP_POST_VARS['$index']; } $info = fopen("postInfo/{$current}-{$dateFile}.txt", 'w'); fwrite($info, "$author\n$email\n$dateActual"); fclose($info); $entry = fopen("postEntries/{$current}-{$dateFile}.txt", 'w'); fwrite($entry, $body); fclose($entry); $currPost = fopen('setupData/current.txt', 'w'); fwrite($currPost, $current + 1); echo $current; fclose($currPost); Two files are created in seperate folders, each with the same name, the current number in current.txt, a dash, then a series of numbers and letters that represent the current date and time exactly. That happens correctly, but then the number inside of current.txt is supposed to increment. Every pair created should be the next number, a dash, then the date and time. It will increment once to 2, but all created files are 1- and nothing else happens no matter how much I do it. What went wront? Thanks, -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Now what's wrong with this?
The following code obtains lists of files from two different directories and reverse numerically sorts them. Then bellow it takes one file and dumps the contents into an array, which works fine. The problem is where it takes the entire content of the matching file from the second directory and tries to put it into $entry. It returns a parse error on line 67, which is the line I marked. What should I do to fix this? Thanks a lot to you guys by the way for help with all of my problems. I'm a 16 year-old trying to create a weblog system using PHP (a new language to me) over summer vacation for fun. -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Newbie mail () question
I have just built a simple formmail script that validates certain fields and then if alls well mails the information to the client's email addressand displays some confirmatin html. This is all fine except for one minor issue. When I collect the email to check it looks OK etc the header From : in Outlook Express gives the www.servername.com Can I personalise this a bit to display the From: as the email address that the user has supplied i.e $Email I'm v. new to this so any help appreciated! Try this: //...snip $headers="From: $name <$email>\r\n"; mail($recipient, $subject, $message, $headers); //...end The above code seems to work for me. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: put result of "include" into a variable
For some (strange, I know) reason I would like to copy the content of a webpage into a database. I would like to have code like $whocares = include ("http://www.microsoft.nl";); $query = "insert into html values ($whocares,...)"; .. However, include can not copy the content to a variable. Does anyone have an idea how to circumvent this problem? Try: $fp = fopen ("http://www.example.com/";, "r"); $data = ""; while(!feof($fp)) { $data .= fread($fp,1024); } //$data now contains all the html for the website fclose($fp); -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strtotime() question
Hello, I'm not even quite sure if I am posting this message in the right place, so please bear with me. I have a question regarding the strtotime() function. I am developing a PHP script to handle dates for my web site, and I need an easy way to get from today to tomorrow to +2 days to +3 days... you get the idea... all the way up to +90 days. The strtotime() function seems ideal because the script can easily put in "+51 days" and it knows what to do. My question is how does it handle Daylight Savings Time? The program I was previously using (written in Perl) actually jumped a day or duplicated a day when DST was coming up or ending. When using the "+19 days" syntax in the strtotime() function, does it take into account DST and not cause similar problems? Thank you very much for any help. ~Kyle Bisignani -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SSH file transfers
jeremy brand wrote: > > > How can I upload / download files using SSH through PHP? > > Use scp. > > I built a rather complex document system that is more > than I want to mention for this topic, but... > > > Has anyone ever did it before? > > Yes. You can run "any" program from php. Just use the system, or > exec or ``. Is there a decent scp for windows? In particular, is there one that could be run through a browser? What Nando2 probably wants is the normal HTTP upload, but over SSL. Use that SSL only if the contents of the files need to be protected, because of the overhead it adds. If the contents don't need to be protected, a good sessioning system (with the HTTP upload) would probably work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] SSH file transfers
Yeek! Not quite what I meant. I don't think that web servers have any business being on windows boxes. I was wondering if there were a way to upload using something like scp from a windows (or other) browser to a unix server. bard wrote: > > the people who make putty (my favorite ssh client for windows) also make a command >line scp program. this could be included as an exec() in a script I would think... > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] "Authenticating" across sites/servers
Here is an idea I had, but will require that all the sites in question maintain very accurate clock synchronization, but doesn't require any database writes. It assumes that the passwords are stored using MySQL's PASSWORD("") function. $user_table="website.authorized_users"; $now=gmmktime(); $interval=300; $rnow=$now-($now%$interval); $persist=6; function auth_hash($user,$pass){ global $user_table,$rnow; $q='SELECT PASSWORD("'.$pass.'") as p1, password as p2 FROM '. $user_table.' WHERE username="'.$user.'"'; $r=mysql_query($q); $row=mysql_fetch_array($r); if($row[p1]==$row[p2]){ $retval=mhash(MHASH_MD5,$user.$row[p2].$rnow); }else{ $retval=FALSE; } return $retval; } function auth_logon($key,$user){ global $user_table,$rnow,$persist,$interval; $q='SELECT password FROM '.$user_table.' WHERE username="'.$user.'"'; $r=mysql_query($q); $row=mysql_fetch_array($r); for($i=0;$i<=$persist;$i++){ $str=$user.$row[password].($rnow-($interval*$i)); $hash=mhash(MHASH_MD5,$str); if($key==$hash){ return TRUE; } } return FALSE; } "Boget, Chris" wrote: > > I've been charged with trying to find out how something > like this can be done if it is at all in fact possible. The info > I'm hoping to get is what would be involved and where I > can find information on it. I'm not asking for code or > examples unless you really want to provide them. :P > > Anyways, what we need to be able to do is the following: > > * Have a user be able to authenticate on a *trusted* partner > website that resides on a server external to our network. > > * Have that external website securely transmit information > (preferrably not on the URL :p) with regards to the > authentication information on that user; the auth info > will be the same on both servers. This would allow the > user streamlined access to the areas on our website that > would otherwise require the user to log in without forcing > them to do so. > > * The other aspect to the above that we also need to address is > when a user signs up for the first time on the trusted partner's > site, that signup information should be securely transmitted to > us when/if the user attempts to access our site so we could set > them up in the database and authenticate them by nature of the > above. > > Is something like this possible? What would be involved? Is > there something that is already built into Apache/PHP that > would make it easier? Someone suggested XML database transfer, > but I've never heard of XML being anything other than a markup > language much less capable of storing data? It was also suggested > that we use something like public key/private key but am not sure > how that would work... > > We are using: > > Apache 1.3.12 > PHP 4.0.3pl1 > PHP4 Session based (not HTTP basic) authentication using mySql > to store the ID/PW > > I realize the security implications of something like this and have > brought them up myself. However, it's something that is being > pushed and so I've got to look into it (and I don't even really know > where to start) so please don't say it's stupid because I already know. > :) Is something like this possible? What's involved? Where can I go > to learn more? > > Thanks! > > Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Trim a string
Hello: I have a signup form that asks for a website address. I don't need them to put in the http://, but I'm thinking that some will try anyway. Is there a way to check for this and remove it when the user submits the form? Thanks, Kyle [EMAIL PROTECTED] http://www.thedip.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Image Upload
Hello: I'm looking for some code that will upload images to my server from a form submission. I'd also like it to check for a max file size of the images. Any help would be appreciated. Thanks, Kyle [EMAIL PROTECTED] http://www.thedip.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Trim a string
Thanks, that worked great. - Kyle ""Jack Dempsey"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > if you're string is a variabe $address, then > eregi("http://",$address) will tell you if they've put in the http part, and > $address = substr("$address",7); > will slice off and store the text after the http:// > > you'll find lots of different ways to do this...whatever suits you, go for > it... > > -jack > > -Original Message- > From: Kyle Mathews [mailto:[EMAIL PROTECTED]] > Sent: Sunday, May 06, 2001 4:46 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Trim a string > > > Hello: > > I have a signup form that asks for a website address. > I don't need them to put in the http://, but I'm thinking that some will try > anyway. > Is there a way to check for this and remove it when the user submits the > form? > > Thanks, > Kyle > [EMAIL PROTECTED] > http://www.thedip.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] $HTTP_SERVER_VARS
Heya folks, I've got a little problem here, maybe you can help me out. $HTTP_SERVER_VARS["HTTP_REFERER"] is supposed to point to the referring webpage, if it exists. As is $_SERVER["HTTP_REFERER"] and $HTTP_REFERER itself. However, it seems that I do not have this variable available on my server. I do however have this funky variable called "HTTP_WREFERER" which returns a strange string like value like below: VLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJ I've searched PHP.net, and practically every PHP site on the Internet with no luck as to what this is supposed to represent. I've even tried to find out how I could "enable" the HTTP_REFERER variable, since it seems that it is disabled or something. I am guessing that WREFERER is some kind of encrypted version of HTTP_REFERER, but I don't know. It changes everytime, so it is hard to say. I'm running on PHP Version 4.0.6, if that helps. Thanks, Kyle Gibson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SSH
I am curious as to how I would go about executing SSH command line operations through PHP. Say for instance the command "ftpwho", which would return a list of users connected to a FTP server, along with what they are doing, etc. I've tried to open a socket to my SSH server, along with the functions system(), shell_exec(), and exec(). Thanks, Kyle Gibson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_SERVER_VARS
> Have you tried looking at a phpinfo() page and seeing what variables are > available? > > Make a page with just the following line in it and load it up through > your web server. > > Yes. That is how I know of WREFERER. Do you know what it is? If you want, you can look at my phpinfo page here: http://php.plaguenet.com/MyAdmin/phpinfo.php. Kyle Gibson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_SERVER_VARS
Whoops. It wont show unless you come from somewhere else... Go here and click the link: http://www.plaguenet.com/wreferer.php Thanks, Kyle Gibson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SSH
Thanks, I'll try what you suggested. -Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $HTTP_SERVER_VARS
My firewall prevented me from seeing the variable in action. Ignore this. -Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTML to mysql - from msql to html
You entered data into a text area field that was entered into a mysql row. Then you tried to print it out. Try this: $content = str_replace("\n","",$row["row_name"]); echo $content; -Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] weird foreach problem when calling date or getdate function,
> Those numbers don't look like timestamps to me (as they can't be larger > than about 4294967296). What they look like is the result of some imp or > perhaps even a gremlin breaking into your code and smooshing together > yearmonthdayhourminutesecond, then trying to PRETEND it's a timestamp. > > Go back and read the date/time chapter of the PHP manual a little more > closely. > > miguel They look like MYSQL timestamps to me. http://www.php.net/manual/en/function.date.php The MySQL timestamp format is NOT the same as the PHP timestamp format (otherwise known as the Unix timestamp format). MySQL uses a MMDDHHMMSS format whereas PHP uses a format. MySQL timestamp: 20020207164744 PHP (Unix) timestamp: 1013096864 -Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_SERVER_VARS
> My last guess, was to turn off my Firewall (*Norton* Personal Firewall) > and after that my PC returned a correct HTTP_REFERER! Exactly what I did. Funky, huh? Thanks, Kyle Gibson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SSH
I've tried this, $cmd = `ftpwho`; echo $cmd; and/or $cmd = shell_exec("ftpwho"); echo $cmd; But I get this error: Warning: Cannot execute using backquotes in safe mode in test.php on line 2 -Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SSH
> Your ISP has safe mode turned on which means you cannot use backquotes. Read all > about it at http://www.php.net/manual/en/features.safe-mode.php. I am my own ISP, techically. In the php.ini file, safe mode is off. Which is why I am curious as to why this is occuring. --- ; ; Safe Mode ; safe_mode = Off --- -Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Who's having a good hosting experience these days?
> My clients aren't rich big money folks but I need a PHP capable host for > > about $11ish or less a month. Traffic is minimal, and like I say the > only tech support calls I've had to make this past year were when the > hosting service tweeked and freaked something thus messing it all up. http://solutions.plaguenet.com/ HTH -Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SSH
> What does phpinfo() have to say about it? It says that the Local Value is "on" but the master value is "off". -Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Databases?
Can someone please give me the simplest tutorial to databases they can find?
[PHP] PHP.... i suck at it
Ok this may sound really pathetic but how do i add a new line (like a space) to a code like this cause when i try the code out it looks like IPADDRESS127.0.0.1 and i want it to look like IP ADDRESS 127.0.0.1 or IP ADDRESS 127.0.0.1 so what do i put in? Thanks for your time :)
[PHP] Automatic survey
I have made a small page containing the following PHP "; echo $REMOTE_ADDR; echo "Port number"; echo $REMOTE_PORT; echo "System info"; echo $HTTP_USER_AGENT; echo "Last page visited in this window"; echo $HTTP_REFERER; ?> is there any way i can make the PHP file email me the info above without revealing the users address, if so, what should i add to the code? (dont worry im only using the code above as a tester, as you can tell im not a hacker) -legokiller666- http://www.StupeedStudios.f2s.com New address new site ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666
[PHP] Whats wrong with this code?
$message = $IP, $PORT, $SYSTEM, $PAGE; what should i change in the $message code so that it contains the words assigned to the variables? -legokiller666- http://www.StupeedStudios.f2s.com New address new site ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666
[PHP] Another how do i question
I made this code for a simple for (the end of it) but what do i change in the $message variable so there is a new line between each other variable in $message (ive tried $name. . $last_name and. happens) -legokiller666- http://www.StupeedStudios.f2s.com New address new site ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666
[PHP] Resolution
is there a code to show a users screen resolution and/or make a webpage go to a certain page of the site depending on the users screen resolution? -legokiller666- http://www.StupeedStudios.f2s.com New address new site ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666
[PHP] D d d d database?
ok i dont know the first thing about data bases so could someone please guide me through the process of making a score board for a flash game i have made with the variables $name and $score?? (note: i have hosting at f2s.com so i have to use myADMIN) -legokiller666- http://www.StupeedStudios.f2s.com New address new site ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666
[PHP] URGENT... NEED HELP!!!
What is wrong with this code? (note: the variables $email and $comments are sent from another page but i get the error message from this page saying "Warning: Could not deliver email. You are over quota. in /web/sites/197/lk6/www.stupeedstudios.f2s.com/email.php on line 15" in which line 15 is the line under "$message = $email. $comments;" saying just "?>" -legokiller666- http://www.StupeedStudios.f2s.com New address new site ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666
[PHP] URGENT... NEED HELP!!!
What is wrong with this code? (note: the variables $email and $comments are sent from another page but i get the error message from this page saying "Warning: Could not deliver email. You are over quota. in /web/sites/197/lk6/www.stupeedstudios.f2s.com/email.php on line 15" in which line 15 is the line under "$message = $email. $comments;" saying just "?>" Thanks -legokiller666- http://www.StupeedStudios.f2s.com New address new site ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666