Re: [PHP] Can Objects be passed to another page?
Hello Webmaster, No, arrays can be passed (, for example), but not objects. W> Hi, W> is it possible to pass an Object to another php page? W> I want to pass a whole bunch of varibales to another page. W> For example the session ID, the language that the user choose,etc. W> All those variables are in one or more objects. W> Do I have to copy all those object attributes to variables and pass them via W> the URL? W> How is this done professionally? W> Up to now I used cookies. But I would like to change that. W> Not all users have cookies enabled. W> Thx -- Best regards, MuToGeNmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php editor
Hello STONE, I use Zend Studio SS> What's the best php editor out there? SS> Thanks in advance for nay replies! -- Best regards, MuToGeNmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Can Objects be passed to another page?
Hello Marco, I was saying about GET and POST, not sessions MS> Hi there MS> MuToGeN wrote: >> No, arrays can be passed (, >> for example), but not objects. MS> And why does this work then? MS> === SCRIPT === MS> error_reporting(E_ALL); MS> class AClass { MS> var $i = 0; MS> function AClass ($i = 0) { MS> //$this->display(); MS> } MS> function increment() { MS> $this->i++; MS> } MS> function display() { MS> printf('Current value of $i is: %s', $this->i); MS> } MS> } MS> session_start(); MS> if (!isset($_SESSION['AClass'])) { MS> $a = & new AClass(); MS> $_SESSION['AClass'] = & $a; MS> } MS> else { MS> $a = & $_SESSION['AClass']; MS> } $a->>increment(); $a->>display(); ?>> MS> === /SCRIPT === -- Best regards, MuToGeNmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ImageTTFBBox() hanging?
Hello Kevin, Maybe, the problem is with the TTF file (3rd param for imagettfbox())? Did you try to replace it by another one? KB> Hi. I'm new to the list, but not new to PHP. KB> Anyway, I have a small PHP script that was meant to help learn about KB> doing stuff with the GD library. Basically, it opens an image of a KB> button and centers text on top of it, then displays it. To center the KB> text, it uses ImageTTFBBox(). However, it appears that whenever I use KB> this call, the PHP script hangs, and after about 10 seconds my web KB> browser (Safari) says that it couldn't read any data from the server (I KB> assume this means the server closed the connection without sending any KB> data to the browser). If I comment out the call, the script proceeds KB> just fine. KB> Actually, after looking at it again, it does the exact same behaviour KB> on ImageTTFText(). I can't figure out what the problem is, unless it KB> somehow hangs on reading in the TrueType font. KB> Can anybody figure out what my problem could be? Alternately, if nobody KB> can do that, is there any way to figure out the width/height of font KB> rendered using the built in fonts (i.e. 1-5 with imagestring())? KB> For reference, my script can be found here: KB> <http://kballard.res.wpi.net/button.phps> KB> -- KB> Kevin Ballard KB> [EMAIL PROTECTED] KB> http://www.tildesoft.com -- Best regards, MuToGeNmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I get IP of ppp0?
Hello Erick, ipconfig EO> Hello List, EO> How can I get IP Address from my connection ppp0 or ppp1 in Linux? What EO> 's the function? EO> thanks EO> Erick -- Best regards, MuToGeNmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem Coding a Tutorial
Hello Stephen, You say "then hit the "Sign, dammit!" button", and in your script you have "...if ($submit == "Sign!")...". Obviously, the problem is that "else" block is executed instead of "if". It's better to use some other variable to check whether the form is filled or not, something like "...if(strlen($_REQUEST["comments"])>0)..." Also, the problem may be caused by register_globals turned off... ST> I found a new book for again starting out to learn PHP/MySQL Web App ST> programming. I've begun exercises toward that end. ST> So far I've opened MySQL--I'm on a Macintosh PowerBook, so that's ST> UNIX--as root and created a database I called guest_recorder. Then I ST> GRANTed ALL to a new user (me) with a password. I then quit MySQL. ST> Next I opened MySQL again as the new user I created, did a USE ST> guest_recorder and then created my first table guest_info. The table had ST> five columns: name, location, email, url, and comments. When I did a ST> DESCRIBE guest_info, it properly displayed the columns. ST> Then I typed "dbconnect.php": ST> mysql_connect("localhost", "", "---") or ST> die ("Could not connect to database"); ST> mysql_select_db("guest_recorder") or ST> die ("Could not select database"); ?>> ST> followed by "create_entry.php": ST> ST> ST> Create Entry ST> ST> ST> include("dbconnect.php"); ST> if ($submit == "Sign!") ST> { ST> $query = "insert into guest_info ST> (name,location,email,url,comments) values ST> <'$name', '$location', '$email', '$url', '$comments')" ST> ; ST> mysql_query($query) or die (mysql_error()); ?>> ST> Thanks! ST> View My Guest Book! ST> } ST> else ST> { ST> include("sign.php"); ST> } ?>> ST> and "sign.php": ST> When I open "create_entry.php" in my browser, the form and its five ST> fields appear correctly, and I fill them out. I then hit the "Sign, ST> dammit!" button. ST> I was expecting the "Thanks!" and "View My Guest Book!" messages, but ST> instead am greeted with the same form with its five blank fields so's I ST> can type in info for name, location, email, url, and comments. ST> When I go to view the table named "guest_info" in the database named ST> "guest_recorder" using SELECT * FROM guest_info, I'm told "Empty set". ST> If the form's info isn't making it to the table, I'm thinking I need ST> $_POST statements--as in $_POST["name"], $_POST["location"], ST> etc.--somewhere to get each field's info into the table. But where do I ST> put those lines and in which file: "create_entry.php" or "sign.php"? ST> Thank you. -- Best regards, MuToGeNmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php