[PHP] Backup of MySQL database
Hi list!!! I want to make a script to do a backup of a MySQL DB and email me it. It is posible? Can anybody explain me how to do the backup? Thanks! Julian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php_network_getaddresses
Hey All, I get the following error: Warning: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /usr/home/roshi/htdocs/includes/rightcont_nanciesorg.inc.php on line 57 Warning: fopen("http://www.nancies.org/news/rss/","r";) - Bad file descriptor in /usr/home/roshi/htdocs/includes/rightcont_nanciesorg.inc.php on line 57 Error reading RSS data. I know I can resolve b/c from the local machine I can: $nslookup > www.nancies.org Server: ns1.netaxs.com Address: 207.106.1.2 Non-authoritative answer: Name:nancies.org Address: 207.8.144.57 Aliases: www.nancies.org Does PHP look on a different port than 53 for host name lookups? TIA, Sabre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php_network_getaddresses
> Try just pinging www.nancies.org from the command line. $ ping nancies.org PING nancies.org (207.8.144.57): 56 data bytes 64 bytes from 207.8.144.57: icmp_seq=0 ttl=64 time=0.047 ms 64 bytes from 207.8.144.57: icmp_seq=1 ttl=64 time=0.043 ms 64 bytes from 207.8.144.57: icmp_seq=2 ttl=64 time=0.036 ms 64 bytes from 207.8.144.57: icmp_seq=3 ttl=64 time=0.037 ms 64 bytes from 207.8.144.57: icmp_seq=4 ttl=64 time=0.047 ms nancies is local, so I'm not suprised that the pings came back ok. We did put up a firewall about a week ago that blocks pings from the outside though. Since everything is local though, I'm not sure why we would have this problem. Sabre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php_network_getaddresses
> > $ ping nancies.org > > PING nancies.org (207.8.144.57): 56 data bytes > > 64 bytes from 207.8.144.57: icmp_seq=0 ttl=64 time=0.047 ms > > 64 bytes from 207.8.144.57: icmp_seq=1 ttl=64 time=0.043 ms > > 64 bytes from 207.8.144.57: icmp_seq=2 ttl=64 time=0.036 ms > > 64 bytes from 207.8.144.57: icmp_seq=3 ttl=64 time=0.037 ms > > 64 bytes from 207.8.144.57: icmp_seq=4 ttl=64 time=0.047 ms > > nancies is local, so I'm not suprised that the pings came back ok. We did > > put up a firewall about a week ago that blocks pings from the outside > > though. Since everything is local though, I'm not sure why we would have > > this problem. > I'm not trying to be difficult, but you know that www.nancies.org is a > different resource from nancies.org, right? For instance, we do Not at all, I'd rather have you point something out that I might have missed :) www.nancies.org is an alias for nancies.org. Both point towards the same IP address. Just to check, I did a ping on it as well though with the same results as above. Any other ideas? Sabre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie needs compile
> I need to schedule to run a PHP script on server side, rather than invoke it > from browser. Is there any way to compile it to .exe so it can run on > Solaris/Apache environment? no such thing as .exe in Solaris ;) just "chmod 755" a file and it will execute. > If yes, can you help me know how? Thanks a great deal! If you want to schedule something to run, say, every 5 minutes, then you add it to your cron jobs. In FreeBSD, you have to edit /etc/crontab to do this, then restart cron. Inorder to execute a PHP script like you want (and I could be way off on this one), I would install lynx and make cron call lynx with a link to your .php file. Sabre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie needs compile
> He did say he did /not/ want to invoke it from a browser :) I didn't think that PHP could run w/o one though, so my idea was to use a text browser, have it run the script, then exit out. As I said, I was probably wrong ;) Sabre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Create Email POP accounts with PHP
Hello! I want to know how I can create email POP accounts from a script PHP. If somebody can help me, thank ahead of time! Regards! Julian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Create Email POP accounts with PHP
Hey Dan!!! This book is for sale I can't buy it! Can any body explain me how I can to create email POP accounts whith PHP without using vpopmail Thanks! Julian - Original Message - From: Dan Harrelson To: Julian ; [EMAIL PROTECTED] Sent: Friday, March 22, 2002 9:25 PM Subject: Re: [PHP] Create Email POP accounts with PHP I am a newbie and can't tell you how to do it, but I know that the book I am reading can! Chapter 27 is titled "Building a Web-based Email Service". The Book is title "PHP and MySQL Web Development" and I like it alot. It was recommended on the mysql.com. http://tangledweb.com.au/ -Dan --- Julian <[EMAIL PROTECTED]> wrote: > Hello! > > I want to know how I can create email POP accounts from a script PHP. > > > If somebody can help me, thank ahead of time! > > Regards! Julian > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/
RE: [PHP] Create Email POP accounts with PHP
Hi Jason!!! Explain me how to do it with qmail and sendmail, plese. Thank you! Julian - Original Message - From: Jason Wong To: [EMAIL PROTECTED] Sent: Saturday, March 23, 2002 4:00 PM Subject: Re: [PHP] Create Email POP accounts with PHP On Saturday 23 March 2002 21:40, Julian wrote: > Hey Dan!!! > > This book is for sale I can't buy it! > > Can any body explain me how I can to create email POP accounts whith PHP > without using vpopmail It would depend on what mail system you're using -- sendmail, qmail, postfix etc -- and any other 'add-ons' -- vpopmail, vmailmgr etc. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* That's odd. That's very odd. Wouldn't you say that's very odd? */ -- 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] CRONTAB
Hello to all !!! I write you because I have the following question: I am attempting execute automatically an script PHP, all the days at a certain hour. I configured the cron to executes it, but when it is executed, instead of working, I receive an email in my main account where say: /home/vipteam/public_html/distribuidor/mailf.php: echoNo tinterrumpir: command not found /home/vipteam/public_html/distribuidor/mailf.php: =: command not found /home/vipteam/public_html/distribuidor/mailf.php: =: command not found /home/vipteam/public_html/distribuidor/mailf.php: =: command not found /home/vipteam/public_html/distribuidor/mailf.php: line 10: syntax error near unexpected token `Rand(1 ' /home/vipteam/public_html/distribuidor/mailf.php: line 10: ` $codigo1 = rand(1,32767); ' I think that the code is not interpreted. I don't know what happen! Help, please! Regards! Julián -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CRONTAB
Hi Miguel!! Thank you for your help! My script run fine with: 0 0 * * * /usr/bin/php /path/to/my/script.php But I continue receiving an email each time that the script run that say: X-Powered-By: PHP/4.0.6 Content-type: text/html I don't understand it, because in my script I didn't put content of this type Do you know what is the problem now?? Regards and thank for your time!! Julian - Original Message - From: Miguel Cruz To: Julian Cc: [EMAIL PROTECTED] Sent: Friday, April 05, 2002 7:26 PM Subject: Re: [PHP] CRONTAB On Fri, 5 Apr 2002, Julian wrote: > I am attempting execute automatically an script PHP, all the days at a > certain hour. > > I configured the cron to executes it, but when it is executed, instead of > working, I receive an email in > my main account where say: > > /home/vipteam/public_html/distribuidor/mailf.php: echoNo tinterrumpir: > command not found If you are running from cron, you need to tell it to use the php interpreter. So either tell it in your crontab entry with something like: 0 * * * * /usr/local/bin/php /blah/blah/mailf.php Or channel it through your web server with something like this: 0 * * * * /usr/bin/lynx http://127.0.0.1/distribuidor/mailf.php Or put a comment in the first line of your PHP file that tells the shell to use PHP to run it: #!/usr/local/bin/php All of these paths are samples; you'll need to figure out where these things are on your system. miguel -- 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] CRONTAB
YES!! MY SCRIPT RUN AND I'M NOT RECEIVING ANY EMAIL! Thanks to all!! Specials thanks to Miguel and Dan!! Regards! Julian - Original Message - From: Analysis & Solutions To: PHP List Sent: Friday, April 05, 2002 9:44 PM Subject: Re: [PHP] CRONTAB On Fri, Apr 05, 2002 at 09:42:02PM -0300, Julian wrote: > 0 0 * * * /usr/bin/php /path/to/my/script.php > > But I continue receiving an email each time that the script run that say: > > X-Powered-By: PHP/4.0.6 > Content-type: text/html Those two lines are PHP's default output. Crontab, by default, sends output of programs to the user by email. You can change both behaviors by doing this: 0 0 * * * /usr/bin/php -q /path/to/my/script.php >> /dev/null 2>&1 Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- 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] mysql question
Hi!!! I want to know if there is a function to know which is the number of the row that I selected. Please, help me! Julian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE:[PHP] mysql question
Thanks James! It is the perfect answer for my cuestion!!! Regards! Julian - Original Message - From: James E. Hicks III To: Julian ; [EMAIL PROTECTED] Sent: Monday, April 08, 2002 5:12 PM Subject: RE: [PHP] mysql question Why don't you just increment a counter as you are retrieving them. mysql_select_db("some_DB") or die("DB not available"); $query = "select some_data from some_table"; $result = mysql_query($query); $rowcounter=0; while ($row=mysql_fetch_array($result)){ extract($row); $rowcounter++; echo("You are on Row $rowcounter wich contains the"); echo(" data $some_data for the field named some_data"); } James -Original Message- From: Julian [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 3:59 PM To: [EMAIL PROTECTED] Subject: [PHP] mysql question Hi!!! I want to know if there is a function to know which is the number of the row that I selected. Please, help me! Julian -- 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] Gettext on Windows
Hello, Has anyone successfully implemented gettext on windows? If so how do you go about creating po files and using the bindtextdomain function; Thanks
[PHP] ftp_put Problems
Hello, I need to use FTP to upload a local file to a server. The uploads must be done through FTP and not HTTP. Unfortunately, the example in the manual is not working for me. If someone has any suggestions I would really appreciate it. Thanks, Julian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
Maybe I should be more specific about what I am trying to do. I may be way off base in my approach. I want to upload using ftp a file from my local c drive (c:\somefile.text) to my server. I have been trying the ftp_put function example in the manual and it is failing. It reports "There was a problem uploading the file." Any suggestions would be greatly appreciated. Thanks, Julian "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Julian wrote: >> Hello, >> >> I need to use FTP to upload a local file to a server. The uploads must be >> done through FTP and not HTTP. Unfortunately, the example in the manual >> is not working for me. If someone has any suggestions I would really >> appreciate it. > > Not much information. There is not error checking in the example, try this > and tell us the output: > > $file = 'somefile.txt'; > $remote_file = 'readme.txt'; > > // set up basic connection > $conn_id = ftp_connect($ftp_server); > > if(!$conn_id) die("Could not open connection to $ftp_server"); > > // login with username and password > $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); > > if(!$login_result) die("Could not login as user $ftp_user_name"); > > // upload a file > if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { > echo "successfully uploaded $file\n"; > } else { > echo "There was a problem while uploading $file\n"; > } > > // close the connection > ftp_close($conn_id); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
i am trying to get a file from my local c drive to my server using something other than a form. thanks, julian "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sunday 26 September 2004 06:38, Julian wrote: >> Maybe I should be more specific about what I am trying to do. I may be >> way >> off base in my approach. >> >> I want to upload using ftp a file from my local c drive >> (c:\somefile.text) >> to my server. I have been trying the ftp_put function example in the >> manual >> and it is failing. It reports "There was a problem uploading the file." > > If the script is running on the server then yes you're way off base. > Remember > the ftp_*() functions operate relative to where the script is running. > > What exactly is it you're trying to do? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > -- > /* > Laughter is the closest distance between two people. > -- Victor Borge > */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
well, i suspect i am at a dead end. here is the layout of things. we want to put up an internet kiosk at certain thoroughbred auctions to allow people to send ecards as well as contact associates. we have a web cam on the kiosk and a partner came up with the idea of letting them send photos of themselves as well. the problem is i cannot find a way to use the form type FILE without giving the user access to everything on the kiosk computer. try as i might i cannot get around that "browse" button. so i thought i would try the ftp functions which i am totally unfamiliar with. i do truly appreciate the time you and others took to look into this. julian "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Julian wrote: >> i am trying to get a file from my local c drive to my server using >> something other than a form. > > Hmm, you can run an ftp server on your local machine and use php script on > the server to retrieve the files. http server will work just as well. Is > this what you want? > >> >> thanks, >> julian >> "Jason Wong" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>>On Sunday 26 September 2004 06:38, Julian wrote: >>> >>>>Maybe I should be more specific about what I am trying to do. I may be >>>>way >>>>off base in my approach. >>>> >>>>I want to upload using ftp a file from my local c drive >>>>(c:\somefile.text) >>>>to my server. I have been trying the ftp_put function example in the >>>>manual >>>>and it is failing. It reports "There was a problem uploading the file." >>> >>>If the script is running on the server then yes you're way off base. >>>Remember >>>the ftp_*() functions operate relative to where the script is running. >>> >>>What exactly is it you're trying to do? >>> >>>-- >>>Jason Wong -> Gremlins Associates -> www.gremlins.biz >>>Open Source Software Systems Integrators >>>* Web Design & Hosting * Internet & Intranet Applications Development * >>>-- >>>Search the list archives before you post >>>http://marc.theaimsgroup.com/?l=php-general >>>-- >>>/* >>>Laughter is the closest distance between two people. >>>-- Victor Borge >>>*/ >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5.5.0 final has been released!
Awesome work and the new design for the php.net website is also nice ;) Am 20.06.2013, 23:22 Uhr, schrieb Julien Pauli : Hello! The PHP Development Team would like to announce the immediate release of PHP 5.5.0. This release includes a large number of new features and bug fixes. A separate release announcement is also available. For changes in PHP 5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog. Release Announcement: http://www.php.net/release_5_5_0.php Downloads:http://www.php.net/downloads.php#v5.5 Changelog:http://www.php.net/ChangeLog-5.php#5.5.0 Thanks to all contributors that made this new version available. regards, David Soria Parra & Julien Pauli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems accesing an object via globals
I want to open a database connection at program initialization and use that very same connection via globals initilizating ( loading from db) other objects. Basically index.php $db=new mysqli(host,us,pass,db); if(mysqli_connect_errno()){ die('errordb conex'); } switch ($var){ display1: $obj=new obj_x(); $obj->load(); $obj->display(); break; display2: $obj=new obj_y(); $obj->load(); $obj->display(); break; } -- class obj_x{ function load(){ globals $db; $sql="select ); $ret=$->query($sql); // XX ... } } fails at XX with Warning: mysqli::query() [function.mysqli-query]: Couldn't fetch mysqli in class file line XX Any hints ??. I am using php 5.1.6 with linux/ubuntu. Thanks. JCG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problems accesing an object via globals
julian wrote: I want to open a database connection at program initialization and use that very same connection via globals initilizating ( loading from db) other objects. Basically index.php $db=new mysqli(host,us,pass,db); if(mysqli_connect_errno()){ die('errordb conex'); } switch ($var){ display1: $obj=new obj_x(); $obj->load(); $obj->display(); break; display2: $obj=new obj_y(); $obj->load(); $obj->display(); break; } -- class obj_x{ function load(){ globals $db; $sql="select ); $ret=$->query($sql); // XX ... } } fails at XX with Warning: mysqli::query() [function.mysqli-query]: Couldn't fetch mysqli in class file line XX Any hints ??. I am using php 5.1.6 with linux/ubuntu. Thanks. JCG there is typo. obviously I try to access via $db->query($sql); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problems accesing an object via globals
however this will work... p1.inc 1 var;; 9} 10 } 11 12 class obj { 13var $obj2=20; 14 15function f1(){ 16 global $db; 17 18 echo "\n".$db->fun2()*$this->obj2."\n"; 19} 20 } 21 ?> 1 #!/usr/bin/php -q 2 3 f1(); 13 14 ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] forget about this.
julian wrote: however this will work... p1.inc 1 var;; 9} 10 } 11 12 class obj { 13var $obj2=20; 14 15function f1(){ 16 global $db; 17 18 echo "\n".$db->fun2()*$this->obj2."\n"; 19} 20 } 21 ?> 1 #!/usr/bin/php -q 2 3 f1(); 13 14 ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] green bean question on singleton php5
Hi, I am implementing this class dbaccess{ static $db=null; static $othervar=33; private function dbaccess(){ dbaccess::$db= new mysqli("localhost",USER,PASSWD,DB); if(mysqli_connect_errno()){ echo "no way"; } } public static function GetDb(){ if(dbaccess::$db==null){ dbaccess::$db= new dbaccess(); } return dbaccess::$db; } } $db=dbaccess::GetDE(); $db->query(..); will fail...with Call to undefined method dbaccess::query() apparently $db is of type dbaccess... and thus has not does not have query implemented any hhelp appreciated. JCG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] green bean question on singleton php5
but that forces me to implement a large interface of functions that I prefer to avoid... the $dummy thing works... but I guess it is not "by the book". I would like to understand what am I missing fom the concept Thanks. JCG Daniel Brown wrote: On Jan 16, 2008 12:57 PM, julian <[EMAIL PROTECTED]> wrote: Hi, I am implementing this [snip!] I'm heading out to lunch, so double-check this for errors, but I rewrote your class. You'll have to add your fetch handlers and such. query(..); // Your query here. ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] green bean question on singleton php5
nope... only works if I change $dummy= new dbaccess(); and keep the rest . Thanks. ... hope it does not repeat... got undelivered... Eric Butera wrote: On Jan 16, 2008 12:57 PM, julian <[EMAIL PROTECTED]> wrote: Hi, I am implementing this class dbaccess{ static $db=null; static $othervar=33; private function dbaccess(){ dbaccess::$db= new mysqli("localhost",USER,PASSWD,DB); if(mysqli_connect_errno()){ echo "no way"; } } public static function GetDb(){ if(dbaccess::$db==null){ dbaccess::$db= new dbaccess(); } return dbaccess::$db; } } $db=dbaccess::GetDE(); $db->query(..); will fail...with Call to undefined method dbaccess::query() apparently $db is of type dbaccess... and thus has not does not have query implemented any hhelp appreciated. JCG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Try changing dbaccess to self inside the class. Look at this: http://us.php.net/manual/en/language.oop5.patterns.php Example#2 Singleton Function -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] green bean question on singleton php5
you are forcing the no instantiation via abstract, instead of hiding via private method constructor. You change the constructor for an init function. still the $dummy = new dbaccess (). looks like a simpler solution Thanks for your comments Jochem Maas wrote: julian schreef: Hi, I am implementing this try comparing this rewrite with your version: abstract class dbaccess { static $db = null; private static function init() { if (dbaccess::$db)) return; dbaccess::$db = new mysqli("localhost",USER,PASSWD,DB); if(mysqli_connect_errno()) throw new Exception('cannot connect to DB'); } public static function getDB() { self::init(); return dbaccess::$db; } } try { $db = dbaccess::getDB(); $db->query("SELECT `foo` FROM `bar` WHERE `qux`=1"); } catch (Exception) { die($e->getMessage()); } class dbaccess{ static $db=null; static $othervar=33; private function dbaccess(){ dbaccess::$db= new mysqli("localhost",USER,PASSWD,DB); if(mysqli_connect_errno()){ echo "no way"; } } public static function GetDb(){ if(dbaccess::$db==null){ dbaccess is a static class, you should not be constructing it here it! dbaccess::$db= new dbaccess(); } return dbaccess::$db; } } $db=dbaccess::GetDE(); $db->query(..); will fail...with Call to undefined method dbaccess::query() apparently $db is of type dbaccess... and thus has not does not have query implemented any hhelp appreciated. JCG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: green bean question on singleton php5
That very much make sense. I am indeed doing two assignments. I was just wondering how to call the constructor. The new statement was the only way I saw and it only worked in an assignment . I could not call dbaccess(); nor dbaccess::dbaccess();... Probably the easiest way is a mix of the solutions. Have an emtpy private constructor, and have the an init fucntion do the work so typing does not get mixed up. Thanks. Colin Guthrie wrote: Julian wrote: but that forces me to implement a large interface of functions that I prefer to avoid... the $dummy thing works... but I guess it is not "by the book". I would like to understand what am I missing fom the concept You made a critial error in the original implem. You effectively write dbaccess::$db twice. Your $dummy gets around this. See my previous post, but the real issue is this code flow: In GetDb() you do: dbaccess::$db= new dbaccess(); So firstly PHP creates calls the constructor. In the constructor of dbaccess you do: dbaccess::$db = new mysqli(...); So PHP will assign the mysqli object to the variable you want. PHP will then return from the contructor of dbaccess returning the dbaccess object itself, which is then assigned to dbaccess::$db, overwriting the mysqli object. Hope that explains why what you did was a bit wrong and that one of the solutions I proposed is what you want. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php+mail+TLS/SSL
Hi, I am using phpmailer currently to send email from my applications. My ISP is restricting the usage of email without SSL/TLS and my SMTP connections have started to fail... Any hints on the best approach to send email from php appplciations ?, I wish I could use my standard gmail/yahoo accounts like my desktop email program... Any help appreciated. Thanks. JCG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] open a secondary window/tab in the browser from php
Hi, I have an application that along filling in some forms, it produces a pdf file, as confirmation of all entered data. I want to send this pdf file to a different window/tab of the browser, so it is displayed and can latter be printed. In the mean time, the original window contains a confirmation message, to continue with the work flow. I would like to do this without use of JavaScript Any combination of headers ?? Any hints appreciated. JCG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] open a secondary window/tab in the browser from php
not html target, pdf window so it can be saved and printed separately form the application. Børge Holen wrote: On Monday 18 February 2008 13:59:11 julian wrote: Hi, I have an application that along filling in some forms, it produces a pdf file, as confirmation of all entered data. I want to send this pdf file to a different window/tab of the browser, so it is displayed and can latter be printed. html target? In the mean time, the original window contains a confirmation message, to continue with the work flow. I would like to do this without use of JavaScript Any combination of headers ?? Any hints appreciated. JCG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unlink images
Hello, I would like to delete a set of images right after they are displayed on the page using unlink. Unfortunately, with unlink the images are deleted before they display on the user's browser. Is there a way to do this? Thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fonts in dynamic images
Hi all, I have been creating some dynamic images, with text. Some fonts seem to work fine, but some give the right number of characters, but each character is just a square box. What's causing this. I know the fonts are there (there is an entirely different error message when the fonts are not there). I would just give up on them , but theres one font I like, that definately worked 6 months ag, but is 'doing the box thing' now Anyone have any ideas. Thanks in advance Jules -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] variable string names
Hi all, I have something thats been driving me mad for days I have: if ($where1 != '') { $whereArray = array_push($whereArray, $where1); } and I want to repeat for $where1 up to $where8 but rather than write it out 8 times, I'd rather use a loop for ($i=1; $i<=8 i++) { if ($where1 != '') { $whereArray = array_push($whereArray, $where1); } } but how can I change $where1 to $where2, $where3 etc using $i. nothing I try seems to work. Do I use eval? Thanks for any help given Jules -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP trace route?
Use passthru to run traceroute on the ip of interest, then output the results of that command, line by line, starting with the last line. J on 2/26/01 9:48 AM, Brandon Orther at [EMAIL PROTECTED] wrote: > > Hello, > > I am looking for a php trace route that I can have get the IP of the person > browsing the site and do a trace route from the server. Then I want to > reverse the results so It looks like they are doing a trace route on the > server rather than the server doing a trace route on them. > > Thank you, > > > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > ---- > -- Julian Wood Multimedia Developer University of Calgary -- 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] big database with php ?
Definitely something wrong with your setup, if a query takes as long as 2 hours. I could see maybe 2 seconds to return all 31000 rows, but why would you ever need all 31000 rows? Put a limit on it to say 20 or 30 and you'll get fast performance. If your columns are indexed, the order by won't take as long as you indicate. As for joins, mysql is very fast in my experience. Take this for instance, operating on several tables with about 2 rows: select a.description as project, b.phase, c.worktype, d.description, d.regular, d.ot, d.uid, d.sync, d.ot15, d.ot2, d.project_id, d.phase_id, d.worktype_id, DATE_FORMAT(d.date, '%a, %b %d, %Y') as date from project a, phase b, worktype c, hours d where week(d.date) = week('2001-02-03') and year(d.date) = year('2001-02-03') and d.project_id = a.code and d.phase_id = b.code and d.worktype_id = c.code and d.personnel_id = 1139 order by d.date asc; 22 rows in set (0.07 sec) A count for 1 col on the same table takes 0.01 seconds. This is on a slower machine than yours - but for the join it's only returning the important rows. I think that might be where you're interpreting the slow performance, unless you're missing indexes on the pertinent joins. Julian -- Julian Wood Multimedia Developer University of Calgary on 3/1/01 6:52 AM, Chris Lee at [EMAIL PROTECTED] wrote: > on a 45mb table with 31,470 rows mysql takes this long. > > mysql> SELECT stockno from products; > ... > 31470 rows in set (2.34 sec) > mysql> > > not exactly great performance, if I put two 'LIKE' statments and an 'ORDER BY' > clause then we're at 8 sec > > this is on a PII500 512mb ram linux.mysql 3.23.28 this is not a lightning fast > server, but I am not impressed with mysql speed. if you ever have todo any > table joins I would highly recommend against mysql > > people has 161 rows. > products has 31,470 rows > > select count(stockno), count(customernum) from products, people; > ... > 1 row in set (12.34 sec) > mysql> > > try adding a third table, oi. or a fouth, I timedout at nearly 2 hours with > four tables. postgres (7.1beta) could do the same four tables in less then > 0.9sec. > > I use mysql because I use mysql. I would like to use postgres but everyone > seems to use mysql and clients know the name. they request it. I hear problems > about un-stability of 7.0 on phpbuilder.com, are they warented? I am > interested in hearing strong customer testomonials for postgres or against it. > I have little info other then a few benchamrks I ran myself. > -- 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] Odd PHP/MySQL Question
select count(*), year from students group by year; on 3/1/01 12:07 PM, Kath at [EMAIL PROTECTED] wrote: > I have a user database where a year has to be put in. > > Now, I want to compile a list of each different year and how many users are in > that year. > > Is there a way to do this beyond coding for each year: > > SELECT * FROM students WHERE year = '1983' ? > > - Kath > -- 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] Re : [PHP] NETSCAPE screws QUERY STRING
Try printf("") J on 3/4/01 11:55 AM, Thomas Edison Jr. at [EMAIL PROTECTED] wrote: > > The urlencode() is working fine with an echo statement > & normal query string. > > But it's NOT working with complex query string in > printf() including $myrow[something] being picked up > by mySQL db. > > this works : > > > > this doesn't work : > > printf(" href=\"pro_page1.php3?title='urlencode($myrow[title])'\">") > > OR such combinations as given in the manual. I tried > out almost all!!! > > HELP > > T. Edison jr. > -- Julian Wood Learning Technologies and Digital Media University of Calgary -- 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] Re : [PHP] NETSCAPE screws QUERY STRING
Where is the string 'value+value2' coming from? $myrow[title]? If it is coming from the db (I'm guessing - it seems a little strange to me that this would be your title, but in this code we're discussing there is no other possible source), and it has slashes in it, you may need to use stripslashes to get rid of the slashes. Also, why are you using printf, but not formatting your string at all? Why don't you just use echo? I assume we're still dealing with this line of code: printf("") J on 3/4/01 12:20 PM, Thomas Edison Jr. at [EMAIL PROTECTED] wrote: > > Julian, > > i tried this out it's giving the single quotes in > the value... 'value+value2' > > and on the next page where i'm printing the > value...the backslashes are also being added in front > of single quotes : > > \'value value2\' > > where can i go from here? this has made the urlencode > function to work...only part left now... > > T. Edison jr. > > --- Julian Wood <[EMAIL PROTECTED]> wrote: >> >> Try printf("> > href=\"pro_page1.php3?title='".urlencode($myrow[title])."'\">") >> >> J >> >> on 3/4/01 11:55 AM, Thomas Edison Jr. at >> [EMAIL PROTECTED] wrote: >> >>> >>> The urlencode() is working fine with an echo >> statement >>> & normal query string. >>> >>> But it's NOT working with complex query string in >>> printf() including $myrow[something] being picked >> up >>> by mySQL db. >>> >>> this works : >>> >>> >>> >>> this doesn't work : >>> >>> printf(">> >> > href=\"pro_page1.php3?title='urlencode($myrow[title])'\">") >>> >>> OR such combinations as given in the manual. I >> tried >>> out almost all!!! >>> >>> HELP >>> >>> T. Edison jr. >>> >> >> >> -- >> Julian Wood >> Learning Technologies and Digital Media >> University of Calgary >> >> >> >> -- >> 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] >> > > > = > Rahul S. Johari (Director) > ** > Abraxas Technologies Inc. > Homepage : http://www.abraxastech.com > Email : [EMAIL PROTECTED] > Tel : 91-4546512/4522124 > *** > > __ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ -- Julian Wood Learning Technologies and Digital Media University of Calgary -- 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] Is it odd or even??? Optimize!!!
Clever. For those of us unfamiliar with bitwise ops, here's how this works: The bitwise and op (&) works on bits like this: dig1 dig2 Result 000 010 100 111 An even number's binary representation always ends with 0 (ie 12 = 1100) while an odd ends with 1 (ie 13 = 1101). So doing a bitwise & with 1 will only produce 1 if the last binary digit is 1 (ie an odd num), otherwise 0 (see table). And, like Nathan implies, this will be very fast (way faster than modulus), since you only ever deal with 2 bits of info. For an explanation of other bitwise operators, look here: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/bitwise.html J on 3/5/01 12:36 PM, Nathan Cassano at [EMAIL PROTECTED] wrote: > > You all are a bunch of un-optimizing novices. Just do some bit banging. > > i.e. > > if(1 & number){ > echo "$number is odd"; > }else{ > echo "$number is even"; > } > > > -Original Message- > From: Brandon Orther [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 05, 2001 12:18 PM > To: PHP User Group > Subject: [PHP] Is it odd or even??? > > > Hello, > > Is there an easy way to check and see if a number is odd or even? > > Thank you, > > > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Calling Perl from PHP -- Help --
I think you're looking for passthru (or perhaps system or exec). If your php is like this: and hello.pl is like this: #!/usr/bin/perl print 'Args:'.join(' ', @ARGV); Your web page will read: Args:yay You'll probably need to change the method of input (to use @ARGV instead of <>) on your Porter stemmer program to make it work properly. J -- Julian Wood Multimedia Developer University of Calgary on 3/5/01 11:53 PM, Matt Friedman at [EMAIL PROTECTED] wrote: > I'm stumped. I've searched all over and can't figure this one out. > > I have a perl script that waits for input on the command line. You type in a > string and it returns a string. > > I'd like to be able to this via php, since I can't rewrite the script in php, > since it's a little over my head. > > So, how do I open the perl script in php, send it some input and read the > output? > > Thanks, > Matt. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL problem - stumped
Well, PHP seems to think that $link is not working, so your db_connect() is in fact, the problem. You say you use db_connect several times in this script without problem - why do you keep connecting to the same database repeatedly in the same script - one connection will do for all your queries. HTH, Julian on 3/10/01 12:11 PM, John Vanderbeck at [EMAIL PROTECTED] wrote: > > > Ok, > > Well I got 3 replies saying that my use of && is incorrect, and that I > should use AND. This confused me for 2 reasons. First, is that I use && in > all my other SELECT queries, with no problems. In fact, the MySQL docs, > show the use of &&, not AND. Secondly, because if I had a bad query, it > should have given me some sort of error when I output mysql_error(). No? > > However, I did of course try changing it to AND instead of &&. But the > problem remains. Same error. > Any other ideas? > > - John Vanderbeck > - Admin, GameDesign > >> -Original Message- >> From: Rick St Jean [mailto:[EMAIL PROTECTED]] >> Sent: Saturday, March 10, 2001 2:09 PM >> To: PHP User Group >> Subject: Re: [PHP] MySQL problem - stumped >> >> >> At 01:58 PM 3/10/01 -0500, John Vanderbeck wrote: >> >> >> You are using && in your statement ... should be "AND" >> >> . >> >> >>> The following code is giving an me problems, I can't figure it >> out to save >>> my soul. The last line gives: >>> >>> Here is the code: >>> >>> $link = db_connect(); >>> $query = "UPDATE Users SET firstname='$firstname', lastname='$lastname' >>> WHERE username='$user' && password='$password'"; >>> $result = mysql_query($query, $link); >>> $err = mysql_error(); >>> echo "Errors:".$err; >>> $rows = mysql_affected_rows($result); >>> >>> And here is the output: >>> Errors: >>> Warning: Supplied argument is not a valid MySQL-Link resource in >>> //*//**..***/db.php on line 147 >>> >>> Line 147, is the last line in the above snippet. I cleared out the path >>> name for security, no offense intended :) >>> >>> Now, I KNOW that the db_connect() function is not the problem, >> as I use it >>> in many other places in this script with no errors. What am I missing? >>> >>> - John Vanderbeck >>> - Admin, GameDesign >>> >>> -- Julian Wood Learning Technologies and Digital Media University of Calgary -- 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] JDBC? Was: [PHP] Hello! PHP
I'm not quite sure what you mean. You use a JDBC driver to connect your java program to an sql db. PHP has an abstracted db layer which parallels the function of JDBC for the php environment. PHP also has db-specific API's, which tend to be somewhat faster and can take advantage of specific db features. Does that help? J on 3/16/01 7:36 PM, andrew at [EMAIL PROTECTED] wrote: > > On a related noted, does PHP have JDBC support? > > I'm unable to find anything about this - anyone know if it's possible? > > regards, > andrew > > -- Julian Wood Learning Technologies and Digital Media University of Calgary -- 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] JDBC? Was: [PHP] Hello! PHP
No - PHP has it's own drivers, just like perl has it's own (DBI), and java has it's own (JDBC). As for PHP's abstraction layer, PHP comes built with one for dbm style db's (http://www.php.net/manual/en/ref.dba.php), but not for sql type db's. Several abstraction layer projects for sql db's have been mentioned on the list - I have never used any of them - just the db-specific API's. Try ADODB - there's a tutorial here: http://php.weblogs.com/adodb_tutorial J on 3/17/01 1:10 PM, andrew at [EMAIL PROTECTED] wrote: > > actually, just wondering if PHP can use JDBC drivers to connect to > databases. what is the 'abstracted db layer' that you mention? > > regards, > andrew > > > On 3/17/01 2:52 PM, "Julian Wood" <[EMAIL PROTECTED]> wrote: > >> >> I'm not quite sure what you mean. You use a JDBC driver to connect your java >> program to an sql db. PHP has an abstracted db layer which parallels the >> function of JDBC for the php environment. PHP also has db-specific API's, >> which tend to be somewhat faster and can take advantage of specific db >> features. Does that help? >> >> J >> >> on 3/16/01 7:36 PM, andrew at [EMAIL PROTECTED] wrote: >> >>> >>> On a related noted, does PHP have JDBC support? >>> >>> I'm unable to find anything about this - anyone know if it's possible? >>> >>> regards, >>> andrew >>> >>> >> -- >> Julian Wood >> Learning Technologies and Digital Media >> University of Calgary >> >> > > -- Julian Wood Learning Technologies and Digital Media University of Calgary -- 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 - select column
Hi all, Given that the resultset from a mysql query is a 2-d array (of sorts - I don't know), if I retrieve only a single column, is there an easy way to grab it as a linear array? For example - old way: $uids=array(); $res = mysql_db_query("db", 'select uid from tbl;', $link); while ($row = mysql_fetch_row($res)) { array_push ($uids, $row[0]); } It seems a little redundant to make another array if one already exists. The end idea is to get to a list of uids ($uid_str = join(',',$uids)) that can be used in a second query to the db (to make up for the lack of subqueries in mysql). I guess what I'm asking - can you do a join on the mysql resultset array somehow. I know in the perl DBI you can get a column of results, but can't find it in php. Thx. J -- Julian Wood Learning Technologies and Digital Media University of Calgary -- 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] Add data to three tables at once from one form
> That's it. There's nothing special to do. Except if one insert fails and the others succeed, you run into a bit of sync trouble. This is what transactions are for. You might want to consider a BDB table type, which supports transactions, then you have the option to rollback the other inserts if one of them fails. Julian on 4/18/01 6:33 PM, Steve Werby at [EMAIL PROTECTED] wrote: > > "Fates" <[EMAIL PROTECTED]> wrote: >> I know how to add data to one table but how do I add data to three >> tables from one form? >> >> I want to do this with just one form and on one web page so it doesn't >> post to another page. >> >> How do I set up the insert statement? >> >>$query = "INSERT INTO $table VALUES ('$menu_id', '$server', >> '$menunumber', '$menuname')"; >> >> $result = mysql_db_query($dbname, $query); > > Add two more sets of statements like those you have for the first query. > That's it. There's nothing special to do. > > -- > Steve Werby > President, Befriend Internet Services LLC > http://www.befriend.com/ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Handling Macintosh filenames in PHP
On a Mac it is just diskname:folder1:folder2:blah.txt The colon is the path delimiter, and is the only illegal character in a mac path. But I'm most curious as to why you would need this. Presumably you're writing your client in a web browser? In that case you're never really exposed to the peculiarities of the client filesystem. And if you're writing a network client, this would be taken care of by the API. Julian on 4/19/01 7:52 PM, Shawn Reed at [EMAIL PROTECTED] wrote: > > Greetings all, > > I'm currently in the middle of developing a rather large piece of software > written in PHP. I'll spare you the details, but essentially it is a glorified > FTP client. The goal here, of course, is to develop a client that will work > on any platform. In theory, this SHOULD work, because PHP runs server-side, > therefore eliminating any problems that would normally arise from differences > between the various platforms. > > However, it occurred to me that there isn't really a way (that I know of) to > directly address a specific filename on a Macintosh as there is in other > operating systems. For example, in Windows I could type > C:\WINDOWS\SYSTEM\BLAH.EXE or in Unix I could type /var/spool/mail/whatever > ... but is there a way to do such a thing on a Mac? Can you directly address > a file several levels deep in the filesystem without using the MacOS interface > itself to do so? The project I'm doing relies on the ability to do just that, > and it would appear that I've hit a bit of a snag. > > If anyone can offer any suggestions or advice, I'd really appreciate it. > Thanks in advance. -- Julian Wood Learning Technologies and Digital Media University of Calgary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL Query not working?
You might also want to remove the comma after "url = '$url'" and try an echo mysql_error($link) to see what the problem is. Julian on 5/14/01 5:46 PM, Peter Houchin - SunRentals Australia at [EMAIL PROTECTED] wrote: > change it to > > $sql = "UPDATE CLASS_ADS > SET client_id = '$client_id', date = '$date', category = '$category', > title = '$title', description = '$description', contact_name = > '$contact_name, contact_number = '$contact_number', email = > '$email', url = '$url', WHERE client_id = '$client_id' "; > > also if a MySQL query doesn't work I always try it on the command line :) > > > Peter Houchin > [EMAIL PROTECTED] > = >_ __ /\ > /_/_/_\/ |_/ \ > /_/_/___ __ __ __ / \ > \_/_/_\ /_/ /_/ /_/ /_/ \ _ / > ___\_\_\/ /_/_/_/ /_//\/_/\_/ \/\_/ > \_//_/_/ /_/_/_/ /_/ \/_/v > > /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ > /_/_ _/_/ __ __ __ /_/ __ __ > /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\/_//_/_/_/ > /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\ > /_/\_\/_/_/_/ /_/ \/_/ /_/ /_/\_\/_/_/_//_/_/_/ > = > Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755 > * We rent the dot in .COM! ** > > > -Original Message- > From: Laurie Landry [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 9:23 AM > To: [EMAIL PROTECTED] > Subject: [PHP] MySQL Query not working? > > > Hi, I've got this sql setup where > > $sql = "UPDATE CLASS_ADS > SET client_id = \"$client_id\", date = \"$date\", category = \"$category\", > title = \"$title\", description = \"$description\", contact_name = > \"$contact_name\", contact_number = \"$contact_number\", email = > \"$email\", url = \"$url\", WHERE client_id = \"$client_id\" "; > > and of course the following: > > $sql_result = mysql_query($sql) > or die("Couldn't execute query."); > > which when I test the page, it tells me it couldn't execute the query. > > I hope the information above is enough for someone to help me pinpoint where > I went wrong. > > (all the fields in the named table in the database is set accordingly with > one thing: the client id number is autogenerated by the database, so I'm not > sure if the client_id should be there.) > > Thanks in advance: > > Laurie M. Landry > Design & Development > > www.lmlweb.com > [EMAIL PROTECTED] > > T: (604) 872-6915 > F: (425) 732-1547 > -- 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] Mac IE 5.0 upload problem
I don't know what your problem might be, but there is nothing wrong with the file upload on Mac IE5. We use it all the time, in connection with both perl and php server-side and there is no problem. You do have to make sure the file you upload is essentially flat (ie no resource fork, since that will be stripped) but most file formats are flat these days anyway. I'm not sure about Quark. IE 4.5 should *not* be uploading in MacBinary, so I guess that's a bug they fixed for 5.0. See if you can upload a gif or a jpeg file and retrieve it properly. There shouldn't be a problem. Julian on 5/18/01 6:57 PM, Jason Lam at [EMAIL PROTECTED] wrote: > > Would any Mac expert help me out with this one. > > I have created an upload script with works fine for PC file and Mac files > with IE 4.5, but it just would not work with IE5.0 > > Whenever I upload file with IE 5.0, after it gets to the server, the size > becomes smaller by few hundred bytes, this ruin the file. If I download the > file to a mac again, it becomes a white icon and cannot be opened. The > $file_type tells me that it is "application/octet-stream". But on the other > hand, doing the same thing on IE 4.5 will make the filesize larger by a few > hundred bytes when it arrive at the server (I think the resource fork is > included) and the upload file type is "application/x-macbinary". Anyone know > how come IE5.0 seems to lost those bytes? Is it losing the resource fork? Do > I have any control over what the browser will upload? BTW, I was testing > with some Quark Express file. > > Any help is appreciated. > > Jason Lam > > > -- Julian Wood Learning Technologies and Digital Media University of Calgary -- 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] Problems uploading Files
Sebastian, Apache is running as a user, usually nobody:nobody, or sometimes www:www. That user is trying to move the file when you do the move in php. When you login through an ftp client, a different user is doing the move (you). You need to make sure that the user nobody has enough permissions on your target directory to do the move. Depending on how locked down you want it, there are several options: rwx for owner only, make the owner/group of the directory nobody. rwx for group - change the directory's group to nobody, or add nobody into another group (along with, for instance, yourself) and make that directory belong to this new group. There are several more ways, but you probably want to keep away from 777 permissions on the directory if possible. John - you want to do what Sebastian is doing. Check out Chapter 19. Handling file uploads in the php manual. It has everything you need to get going. Julian -- Julian Wood Multimedia Developer University of Calgary on 3/22/01 11:28 AM, John Almberg at [EMAIL PROTECTED] wrote: > > Hello Sebastian, > > What a timely posting! I am trying to figure out how to allow a user (using > any internet-connected pc) to upload a file to my PHP-enabled server. I am > trying to use PHP and the FTP functions, but can't figure out how to address > the file on the user's machine. Any hints from anyone as to how to do this? > Or am I on the wrong track, altogether? Someone else suggested that I use an > HTML 'upload', but I can't find anything about this in my HTML > documentation. > > Any help much appreciated!!! > > John > >> -Original Message- >> From: Renzi, Sebastian [mailto:[EMAIL PROTECTED]] >> Sent: Thursday, March 22, 2001 1:18 PM >> To: PHP General List >> Subject: [PHP] Problems uploading Files >> >> >> Hello again ! , i have a script that uploads a file , when i use the >> function move_uploaded_file() an error raises ,"Permission denied ." >> ,but if i upload the same file thru an ftp client it works correctly ! >> >> >> Sebastián Renzi >> Consultoría & Desarrollo de Sistemas. >> CODES S.A >> >> -- 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] Post a form within a running php-script
A class which allows you to post from within a php script and retrieve the results: http://px.sklar.com/code-pretty.html?code_id=313 Julian On Sunday, July 8, 2001, at 11:22 PM, mike cullerton wrote: > > on 7/8/01 11:17 PM, Bob Horton at [EMAIL PROTECTED] wrote: > >> What if someone wanted to reply to a form but the form was expecting >> the >> information to arrive using the POST method (and wasn't explicitly >> PHP)? >> >> Is there any way to do it if you want to submit to a POST method >> form? Or >> some way to simulate the entering of the information and clicking of >> the >> submit button? >> > > i'm not sure if this is what you are asking, but i can have an url like > http://mysite.com/?submit=click_me&opt=my_option > > and refer to those inside my program as $submit and $opt > > > -- mike cullerton > > > > -- > 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] > -- Julian Wood Multimedia developer University of Calgary -- 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] regex question
I'm trying to parse an existing html file using php. I need to use regex to find the first (and only the first) occurance of and the last (and only the last) occurance of in a string. They will be replaced with ||. example of a string: blah blah some stuff that i need to get blah blah blah. needs to become: blah blah ||some stuff that i need to get|| blah blah blah. so the following is what i need. //replace outer tags with || $string = ereg_replace ("Some regex that only finds the first ","||",$string); $string = ereg_replace ("Some regex that only finds the last ","||",$string); //take out remaining (inner) tags. $string = ereg_replace ("","",$string); $string = ereg_replace ("","",$string); thanks Julian -- 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] assigning a part of the name of a variable with another variable before php replaces it with the value
To answer your question: $postfld = $HTTP_POST_VARS[$fname[$i]]; should work. BTW, I just use something like: if ($client) { // or in your case: if (${$fname[$i]}) // code to be evaluated if $client exists and is not 0, not null/void/nil, and is not an empty string } J Matthew DeChant wrote: > Specifically, > > If I have 3 HTTP_POST_VARS: > > HTTP_POST_VARS["client"] = test1 > HTTP_POST_VARS["directory"]= test2 > HTTP_POST_VARS["password"] = > > and I don't know the names of the vars ahead of time, how would I run a > check to see if they exist and then get the specific POST_VARS's value. This > is what I've got so far: > > $squery = "select * from $db where "; > $qh = fw_query("select * from $db"); > $fields = odbc_num_fields($qh); > for ($i=1;$i<=$fields;$i++) { > # assign $fname the possible field names in the database > (client,directory,password) > $fname[$i] = odbc_field_name($qh,$i); > # assign $postfld the variable name, ie. $HTTP_POST_VARS["client"] > $postfld = $HTTP_POST_VARS["($fname[$i])"]; > # check that it exists and is not blank > if (isset($postfld) AND ($postfld != "")) { > $value[$i] = $postfld; > $squery.= "$fname[$i] like $value[$i] AND "; > } > } > # pop last AND > $squery= substr($squery, 0,-5); > > so how do you make this work: $postfld = $HTTP_POST_VARS["($fname[$i])"]; > > thanks, > > -m > > -- > 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] another REGEX question
hahah that had two interesting effects the first was that it left the < > and the second was that it turned off all the highlighting in my editor due to the "?>" any idea how to include the braces in the match and perhaps not using the ?> string for the sake of convenience :) Julian 8/2/01 5:19:03 PM, "Jack Dempsey" <[EMAIL PROTECTED]> wrote: >Try >$str = preg_replace("", " ",$str); > >jack > >-Original Message- >From: Julian Simpson [mailto:[EMAIL PROTECTED]] >Sent: Thursday, August 02, 2001 5:16 PM >To: [EMAIL PROTECTED] >Subject: [PHP] another REGEX question > >I have a string can look like either of the following: >some stuff >some stuff > >I want to use eregi_replace to take out the first p tag whether it be > or with a space > >I assumed that $str = eregi_replace ("", " ",$str); >but it matches the entire string and thus turns the whole string into >one space. >aparently regex will match the biggest possible match rather than the >smallest >my question is how do i get it to match the smallest. > >thanx in advance.. > >Julian > > >-- >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] another REGEX question
I have a string can look like either of the following: some stuff some stuff I want to use eregi_replace to take out the first p tag whether it be or with a space I assumed that $str = eregi_replace ("", " ",$str); but it matches the entire string and thus turns the whole string into one space. aparently regex will match the biggest possible match rather than the smallest my question is how do i get it to match the smallest. thanx in advance.. Julian -- 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] myPhpAdmin/mysql/php/ Problem
who's fault is this?: I have a table 'cdrequest' it has columns 'albumfill' and 'releasedatefill' among others when i do the following query with myphpadmin update cdrequest set albumfill = "hot shots II", releasedatefill = 20010708 where requstID = 2; i get: You have an error in your SQL syntax near '\"hot shots II\", releasedatefill = 20010708 where requstID = 2' at line 1 I can't see any reason for the error. part 2: when I flip to properties for the cdrequest just to make sure i'm spelling the columns corectly and cut and paste the exact same query on that page IT WORKS Why would it work on that page but not the other. both are supposed to be places where you can enter a normal sql query.. It also doesn't work in my PHP script which is where I really want it to work. What am I missing?? thanx Julian -- 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] Script timeout
I have a script which has to do a *lot* of work. In fact, it times out after 300 seconds, but is only about half done at that point. So I tried using set_time_limit(0) to no avail (php is *not* running in safe mode). So next I tried this directive in the apache config file: php_value max_execution_time 12000 (and various other values too). Now this changed the value of the constant correctly as reported by phpinfo(), but not as reported by get_cfg_var(max_execution_time), which still reported the default 30s. Empirically, the script would still time out at exactly 300 seconds, as before. So, any idea what is going on? Why timeout at 300s instead of the 30s or the 12000s which are the only two values reported? Any other workarounds? This is php 4.0 Thanks, J -- Julian Wood Programmer/Analyst University of Calgary -- 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] Script timeout
Well just to follow up, Apache was the culprit. There is an Apache timeout directive that was set to 300 s that I somehow missed on my first glance. The things that timeout, as far as I know, are PHP, Apache, and several commands within PHP (such as fsockopen()). The Apache directive is called Timeout, conveniently enough. It actually indicates the amount of time between successive TCP packet transmissions before a timeout occurs, which threw me for quite a loop. I could make a script which took 20 minutes to complete and get no timeouts anywhere, so I was convinced there was something wrong with my code. The difference was that this 20 min script outputted data along the way, so no timeouts ever occurred. The problem script didn't output anything until it was finished processing. Christian hit it on the nail. You can set the php timeout within the apache config file like so: php_value max_execution_time 120. This time is not real time, but the time the script actually gets access to cpu resources, or something like that. In my case, a setting of 30 was about 300 s. I don't know if the browser itself will ever timeout as long as it makes the initial handshake. J On Thursday, August 23, 2001, at 09:43 AM, Johnson, Kirk wrote: > >> Why timeout at 300s instead of the 30s or the 12000s which >>> are the only two values reported? >> >> Looks like some HTTP timeout, i.e. either Apache or the browser is >> getting bored. Try outputting something from time to time. > > Can anybody point me to information on all the possible HTTP timeouts > there > are (Apache, browser, ???), or care to discuss it here? We occasionally > see > "timeouts" that are not due to PHP, and I'm wondering where they are > coming > from. > > TIA > > Kirk > > -- > 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] > -- Julian Wood Programmer/Analyst University of Calgary -- 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] Data duplication in databases
Hi, Don't know if this is the best place to ask, but I thought I would give it a try. I was just wondering if anyone knows of any databases which deal with data duplication (at a low level). Say I have two (or ten) identical records, does anyone know of any databases which would only keep one copy of the data and use references for the other records? Does this work if 7 out of the 8 columns (for instance) are identical (ie the primary key is different but everything else is identical). Do such db's exist? Or do they all do this? Or am I just dreaming? J -- Julian Wood Programmer/Analyst University of Calgary -- 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] Re: Data duplication in databases
The only problem is detecting that the data is identical in the first place. If I have to do a select with 7 AND statements to see if I have identical data, I'm going to take a huge performance hit. I was hoping this had been done at a very low level, but it doesn't look like it. Maybe it's just as unrealistic at a low level, but I could swear I had heard of this feature before. Oh well. J PS. I didn't mention this before, but a link table (ie a relational structure) is not possible in my situation. On Wednesday, August 29, 2001, at 01:47 PM, james wrote: > > Julian, > > I am not aware of any databases smart enough to decide to create > references > for rows whose data is identical to an existing row. If the duplicate > data > is creating resource issues, there's a couple things that you can do to > eliminate the duplicate data. Probably the easiest would be, in the > case of > varchar data, to add a column for a row number. If the data to be > inserted > is identical to data in a row that's already in the database, an encoded > reference to the row number of the row with the original data could be > stored. That way, you're just storing the reference to the original > data. > > Example: > > RowNum ProdNum Revision Description_varchar > 455333101 > XXXYYYXXXYYYXXXYYYXXXYYYZZZ > 873245102 <<-455333->> > 934532103 <<-455333->> > > If you don't want to do the encoding thing, you could create a "link" > table > to accomplish the same thing. > > HTH, > James Potts > > > "Julian Wood" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> >> Hi, >> >> Don't know if this is the best place to ask, but I thought I would give >> it a try. >> >> I was just wondering if anyone knows of any databases which deal with >> data duplication (at a low level). Say I have two (or ten) identical >> records, does anyone know of any databases which would only keep one >> copy of the data and use references for the other records? Does this >> work if 7 out of the 8 columns (for instance) are identical (ie the >> primary key is different but everything else is identical). Do such >> db's >> exist? Or do they all do this? Or am I just dreaming? >> >> J -- Julian Wood Programmer/Analyst University of Calgary > > > > -- > 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] limiting rows and pages like google
It's not too hard to do the next/previous through all your results, as has been shown by several people. What is a little trickier, at least when using mysql and trying to take advantage of the limit clause, is how to display how many results you have (ie 1 to 10 of 107 results). If you use the limit, you can't get the total number of rows, without doing a second search sans limit. It's also harder to do the next link, because you don't necessarily know if there are any more rows (imagine you are displaying 10 rows at a time, you are on page 3 and there are 30 total rows). Conversely, if you do a single query without the limit, then you're doing a slower search (limiting a search is way faster), and I'm not sure of the implications of the full result set residing serverside - maybe higher memory requirements. So what do people do to take advantage of limit? Two queries or a single query? Any other solutions? Any more insights on how limit works? Julian On Wednesday, September 12, 2001, at 10:16 PM, Adrian D'Costa wrote: > > Hi, > > I am trying to find out the the best way to do the following: > > I have a script that select records from a table. The problem is that I > need to limit the rows to 20. I know that I can use limit 20. But > what I > want to do is give the view a link to the next 20 till all the records > are > shown. What I don't know is how to maintain the search query and I want > to use the same script. > > The logic would be to check if the script is called the first time, then > the sql statement would be select travel.*, city.city from travel, city > where travel.cityid=city.id limit 0,20. > The second time or based on what has been selected on the page (1-20, > 21-40, etc) add that to the sql statement. My question is how? > > Can someone guide me or give me some example. > > TIA > > 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] > -- Julian Wood Programmer/Analyst University of Calgary -- 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] Am I being hacked?
I set up a simple form to save comments on my webpage, and after just one day of going live, i'm getting weird comments up like this declare @q varchar(8000) select @q = 0x57414954464F522044454C4159202730303A30303A313027 exec(@q) I don't recognise this code - is this an attempt to do something nefarious, or nothing I should worry about? Anybody know what this means? Thanks so much for reading Jules -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] confirmation of what functions open_basedir will restrict?
Hi all, I'm an ex-PHP programmer turned PHP sysadmin. I read the "core php.ini" documentation and wanted to confirm what functions exactly open_basedir will restrict. "Examples" are made of fopen() and gzopen() -- what else is there? Will require_once() and include() be unaffected? I assume those are restricted by virtue of include_path. - Julian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Include/Require limit?
Hi, I use the pretty large Library PHP Image Workshop (http://phpimageworkshop.com/) at my project. It is about 75,5 KB. Everything works fine but if I try to include a 15 KB file with country codes, it fails. With the other files I easily get over 100 KB inclusion size, so my question; Is there a size limitation for include? Best regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include/Require limit?
Hi,it outputs a corrupt image (I think the function imagepng)Am 30.05.2013, 11:17 Uhr, schrieb Alex Pojarsky :Hey.Afaik - only in case if your PHP process instance exeeds allowed memory limit.Other then this - explain how does it fail exactly. Any error messages? Errorous behavior? On Thu, May 30, 2013 at 12:49 PM, Julian Wanke <billa...@gmx.at> wrote: Hi, I use the pretty large Library PHP Image Workshop (http://phpimageworkshop.com/) at my project. It is about 75,5 KB. Everything works fine but if I try to include a 15 KB file with country codes, it fails. With the other files I easily get over 100 KB inclusion size, so my question; Is there a size limitation for include? Best regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Erstellt mit Operas E-Mail-Modul: http://www.opera.com/mail/
Re: [PHP] php links doest work when im using mod rewrite
Try to add RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d that should exclude existing files and directories from rewriting... Am 01.06.2013, 22:39 Uhr, schrieb Farzan Dalaee : i starting to use mod rewrite but all my images or js links doest work my current query string is: index.php?r=blog&page=2 i want to change it with this: /blog/2 this is my .htaccess file RewriteEngine On RewriteRule ^([^/]*)/([^/]*)$ /framework/?r=$1&page=$2 [L] but none of my js or css cant find i need a way with php to make urls thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php links doest work when im using mod rewrite
localhost means the files are stored on your computer so I can't access them ;)Wait, you are trying to change the image directories? I'm a bit confused.Am 01.06.2013, 22:44 Uhr, schrieb Farzan Dalaee :thanks for answer but it doesnt work404 Not Found - http://localhost/framework/blog/files/upload/images/ but my images folder in:http://localhost/framework/files/upload/images/ On Sun, Jun 2, 2013 at 1:11 AM, Julian Wanke <jswp...@gmx.at> wrote: Try to add RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d that should exclude existing files and directories from rewriting... Am 01.06.2013, 22:39 Uhr, schrieb Farzan Dalaee <farzan.dal...@gmail.com>: i starting to use mod rewrite but all my images or js links doest work my current query string is: index.php?r=blog&page=2 i want to change it with this: /blog/2 this is my .htaccess file RewriteEngine On RewriteRule ^([^/]*)/([^/]*)$ /framework/?r=$1&page=$2 [L] but none of my js or css cant find i need a way with php to make urls thanks -- Erstellt mit Operas E-Mail-Modul: http://www.opera.com/mail/
Re: [PHP] Using Table prefixes
A database for each client? Isn't that over-powered? If you have 1000 clients, you would loose the overview over your databases... Am 08.06.2013, 21:46 Uhr, schrieb Tedd Sperling : On Jun 8, 2013, at 3:00 PM, Ashley Sheridan wrote: dealTek wrote: I can see the basic need for a table prefix in a case where you may use one mysql database for several projects at once so as to distinguish tables per project like... -snip- however I was told a long time ago to use a prefix "tbl_" like tbl_Mytable but I don't really see much need for this by itself ... Am I missing something? I think that's a pattern that people use to distinguish their tables from views, etc, but personally I find it a little pointless. It doesn't really help in any way, and just means more typing. Using a prefix for a set of tables in one db where you might have several things using the db (i.e. some hosting limits the databases you can have) makes sense, and especially so if you name it sensibly as in your first example. Thanks, Ash I agree, but more than that I also set up databases specifically for clients such that all the tables in them are related to the client and not each other, such as: client1_db contacts invoices etc and client2_db contacts invoices etc As such, the "tbl_" prefix is not needed. Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com -- 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] Using Table prefixes
Tell this the facebook, google or nsa data team ^^ Am 10.06.2013, 16:15 Uhr, schrieb Tedd Sperling : On Jun 8, 2013, at 4:17 PM, Julian Wanke wrote: A database for each client? Isn't that over-powered? If you have 1000 clients, you would loose the overview over your databases... What -- people have more than one client?!? My thoughts: A client is like a girlfriend -- if you have too many, things can get real ugly, real fast. If you have over 10 clients (let alone 1000), then you're probably overworked and not doing your best for each. My advise -- raise your rates until you narrow those clients down to a manageable size. Both you and your clients will be happier. At least, that's been my experience -- YMMV. Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com -- 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] Using Table prefixes
There servers are so good configured, that they don't need much maintainance. Facebook has 1,11 Billion Accounts. If we divide this through 1000 members per data team member they need 1 Million data team mebers, each of them has a salary which I would say is about 2000$. That means they have to pay 2 Billion US$ (!) per month to the data team which is very unrealistic. I know such great companies are a bad example but my opinion is that a system should be as scalable as possible. Am 10.06.2013, 20:16 Uhr, schrieb Tedd Sperling : Hi: I am sure they do not turn over a 1000 clients to a single person. Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com On Jun 10, 2013, at 2:11 PM, Julian Wanke wrote: Tell this the facebook, google or nsa data team ^^ Am 10.06.2013, 16:15 Uhr, schrieb Tedd Sperling : On Jun 8, 2013, at 4:17 PM, Julian Wanke wrote: A database for each client? Isn't that over-powered? If you have 1000 clients, you would loose the overview over your databases... What -- people have more than one client?!? My thoughts: A client is like a girlfriend -- if you have too many, things can get real ugly, real fast. If you have over 10 clients (let alone 1000), then you're probably overworked and not doing your best for each. My advise -- raise your rates until you narrow those clients down to a manageable size. Both you and your clients will be happier. At least, that's been my experience -- YMMV. Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic authentication usage
I think that the problem here is, that the unset of the $_SERVER["PHP_AUTH_USER"] variable is not affecting the client's browser. If you've got a directory protection, the browser needs a restart to show the login dialog before. I may be wrong because I'm using forms normally but the Authentification cannot be reset so easily... Am 10.06.2013, 22:28 Uhr, schrieb Jim Giner : Trying to learn how this works for a simple security need I have. Nothing serious, hence this experiment. My code: if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'You have chosen not to signin'; echo "Click here to go back to the menu"; unset($_SERVER['PHP_AUTH_USER']); unset($_SERVER['PHP_AUTH_PW']); unset($_ENV['PHP_AUTH_USER']); unset($_ENV['PHP_AUTH_PW']); exit; } else { echo "checking creds"; if ($_SERVER['PHP_AUTH_USER'] <> "validuser") { unset($_SERVER['PHP_AUTH_USER']); unset($_SERVER['PHP_AUTH_PW']); unset($_ENV['PHP_AUTH_USER']); unset($_ENV['PHP_AUTH_PW']); echo 'You have entered invalid information.'; echo "Click here to go back to the menu"; exit(); } } (if we get here we have signed on) (continue on with script) *** My problem is trying to remove the invalid credentials (unsets) so that when the user attempts to access the page again, the signin dialog gets displayed. On my second attempt I always get the "invalid" path and never get a chance to re-enter the credentials. What am I missing (besides it's a lousy security solution)? Can one NOT unset a SERVER variable? How does one get around that in this case if so? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic authentication usage
I just mentioned that as an example. For this authentification the server sends a Authorization header. The client's browser requests the credentials from the user and save them in the RAM. Now the client's browser sends the credentials to the server. And what's important: The browser sends the credentials in each further request from now. So the browser stores the username and password for the session in the RAM and they can't be changed or deleted from the server's side. In fact the authorization works similar to cookies with the difference, that cookies can be set server-side and the HTTP authorization can't. That's the reason why you can't unset the invalid credentials, if entered one time the browser will send them in each request, it doesn't matter what the server does. I hope you understood what I mean... Am 10.06.2013, 23:14 Uhr, schrieb Jim Giner : On 6/10/2013 4:33 PM, Julian Wanke wrote: I think that the problem here is, that the unset of the $_SERVER["PHP_AUTH_USER"] variable is not affecting the client's browser. If you've got a directory protection, the browser needs a restart to show the login dialog before. I may be wrong because I'm using forms normally but the Authentification cannot be reset so easily... No - I think you misunderstood. I am NOT using directory protection, hence my attempt at using this method. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LightBox click detection
They do, afaik... Am 15.06.2013, 20:11 Uhr, schrieb Tamara Temple : Marc Guay wrote: $('.lightbox-image-class').click(function(){ $.post('ajax.php', {click: true}); }); Do javascript DOM events stack? If they do, this is definitely the simplest way to go. If they don't, you need to capture the previous click handler and call it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Vote for PHP support in Google App Engine
On Thursday 10 April 2008 16:32, Paul van Brouwershaven wrote: > Have you seen the Google App Engine already, the guys from Google are > crazy! You now can host your application on the Google network, including > Big Table and GFS! > > Ok, one problem... they currently only support Python for programming, but > the good news is that they will add more languages like PHP in the future. > > To get PHP as the next language that will be integrated on Google App > Engine, please give your vote at there Project page at code.google.com!! > > http://code.google.com/p/googleappengine/issues/detail?id=13 > > Read and see more about Google App Engine: >- http://code.google.com/appengine/ >- http://code.google.com/p/googleappengine/ > > Regards, > > Paul Looks like they extending their services to web hosting. Wonder when they'll offer VPS accounts? Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP problem with array keys / pointers
Hi all, I've a problem thats been bothering me for a week now I have an array $animals keys and values like this 1 => cat 2 => dog 3 => mouse 4 => horse I want to be able to access them using either a key or a pointer, however the key/pointer will be a variable without variables, if I want dog, I can either use $animals[1] or $animals['2'] but with a variable , eg. $x = 2 $animals[$x] will always give me 'mouse' what syntax do I need to use for $animals[$x] to give me 'dog' when $x=2 ? I've tried all manner of apostrophes and escaped apostrophes, but no luck. Can anyone help me Thanks for your time! jules -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP problem with array keys / pointers
will set the element of ordinal number 0 and key ' 2' to 'dog'. To get that value you would either ask for $array[0] or $array[' 2']. thanks for all the comments so far, i'm not sure you are understanding what I am asking for. My problem is NOT knowing what is in the arrays, but how to access them. My ordial number/key is a variable, and I need to sometimes use it as a key, and sometimes as an ordial so I need 2 ways of writing $array[$x], one being equivalent to $array[0] - $x is treated as an integer and one being equivalentt to $array['0'] - $x is treated as a string so far I can only get it to work as an ordial number not a string. Any attempt at apostrophes around $x brings up an error Any ideas? Jules -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] post variables
Hi all, I am having a nightmare accessing my POST variables. I can red them if I use the GET method on my form, but POST is always blank I have while( list($key, $value) = each ($_POST)){ print "$key $value"; } print "_REQUEST: "; print_r($_REQUEST); print "_GET: "; print_r($_GET); print "_POST: "; print_r($_POST); at the top which tells me its not working. I have a workaround using perl, but I need to sort this once and for only uing php What have I forgotten? Please help, and thanks if you can! Jules -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post variables
Hi Richard yes it happens in Netscape 7 too, The thing is, it works in perl when I access the query string. But not in php. could it be a setting in php.ini? Jules - Original Message - From: "Richard Davey" <[EMAIL PROTECTED]> To: "julian haffegee" <[EMAIL PROTECTED]> Cc: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Sent: Tuesday, February 17, 2004 11:22 PM Subject: Re: [PHP] post variables > Hello julian, > > Tuesday, February 17, 2004, 9:20:58 PM, you wrote: > > jh> I am having a nightmare accessing my POST variables. I can red them if I use > jh> the GET method on my form, but POST is always blank > > A *lot* of people are reporting this as of late and I'm beginning to > wonder what the true cause is. I noticed that the latest security fix > from Microsoft to IE broke several high profile sites - do you get > this on IE or does it happen with Mozilla too? Do you have any > firewall software installed too? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post variables
Hi Chris print_r($_REQUEST); (is this what you mean by HTTP Request?) print_r($_POST); print_r($_GET); all give Array() its apache release 10327100 (is that what you mean?) If I change the form method to GET works, and we get REQUEST: Array ( [username] => aa [password] => aa ) _GET: Array ( [username] => aa [password] => aa ) _POST: Array ( ) > Do you have a way to capture the raw HTTP? I'd like to see: > > 1. The HTTP Request > 2. The output of print_r($_POST) > 3. What Web server you're using (and version) > > With this, I feel certain that we can figure something out. > > Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post variables
Hi all, I solved this today. It seems odd. If you define an action it DOES NOT work, but if you skip that entirely the POST variables are sent! so works doesn't work. Why would this be? thanks Jules - Original Message - From: "julian haffegee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 18, 2004 1:58 PM Subject: Re: [PHP] post variables > > Hi Chris > > print_r($_REQUEST); (is this what you mean by HTTP Request?) > print_r($_POST); > print_r($_GET); > > all give Array() > > its apache release 10327100 (is that what you mean?) > > If I change the form method to GET works, and we get > > REQUEST: Array ( [username] => aa [password] => aa ) > _GET: Array ( [username] => aa [password] => aa ) > _POST: Array ( ) > > > > > > Do you have a way to capture the raw HTTP? I'd like to see: > > > > 1. The HTTP Request > > 2. The output of print_r($_POST) > > 3. What Web server you're using (and version) > > > > With this, I feel certain that we can figure something out. > > > > Chris > > -- > 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] newbie problem
Hi all, I have a page that lets people upload images - they are then resized for use throughout my site. It all works fine, but I need to reduce the jpg size (without reducing image size) Is there a php function that lets you compress the jpg? Thanks Jules -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with a regex!
Why not use the php mechanism itself? An easy way to do a template system is make a normal php page as a template, and then include it from another page after specifying a bunch of variables. eg. template.php: = calling page: = Hope this helps, Julian on 1/27/01 6:17 PM, Zack Ham at [EMAIL PROTECTED] wrote: > > I'm trying to create a small template parser so I can fill my html pages up > with data. An example: {title} > What I'm trying to do is run through it and replace {title} with an > appropriate value. I have tried running ereg_replace("{$var}",$value,$string) > and ereg_replace("\{$var\}",$value,$string). Neither work. They either do > nothing or produce the error "Warning: invalid content of \{\}". > > Any help would be appreciated, > Zack > > _____ > Free email provided by ---> http://sect0r.com -- Julian Wood Learning Technologies and Digital Media University of Calgary -- 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] Problem with a regex!
Maybe I'm misunderstanding something. I'm suggesting that you not bother at all with an ereg_replace system. If you want to do a system like you're suggesting, you would use a variable variable. That is, ${$var} will evaluate to 'Hello' when $var = 'title' and $title = 'Hello'. HTH, Julian on 1/27/01 6:56 PM, Zack Ham at [EMAIL PROTECTED] wrote: > > I had it echo off the value of $var right before it ran the ereg_replace and > it echoed "TITLE". So there is a value... any ideas on fixing? > > --- Julian Wood <[EMAIL PROTECTED]> >> wrote: >> >> Why not use the php mechanism itself? An easy way to do a template system is >> make a normal php page as a template, and then include it from another page >> after specifying a bunch of variables. >> >> eg. >> >> template.php: >> = >> >> >> >> calling page: >> = >> >> > >> $title = "My template system"; >> include ('template.php'); >> >> ?> >> >> Hope this helps, >> >> Julian >> >> on 1/27/01 6:17 PM, Zack Ham at [EMAIL PROTECTED] wrote: >> >>> >>> I'm trying to create a small template parser so I can fill my html pages up >>> with data. An example: {title}>> >>> What I'm trying to do is run through it and replace {title} with an >>> appropriate value. I have tried running >>> ereg_replace("{$var}",$value,$string) >>> and ereg_replace("\{$var\}",$value,$string). Neither work. They either do >>> nothing or produce the error "Warning: invalid content of \{\}". >>> >>> Any help would be appreciated, >>> Zack >>> >>> _ >>> Free email provided by ---> http://sect0r.com >> >> -- >> Julian Wood >> Learning Technologies and Digital Media >> University of Calgary >> >> >> >> -- >> 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] > > _ > Free email provided by ---> http://sect0r.com -- Julian Wood Learning Technologies and Digital Media University of Calgary -- 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] Need to count number of rows per id! :(
Are you looking for select topicID, count(*) from $secondtable group by topicID? This will give you a count of each distinct topicID in $secondtable. Julian -- Julian Wood Multimedia Developer University of Calgary on 2/2/01 6:15 PM, Sandeep Hundal at [EMAIL PROTECTED] wrote: > > Hey guys, > > I need an answer to a problem I've been trying to work on for days :( > > I made a message board, which has a front page which lists Topic > name, topic started by, and what date. All this info, and the topic > message is stored in one mysql table. when you click on any of the > topics, it leads to a page which lists all replies to that topic by > topic_id. > > Now what I want to do is have a listen on the first index page, the > number of replies for that particular topic. I know I need something > like select id from $secondtable where topicid=$topicid, and then use > mysql_num_rows, but I can't figure out how to integrate the first set > of results from table 1 with the query on table 2. > > This is the query on the front page on the main table : > $query = "SELECT topicid, icon, name, topic, datestamp FROM > $maintable ORDER by datestamp DESC LIMIT 40 "; > $result = mysql_query($query); > > TIA! > > Sandeep > > __ > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cobalt RaQ
I'ts also the small footprint (ideal for racking at large ISP's and Data Centres: the prime market positioning of these boxes) and excellent MTBF's (they just keep on trucking..) You can also install SSH to maintain an encrypted 'telnet' session. Julian - Original Message - From: "K.M. The" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 05, 2001 5:18 PM Subject: RE: [PHP] Cobalt RaQ > The reason they're so expensive is not the hardware, it's the complete > webbased administration tool you're paying for. The users these products are > targeted at, are those who can't administrate a server through a standard > SSH/Telnet connection. > > Vincent The > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 05, 2001 6:12 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Cobalt RaQ > > > After hearing about "Coalt RaQ" a number of times on the list, > I thought I'd cruise over and check them out. > > After doing so, I'm of the opinion that I'm missing something. > > $1,200 USD for a 300Mhz 1u box? $2,699 for a $450 w/256M RAM? > $3,599 for a $450 w/512 RAM and a dual 30G HDs? > > What am I missing? You can get a dual-P3 800 w/ 256 RAM > and a single 15G HD in a 1u for $2400 USD. With RAM and > HDs being so cheap now, Is there something special about > the RaQs? Software? Support? I just don't see anything to > warrant the higher pricing. Are they RISC based and use the > more expensive Sun chips with 2M SRAM? > > Thanks... > > -Szii > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Editors
>From Allaire's (Homesite) web page: "When InternetWorld surveyed 136 professional design firms (iXL, USWeb, Modem Media, TVisions, Organic Online, etc.) in October 1999, HomeSite was the most popular HTML tool: Allaire HomeSite - 52.9% Bare Bones BBEdit (Mac) - 42.6% Microsoft FrontPage - 22.8% Microsoft Visual InterDev - 19.1% Sausage Software HotDog - 4.4%" Granted this is over 1 year ago, and probably not the most scientific of polls, how does BBEdit garner 42.6% of the share when the Mac has only a 3-5% share of the worldwide computer market? J -- 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] dates
Anyone know how to use the PHP date functions to work out the difference between two timestamps? For example.. Figure out the number of seconds, minutes, hours, days, months and years between 5th October 2001 14:20:10 and 26th February 1998 109:54:10 Help much appreciated! thanks Julian -- 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] dates
Yes I had a look at mktime() and date() and tried to think of an easy way to do it but couldn't... you can convert both dates to a UNIX timestamp (millseconds after whatever date) then do a subtraction... and then what? Easy to work out number of days from millseconds as a day's length is fixed but to go to months is harder as of course you need more information than just the actual elapsed time. Similar problam with mktime() as it's designed for actual dates, not differences between days. What is XEmacs calc- mode and calendar mode? I'm not all that familiar with Unix I'm afraid.. Thanks for your reply! Julian [EMAIL PROTECTED] wrote: > On Sun, Feb 18, 2001 at 04:40:08PM -0700, Julian Rockeu wrote: > >> Anyone know how to use the PHP date functions to work out the difference >> between two timestamps? >> >> For example.. >> >> Figure out the number of seconds, minutes, hours, days, months and years >> between >> >> 5th October 2001 14:20:10 >> and >> 26th February 1998 109:54:10 > > > This should be doable with http://php.net/mktime and http://php.net/date. But > for such heavy calculations I prefer XEmacs calc-mode or the calendarr-mode. > > -Egon > -- 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] HTTP POST Question
Check out http://px.sklar.com/code-pretty.html?code_id=313 It is a post class written by Alan van den Bosch which will do what you want (post to a perl script, retrieve the results, and let you manipulate them from within the posting php script). Here's some code using this class. I've simplified this so it is untested in its current state, but should work. I've used this class in many projects and it works very well. set_action("http://$SERVER_ADDR/cgi-bin/hello.pl"); # add some post arguments $a->set_element('foo','bar'); #do the post $res = $a->send(); #strip header $res = strstr($res, "\r\n\r\n"); #display the results echo $res; ?> HTH, J -- Julian Wood Multimedia Developer University of Calgary on 2/19/01 10:15 AM, John Monfort at [EMAIL PROTECTED] wrote: > > > >> 1. It appears if I use the header function I have to redirect the page to >> another page, it doesn't appear possible to retrieve a page into the current >> page? Unless someone can show me some code that would do that. >> > > If all you want is to display the remote page, within the local page, > then all you need is fpassthru() > > ex. > > $server = "http://www.site.com"; > > $fp = fopen($server,"r")// "r" is for reading > fpassthru($fp); > > This will display the results of the remote file (html or whatever) into > the local file (in this case, your PHP file). > > >> >> >>> -Original Message- >>> From:Milan Mlynarcik [SMTP:[EMAIL PROTECTED]] >>> Sent:Monday, February 19, 2001 7:33 AM >>> To:Montgomery-Recht, Evan >>> Subject:Re: [PHP] HTTP POST Question >>> >>> You have to use header() function and how POST work you can find in HTTP >>> RFC >>> at http://www.w3.org/Protocols/rfc2616/rfc2616.html >>> - >>> Milan Mlynarcik >>> Web Programmer >>> Charmed Technology Slovakia >>> Nam. sv. Egidia 16/37 >>> 058 01 Poprad, Slovakia >>> E-mail: [EMAIL PROTECTED] >>> Office: 00421 92 7881 874 >>> Mobile: 00421 905 964 535 >>> Web page: http://www.charmed.com/ >>> - >>> - Original Message - >>> From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]> >>> To: <[EMAIL PROTECTED]> >>> Sent: Monday, February 19, 2001 1:06 PM >>> Subject: [PHP] HTTP POST Question >>> >>> >>>> Good morning... >>>> >>>> This should be a good monday morning question. >>>> >>>> I have a cgi-bin written in perl (it's actually, a interface to a >>>> perl-module which is a interface to a telnet-like protocol). >>>> >>>> Anyways what I need to do is I have already existing code written in >>> PHP, >>>> but at some point I need to call this cgi-bin and get a return code from >>> it >>>> and process (good/bad result) and return to completed php script that >>> says >>>> it called this cgi-bin. It's not very clear how to set the >>> HTTP_POST_VARS >>>> for sending to a post command (which doesn't seem to exist); >>>> >>>> Any ideas I don't see a function called: >>>> >>>> $HTTP_POST_VARS =set variables; >>>> $result = http_post("http://localhost/cgi-bin/script.pl"); >>>> >>>> Thanks, >>>> >>>> evan >>>> >>>> PS. I'd appricate a working example, even if it's a dummy version. >>>> >>>> -- >>>> PHP General Mailing List (http://www.php.net/) >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>> To contact the list administrators, e-mail: [EMAIL PROTECTED] >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: [EMAIL PROTECTED] >> >> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTTP POST Question
Hmmm, I'm sorry - I didn't see any mention of flash in this thread. That is a completely different story from what has been talked about so far. What do you mean you can't write the unlink code? You mean you want to delete a file somewhere from flash? That shouldn't be a problem - post from flash to a php script - the script can do the unlink (make sure you have correct permissions and *build* the correct path), then return a result code back to flash. Not sure if I'm on target for your question or not. HTH, J -- Julian Wood Multimedia Developer University of Calgary on 2/20/01 9:46 AM, Jan Grafström at [EMAIL PROTECTED] wrote: > > Thankyou Julian but I am posting my variable from flash5. > The posting is not my problem. I just can`t write the unlink code. > > Julian Wood wrote: > >> Check out http://px.sklar.com/code-pretty.html?code_id=313 >> >> It is a post class written by Alan van den Bosch which will do what you want >> (post to a perl script, retrieve the results, and let you manipulate them >> from within the posting php script). Here's some code using this class. I've >> simplified this so it is untested in its current state, but should work. >> I've used this class in many projects and it works very well. >> >> > >> include("post.php"); >> >> $a=new http_post; >> >> #where do you want to post today >> $a->set_action("http://$SERVER_ADDR/cgi-bin/hello.pl"); >> >> # add some post arguments >> $a->set_element('foo','bar'); >> >> #do the post >> $res = $a->send(); >> >> #strip header >> $res = strstr($res, "\r\n\r\n"); >> >> #display the results >> echo $res; >> >> ?> >> >> HTH, >> >> J >> >> -- >> Julian Wood >> >> Multimedia Developer >> University of Calgary >> >> on 2/19/01 10:15 AM, John Monfort at [EMAIL PROTECTED] wrote: >> >>> >>> >>> >>>> 1. It appears if I use the header function I have to redirect the page to >>>> another page, it doesn't appear possible to retrieve a page into the >>>> current >>>> page? Unless someone can show me some code that would do that. >>>> >>> >>> If all you want is to display the remote page, within the local page, >>> then all you need is fpassthru() >>> >>> ex. >>> >>> $server = "http://www.site.com"; >>> >>> $fp = fopen($server,"r")// "r" is for reading >>> fpassthru($fp); >>> >>> This will display the results of the remote file (html or whatever) into >>> the local file (in this case, your PHP file). >>> >>> >>>> >>>> >>>>> -Original Message- >>>>> From:Milan Mlynarcik [SMTP:[EMAIL PROTECTED]] >>>>> Sent:Monday, February 19, 2001 7:33 AM >>>>> To:Montgomery-Recht, Evan >>>>> Subject:Re: [PHP] HTTP POST Question >>>>> >>>>> You have to use header() function and how POST work you can find in HTTP >>>>> RFC >>>>> at http://www.w3.org/Protocols/rfc2616/rfc2616.html >>>>> - >>>>> Milan Mlynarcik >>>>> Web Programmer >>>>> Charmed Technology Slovakia >>>>> Nam. sv. Egidia 16/37 >>>>> 058 01 Poprad, Slovakia >>>>> E-mail: [EMAIL PROTECTED] >>>>> Office: 00421 92 7881 874 >>>>> Mobile: 00421 905 964 535 >>>>> Web page: http://www.charmed.com/ >>>>> - >>>>> - Original Message - >>>>> From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]> >>>>> To: <[EMAIL PROTECTED]> >>>>> Sent: Monday, February 19, 2001 1:06 PM >>>>> Subject: [PHP] HTTP POST Question >>>>> >>>>> >>>>>> Good morning... >>>>>> >>>>>> This should be a good monday morning question. >>>>>> >>>>>> I have a cgi-bin written in perl (it's actually, a interface to a >>>>>> perl-module which is a interface to a telnet-like protocol). >>>>>> >>>>>> Anyways what I need to do is I have already existing code
[PHP] PHP, OOP and AJAX
Hi Everyone, This is the first time that I am posting in the PHP forum, so hope that I am osting in the right place. I would like to say that before submitting to this forum I have done some research looking for a solution without success. I had been programming in ASP.NET for years using Object Oriented Princeliness but decided to walk away from that. I am now researching and specialising in the open source world. I have started to develop a project using MySQL, PHP and OOP. So far I have succeed. However I got stuck once I started implement AJAX using the AJAX tutorial from w3schools.com. What I have discovered is: for some reason when you call a file that requires other fies using the REQUIRE or INCLUDE it just does not work. I can conform this as I have tested with out the the functions. Has anyone ever meet such a situation can you give me some feedback please. Thank you very much in advance for your support. Regards Julian
[PHP] PHP, OOP and AJAX
Update. Hello Everyone, First of all, thank you all for your input. I ran a sinmple test using the suggestions you gave me and and require_once. Using firebug to test the output, I got an internal server error. I found out what the problem was. What I am doing is I have classes which represent the objects, another class containing the functions. From the function class I create an instance of each object, manipulate the information, return the HTML result. Finally I have a runner class that creates an instance of the function class, calls the function required and outputs the information. What the problem was for some reason I was did not create an instance of the function class, just was calling the function. Well by creating the runner class I solved the problem. Thanks all for your help. Regards Julian
Re: [PHP] Web application design considerations - a good reference ?
Hi, If you want to develop a professional business - enterprise application I suggest you research books related to Database Design and Development, and Business Systems Analysis. UML or Unified Modeling Language will help you with database design and system design. ERD - Entity Relationship Diagrams are the bassis of understading weather you have a good dtabse design. The RDBMS - Relational Database Management System. Other models will help you understand the flow of your programme before you start and development. Inorder to have a good system you have to have a good design. A GOOD DESIGN IS THE BASIS OF EVERYHTHING. Through this you will learn other things such as SDLC - Software Develpment Life Cycle. There are many diffrent models you may use to develop an profesional application. In the end its up to you to choose. Regards Julian On Tue, Jun 2, 2009 at 6:50 AM, Angus Mann wrote: > Hi all. > > I'm working on a PHP project for my own personal business use. It will > handle billing and invoices as well as payments and time management, > bookings, appointments and a few more. I may add things like personal > messaging between the various users and a customer login to check on the > progress of their accounts. > > It is a big project and will probably take a year or so to complete in my > spare time. > > I have made a couple of starts but I have no experience in creating such > large applications and I find I often end up with spaghetti code. I've tried > using session variables to keep track of where and what the program is doing > but there are so many permuations and combinations I found myself writing > endless streams of if's, and's and or's just to figure out what page to > display. > > The code is not the probblem for me...it's the flow and organization of the > code. > > Can anybody point me to a good book or tutorial that lays down the > principles and gives some suggestions for integrating the many subroutines > of a large application? I want to make the code readable and logical in its > flow, and avoid repetition of code segments. > > Much appreciated. > Angus > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
[PHP] Re: PHP, OOP and AJAX
One final update. The way one sets the path to required files is very important. I found it is best to use instead of relative paths. Regards Julian On Fri, Jun 5, 2009 at 2:19 PM, Julian Muscat Doublesin < opensourc...@gmail.com> wrote: > Update. > > Hello Everyone, > > First of all, thank you all for your input. I ran a sinmple test using the > suggestions you gave me and and require_once. > > Using firebug to test the output, I got an internal server error. I found > out what the problem was. > > What I am doing is I have classes which represent the objects, another > class containing the functions. From the function class I create an instance > of each object, manipulate the information, return the HTML result. Finally > I have a runner class that creates an instance of the function class, calls > the function required and outputs the information. > > What the problem was for some reason I was did not create an instance of > the function class, just was calling the function. Well by creating the > runner class I solved the problem. > > Thanks all for your help. > > Regards > > Julian >
[PHP] PHP Mail Function
Hello Everyone, I have written an e-mail function that sends e-mail to my domain that forwards it to a gmail account. When I use the gmail address directly it works fine. When I use my mail domain i don't get anything. Has anyone experienced this? Can anyone give me some advice? Thanks in advance Julian
[PHP] Include Paths
I had a problem with the include and require paths when using AJAX. This I have solved by using the document root. However since doing so I am experiencing performance issues. Loading 20 records has suddenly turned into something of a matter of a minute rather then seconds. Has anyone ever experienced such an issue? Can anyone please advise? Thanks
[PHP] parse_str() expects parameter 1 to be string, array given
Hello* *Everyone, I am geetting the error below. Can you please guide me on a fix. It is working on the live site but not on local server. Has anyone ever experinced this error before. * Warning*: parse_str() expects parameter 1 to be string, array given**
[PHP] PHP APACHE SAVE AS
Hello Everyone, I have installed PHP, Apache and MySQL on a Windows 7 machine :(. I would prefer linux or unix :) These have been setup and working correctly. However when I access a php page. I get the save as dialog. Has anyone ever experinced such a situation. Can anyone please advise. Thank you very much in advance. Julian
Re: [PHP] PHP APACHE SAVE AS
Hi, Just to update every one. This solution below worked perfectly. Thank you very much Jonathan. I have one other question though. Can anyone help me on the folowing. Database Error: Unable to connect to the database:The MySQL adapter "mysql" is not available. Thank you Julian On Fri, Nov 27, 2009 at 1:34 PM, Jonathan Tapicer wrote: > You are probably missing something like this in the apache httpd.conf: > > LoadModule php5_module "c:/PHP/php5apache2_2.dll" > PHPIniDir "c:/PHP/php.ini" > AddType application/x-httpd-php .php > DirectoryIndex index.php index.html index.html.var > > Regards, > > Jonathan > > On Fri, Nov 27, 2009 at 6:24 AM, Julian Muscat Doublesin > wrote: > > Hello Everyone, > > > > I have installed PHP, Apache and MySQL on a Windows 7 machine :(. > I > > would prefer linux or unix :) > > > > These have been setup and working correctly. However when I access a php > > page. I get the save as dialog. Has anyone ever experinced such a > situation. > > Can anyone please advise. > > > > Thank you very much in advance. > > > > Julian > > >