[PHP] get filename?
Hi Whats the best method to get the filename of the file I am using. E.G if the file is called tom_woz_here.php and would I go about stickin that into $FileName= ??? Thanks -- 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] Header Problem
Hi, I`m having whats probably a very basic problem but just can`t get my head around it this late in the day, anyone have any idea why this won`t work? $URL="domain.com"; header ("Location: Http://www.$URL/members/index.php"); $URL changes so I can`t write it directly into the header line, anyone? -- 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] Sessions help please
Hi, I am going to use sessions to authenticate and protect my pages, this is what I have so far... User logs in via form, this is checked via a SQL call, if the correct username and password are entered I run the following: session_start(); session_register("UserName","Password"); header ("Location: Http://www.domain.com/members/index.php"); The bit where I get lost is 1) how to authenticate this on each page and 2) How to close the session after the browser has closed. I have tried many tutorials etc but none seem to go into great detail in those areas. Anyone know of any decent tutorials or any snippets I can learn from. Thanks -- 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] List Files
Hi, Does anyone know how I can list all the files begining with help in one of my pages. So I have a dir which has various files, like so: help_me.php help_you.php help_us.php Is there some command I can use to select all the files and then print them out? TIA Ade -- 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] redirection
In a message dated 21/04/2001 15:31:36 GMT Daylight Time, [EMAIL PROTECTED] writes: << How to redirect to another page in php. Is there any inbuilt function available for redirection. If possible send with example. Thanks kishor >> Use the Header call,for more info see www.php.net and search for Header() Example header ("Location: Http://www.domain.com/owner/index.php"); HTH Ade -- 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] OT-Please bare with me :)
In a message dated 03/05/2001 18:07:18 GMT Daylight Time, [EMAIL PROTECTED] writes: << Hello, I am making a suite of php tolls that I want to have all incorporated in one management website. What I would like to have is a drop down menu in a frame on the left. A great example of what I want is the left drop down menu on the new Cobalt XTR server admin section. If anyone has a JavaScript or a tutorial how to make a drop down menu please send me a link. Thank you :) Brandon >> Hi not sure if this is exactly what your after but it may do the trick :-) It isn`t perfect coding but it does work so you should be able to model it to what you want. Request for Quote Ask A Question -- 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] exec() help
Hi, I am running the following function in my PHP script: exec("/usr/local/bin/wget http://www.getresponse.com/cgi-bin/add.cgi?misc=1&ref=001&category1=trtips&cat egory2=a&category3=".$Grab[2][$i]."")or die ("Error"); It is run inside an if loop and $Grab[2][$i] contains an e-mail address. However it always returns an error and I cannot figure out why, any ideas?? TIA Ade -- 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] Session Confusion
Ok these sessions have got me all confused, I need to have two seperate sessions one for when a user signs up, to stop them using there back button and inadvertantly signing up twice. And then one when they login. Both of them work great as standalone but if say I went and log into my account and then decide I need another, the sign up page blocks me because I already have a session running. Here is some code will probably help me explain my system. if(!$PHPSESSID) { $SET=1; }elseif($PHPSESSID=1) { echo"You are already Registered, please click here to login."; die; } if($SET=1) { session_start(); session_register("SET"); } This checks to see if there is a session running, if there is it blocks them and sends them to the log in page, if there isn`t the rest of my script sets up the account and then forwards them to the log in screen, so if for any reason they decide to use there back button they can`t create two accounts by accident. Then when they log in I start a session as follows: session_start(); session_register("UserName","Password"); header ("Location: Http://www.tothemembersarea.com/"); So if I go to my system log in and then try to setup a new account it blocks me, any idea how I can distinguish between the two?? TIA Ade -- 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] Session Confusion
If that's a copy of your code, you might want to check the if($SET=1) line...that will always return true, because you're setting a variable, not checking for equality...should be if($SET==1) instead jack Ooops ok put that bit right, I should really know better :-) but it still doesn`t solve the overal problem LoL Thanks for pointing it out though Ade -- 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] php4 but dont work with php3
Hi, I`m not sure if this is 100% the right method but you can try it and see. Change httpd.conf to the following. AddType application/x-httpd-php .php .php3 Ade -- 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] Delaying Printed Output
In a message dated 24/03/2001 14:47:03 GMT Standard Time, [EMAIL PROTECTED] writes: << Is it possible using PHP to print a single line of text to a browser, have a second or two delay and then print the next line, etc. etc.? Greg >> Hi, You can use the following commands: sleep(seconds); usleep(microseconds); HTH Ade -- 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] MySQL Schema
Hi, Is there any way in PHP to print out the schema of my database tables? Cheers Ade -- 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] Tough One
Hi, Ok I have a real tough one here (well to me it is :-) If I telnet into my server I can add a user by running the following command... /usr/sbin/cadduser -d www.domain.com -f users full name -u username -p password -w emailaddress for forwarding Which is great, but as I`m offering free email forwarding I could potentially get a lot of users, and that would be a lot of maintenance time. So I need to somehow incorporate the above into my signup scripts. Is this even possible?? TIA Ade -- 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] Tough One
In a message dated 29/03/2001 15:27:27 GMT Daylight Time, [EMAIL PROTECTED] writes: << To get this done I would use an Expect script, driven through CGI. Mike >> Problem is I don`t program in CGI so have no idea what you mean :-) Ade -- 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] Match em up
Hi, I have two database`s with one table in each. (MySQL) Is there a way that I can select data from one table and then match it with the data in another and discard the results so all I am left with is the original data from the first table which never matched up. Database1 EmailAddress RecID - Email Database2 Members lots of stuff blah blah Email So I would match the Email from Database1 Table EmailAddress to those in Database2 Members. Take out the matches and be left with a list of people who started signing up but never completed it. Any thoughts? Ade -- 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] Sessions Q.
Hi, I currently have sessions working nicely on my site, but I want to add a timeout feature. What would be the best method, grabbing the server time and setting it using the session_register, and then running a time check so if the session time is more than one hour old destroy it?? Ade -- 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] sessions broken when redirected?
Hi Andrew, I`m not sure if switching from http to https will count as a *new* domain, but here is a link to some information which may solve your problem. http://phpbuilder.com/columns/chriskings20001128.php3 HTH Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php error code.
In a message dated 29/03/2001 21:42:57 GMT Daylight Time, [EMAIL PROTECTED] writes: << If you have permission to modify php.ini, see the setting "display_errors" and the attached comments. You can tell PHP to write these error messages to a log file instead of to the browser. Kirk >> If I make a change to my php.ini file, once I re-upload it do I need to restart the server or something as none of my changes are taking place? Ade -- 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] Delete Problem
Hi, Can anyone see a problem with this? It keeps stopping on $query1 thanks Ade -- 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] Delete Problem
In a message dated 30/03/2001 17:59:52 GMT Daylight Time, [EMAIL PROTECTED] writes: << Correct me if I am wrong, but I thought that using IN needed to be followed by a comma separated list (with each value individually separated from the others) like this: $query="DELETE FROM EmailAddress WHERE Email NOT IN ('value1', 'value2', ., 'value_n')" ; >> Yeah, this code puts the email address`s into a comma seperated list $inlist .= sprintf("%s", $www_domain_Array['Email']); if($a < $www_domain_rows - 1) { $inlist .= ", "; That bit works ok as I have echo`d it out. It`s just the final delete that wont work :/ Ade PS: I tried wrapping $inlist to ($inlist) in my delete statement as suggested but that didn`t work either -- 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 Shell command?
Hi, Does anyone know if there is a way to execute a shell command in a php script? I am trying to execute the following: /usr/sbin/cadduser -d www.domain.com -f Adrian -u testing -p testing -q 10 -w [EMAIL PROTECTED] I have tried passthru(), system(), exec() and none seem to work. I also tried the backtick and that never worked. Any ideas anyone? Adrian -- 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] ZEND Encoder
Hi, I`m about to buy the Zend encoder from thier website and thought I better ask a pretty important question, unfortunately Zend couldn`t be bothered to follow up the lead on someone who might buy thier product so I thought I would turn to you guys to see if any of you know. Is it possible in any instance that someone else will be able to de-code my PHP scripts once I have used the Zend Encoder on it, and be able to read it? Obviously they will be able to decode it to actually use it on the server, but will they ever be able to read the source? Thanks Adrian -- 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] Please Help!
In a message dated 03/04/2001 03:52:47 GMT Daylight Time, [EMAIL PROTECTED] writes: << include "class.FastTemplate.php"; >> Just for a start, I didn`t notice anything else in the code... include ("class.FastTemplate.php"); Ade -- 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] online detection
In a message dated 11/04/2001 12:58:11 GMT Daylight Time, [EMAIL PROTECTED] writes: << > Does anyone know how to detect when a user connects to the Internet > similar to ICQ? Sure. Three main possibilities: (1) Install a wire tap at his telephone line, together with some logic to detect connection attempts (2) Do the same, but at his provider's dialin box. (more difficult) (3) Install a proper trojan on the user's machine Most criminals use possibility 3 ;-) >> H I wonder which one ICQ uses :-) Ade -- 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] attachments in mail
In a message dated 12/04/2001 09:55:18 GMT Daylight Time, [EMAIL PROTECTED] writes: << How can i include a file as an attachment in an email? I'm looking for something like this... mail($to_email,%subject,$content,$attached_file); Thanks in advance! Dan >> Unfortunately it`s not that easy :-) Try taking a look at the following URL which should enlighten you a bit as to whats involved. http://www.phpbuilder.com/columns/kartic2807.php3 HtH Ade -- 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] Batch Coding Help Please
Hi, I am building a custom e-mailer for one of my websites using PHP and MySQL, I know there are loads out there already but my goal here is to learn this coding myself so I can modify it to my needs as and when they change. My list only has around 5000 subscribers at the moment and I have heard that with large lists like this it is ideal to batch send the emails. So my question is how do you batch code? This is the code I have in place at the moment $query=mysql_db_query($dbase,"SELECT * FROM Subscribers, Members where Subscribers.ListID='$ID' and Members.MID=Subscribers.MemberID"); $num_rows=mysql_num_rows($query); for ($i=0; $i<$num_rows; $i++) { mysql_data_seek($query, $i); $array=mysql_fetch_array($query); $Email="$array[Email]"; mail($Email, $MsgTitle, "$Message\n\n\n$Content", $Header); } -- 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] Batch Coding Help Please
Hi, Unfortunately that won`t work for me because I don`t have access to setting up a Cronjob on this account, thanks for the suggestion though. Ade -- 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] Time Help
Hi, I`m trying to get the difference between two date/times and then state how many days, hours and minutes there are between them. So I take my date and convert it into unix time. Then get the current time, and then subtract the two to get the current difference in unix seconds. What I`m having trouble doing is working out how many days hours and minutes are left over. For example if I have the date/time: 2001-07-01 01:10:00 And the current date/time was: 2001-07-02 00:00:00 Then I would like to display 1 Day 1 Hour 10 Minutes. Any one have any suggestions, this is my code so far. $date1_formated = "$DateEnd $TimeEnd"; $date1 = strtotime($date1_formated); //converts to a UNIX timestamp $date2 = time(); //returns current UNIX timestamp $seconds_between = $date1 - $date2; TIA Ade -- 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] Time Help
Thanks Jeff, Thats just the job. Ade << Here is the function I use when I am comparing differences ($now and $old are Unix timestamps): function datediff($now, $old) { $DIS = $now - $old; // Diff In Secs $secs = $DIS % 60; // modulo $DIS -= $secs; $days = floor($DIS / (24*60*60)); $DIS -= $days * (24*60*60); $hours = floor($DIS / (60*60)); $DIS -= $hours * (60*60); $mins = floor($DIS / 60); $DIS -= $mins * 60; $diffstr= "$days Days, $hours Hours, $mins Minutes, $secs Seconds"; return $diffstr; } >> -- 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] exec problem
Hi I'm trying to create a script which my cron will run once a day to backup my MySQL database, but the exec command doesn't want to work no matter what I try... exec("mysqldump -h localhost -u user -p pass --opt DataBase > BACKUPS/backup.mysql") or die("Problem"); I have tried adding the full path to mysqldump, I have tried using my root access, I have tried using a different dir to store the files, changed permissions all sorts and nothing works. It always returns "Problem" and if I take out the or die then it just returns a blank screen. I also tried system () and that gave the same results. Anyone have any other ideas??? TIA __ -Ade ~~Good things come to those who wait~~ -- 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] PHP vs CGI Search ?
Hi, I know this question has been asked many times before so I am not asking again :-) What I am asking is how I can search the forum, is there a web based system that I can use to search??? TIA Ade -- 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] PHP Article... Comments??
Hi I had this article sent to me on another list I am subscribed to, just wondered what other people thought of it :-) http://www.securereality.com.au/studyinscarlet.txt Ade -- 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] Create Array??
Hi, If I have a value $num = 32; based on this how can I create an Array of numbers 1 - 32, something like this... Any suggestions?? I cannot use array_push as this has to work on a PHP3 server. TIA Ade -- 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] Create Array?? More
Ok, Thanks for the input, unfortunately it didn't help me solve my overall problem, so I will post that and see if anyone has any suggestions... I am basically displaying the Usernames from a .htpasswd file like this... $File="$Path$Directory1/.htpasswd"; $fd = fopen ($File, "r"); $Content = fread ($fd, filesize ($File)); $Content=ereg_replace ("\n",":", $Content); // Explode the file using : as seperator $MyContent = explode (":", $Content); // Count it up $LoU = count($MyContent)-1; // Close the File fclose($fd); for ($a=0; $a < $LoU; $a+=2) { printf("\n%s%s", $MyContent[$a], $MyContent[$a+=2]); } This is working perfectly, but what I would like to do is display a number next to each one, at the moment it displays... UserName1 UserName2 UserName3 UserName4 What I would like it to do is 1. UserName1 2. UserName2 3. UserName3 4. UserName4 I cannot figure a way to use $a because it has to skip by 2 in order not to display the encrypted passwords..any suggestions??? TIA Ade -- 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]