php-general Digest 25 Jun 2013 06:03:47 -0000 Issue 8277
php-general Digest 25 Jun 2013 06:03:47 - Issue 8277 Topics (messages 321468 through 321479): Is it possible??? 321468 by: Karl-Arne Gjersøyen 321469 by: Stuart Dallas 321470 by: raphael khaiat 321471 by: Karl-Arne Gjersøyen 321472 by: Stuart Dallas 321473 by: nobs.nobswolf.info 321474 by: Sachin Raut 321475 by: Carlos Medina 321476 by: Maciek Sokolewicz 321477 by: Carlos Medina 321478 by: Marco Behnke 321479 by: php.nobswolf.info Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- $item_amount_in_store = 223; $update_amount = 7; $update_item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; Why? That should be 230! Karl ---End Message--- ---BeginMessage--- On 24 Jun 2013, at 12:59, Karl-Arne Gjersøyen karlar...@gmail.com wrote: $item_amount_in_store = 223; $update_amount = 7; $update_item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; Why? That should be 230! Because you're using $item_amount_in_store and $update_item_amount_in_store as if PHP should know you mean the same thing. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/---End Message--- ---BeginMessage--- Hi, Shouldn't it be: $item_amount_in_store = 223; $update_amount = 7; $item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; The 3rd line seems wrong as you didn't use the same variable. -- Raphaël Khaïat 06.72.89.57.29 On Mon, Jun 24, 2013 at 1:59 PM, Karl-Arne Gjersøyen karlar...@gmail.comwrote: $item_amount_in_store = 223; $update_amount = 7; $update_item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; Why? That should be 230! Karl ---End Message--- ---BeginMessage--- Error in my last post This is corrected: $item_amount_in_store = 223; $update_amount = 7; $item_amount_in_Store += $update_amount; It show the result = 227 and not 230. Why is this happen? Karl -- Forwarded message -- From: Karl-Arne Gjersøyen karlar...@gmail.com Date: 2013/6/24 Subject: Is it possible??? To: PHP Mailinglist php-gene...@lists.php.net $item_amount_in_store = 223; $update_amount = 7; $update_item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; Why? That should be 230! Karl -- Hjemmeside: http://www.karl-arne.name/ ---End Message--- ---BeginMessage--- On 24 Jun 2013, at 13:02, Karl-Arne Gjersøyen karlar...@gmail.com wrote: Error in my last post This is corrected: $item_amount_in_store = 223; $update_amount = 7; $item_amount_in_Store += $update_amount; It show the result = 227 and not 230. Why is this happen? Something else is going on to give you 227, but variable names are case sensitive which is why you're not getting what you expect. ?php $item_amount_in_store = 223; $update_amount = 7; $item_amount_in_Store += $update_amount; var_dump($item_amount_in_store); var_dump($item_amount_in_Store); ? Output: int(223) int(7) -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- Forwarded message -- From: Karl-Arne Gjersøyen karlar...@gmail.com Date: 2013/6/24 Subject: Is it possible??? To: PHP Mailinglist php-gene...@lists.php.net $item_amount_in_store = 223; $update_amount = 7; $update_item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; Why? That should be 230! Karl -- Hjemmeside: http://www.karl-arne.name/ ---End Message--- ---BeginMessage--- You should give a complete programm so we can run exactly the same you do, like this: ?php $item_amount_in_store = 223; print ($item_amount_in_store); $update_amount = 7; $item_amount_in_store += $update_amount; print ( + $update_amount = $item_amount_in_store ); ? which gives this result: 223 + 7 = 230 ---End Message--- ---BeginMessage--- variables are case-sensitive. $item_amount_in_store is different from $item_amount_in_Store 1st variable contains all lowercase characters, while the 2nd one contains S uppercase character. happy coding sachin On Mon, Jun 24, 2013 at 5:32 PM, Karl-Arne Gjersøyen karlar...@gmail.comwrote: Error in my last post This is corrected: $item_amount_in_store = 223; $update_amount = 7; $item_amount_in_Store += $update_amount; It show the result = 227 and not 230. Why is this happen? Karl -- Forwarded message -- From: Karl-Arne Gjersøyen karlar...@gmail.com Date: 2013/6/24 Subject: Is it possible??? To: PHP Mailinglist php-gene...@lists.php.net $item_amount_in_store = 223; $update_amount = 7; $update_item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; Why? That should be
php-general Digest 25 Jun 2013 19:34:17 -0000 Issue 8278
php-general Digest 25 Jun 2013 19:34:17 - Issue 8278 Topics (messages 321480 through 321492): Thread-Hijacking (was: Re: [PHP] Fwd: Is it possible???) 321480 by: Tamara Temple 321481 by: Maciek Sokolewicz Some Advice 321482 by: Floyd Resler 321483 by: Samuel Lopes Grigolato 321484 by: Samuel Lopes Grigolato 321485 by: Floyd Resler 321486 by: php.nobswolf.info 321487 by: Alex Pojarsky 321488 by: Samuel Lopes Grigolato 321489 by: Jonesy Migration of applications to PHP 5.4 321490 by: Forum 321491 by: Forum 321492 by: Paul M Foster Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Maciek Sokolewicz maciek.sokolew...@gmail.com wrote: Please please please please don't do this! Please Please Please Do Not Hijack Threads. ---End Message--- ---BeginMessage--- On 25 June 2013 10:02, Tamara Temple tamouse.li...@gmail.com wrote: Maciek Sokolewicz maciek.sokolew...@gmail.com wrote: Please please please please don't do this! Please Please Please Do Not Hijack Threads. Hijacking would be starting a completely different discussion in the same thread. This wasn't a discussion-starter, rather a warning ;) - Tul ---End Message--- ---BeginMessage--- I use sessions to store login information. However, a particular user of a site can only access it at the library which has cookies shut off. So, I'm thinking of creating an entry in the database with a unique identifier and expiration time. I would then pass that identifier to each page. Does that sound like a good alternative to sessions or is there something else I could do? Thanks! Floyd ---End Message--- ---BeginMessage--- Hope it helps: http://stackoverflow.com/questions/3740845/php-session-without-cookies (go directly to the answer) On Tue, Jun 25, 2013 at 9:15 AM, Floyd Resler fres...@adex-intl.com wrote: I use sessions to store login information. However, a particular user of a site can only access it at the library which has cookies shut off. So, I'm thinking of creating an entry in the database with a unique identifier and expiration time. I would then pass that identifier to each page. Does that sound like a good alternative to sessions or is there something else I could do? Thanks! Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- But please, PLEASE, read carefully: *If a user were to copy and paste the URL of the page they were on, and someone else were to click on it, they would both be using the same session.* On Tue, Jun 25, 2013 at 9:17 AM, Samuel Lopes Grigolato samuel.grigol...@gmail.com wrote: Hope it helps: http://stackoverflow.com/questions/3740845/php-session-without-cookies (go directly to the answer) On Tue, Jun 25, 2013 at 9:15 AM, Floyd Resler fres...@adex-intl.comwrote: I use sessions to store login information. However, a particular user of a site can only access it at the library which has cookies shut off. So, I'm thinking of creating an entry in the database with a unique identifier and expiration time. I would then pass that identifier to each page. Does that sound like a good alternative to sessions or is there something else I could do? Thanks! Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Thanks for pointing me to that. Looks to be much simpler that they way I was going to do it. Thanks! Floyd On Jun 25, 2013, at 8:17 AM, Samuel Lopes Grigolato samuel.grigol...@gmail.com wrote: Hope it helps: http://stackoverflow.com/questions/3740845/php-session-without-cookies (go directly to the answer) On Tue, Jun 25, 2013 at 9:15 AM, Floyd Resler fres...@adex-intl.com wrote: I use sessions to store login information. However, a particular user of a site can only access it at the library which has cookies shut off. So, I'm thinking of creating an entry in the database with a unique identifier and expiration time. I would then pass that identifier to each page. Does that sound like a good alternative to sessions or is there something else I could do? Thanks! Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- You should at least check the IP of the client additionally to have some prove it is the same client you gave the session-ID. And it is better to put the session-ID in a POST-field than in GET. So it es very unlikely someone passes a
Re: [PHP] Fwd: Is it possible???
On Mon, Jun 24, 2013 at 06:17:33PM +0200, Maciek Sokolewicz wrote: Please please please please don't do this! 1) You did not answer the question, nor giving any related information. 2) This was debug-output. I see not point in optimizing. 3) print is language construct, just as is echo 4) the argument to print is converted to string anyways, so ... 5) the quotes around a single variable allows fast adding helping text while debugging; so it was on purpose You are not the only one that has a coding style for a reason. So back to topic: I guess the case-sensitive variables were the most helpfull hint for the thread-starter? If not please send a complete example of your code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Thread-Hijacking (was: Re: [PHP] Fwd: Is it possible???)
Maciek Sokolewicz maciek.sokolew...@gmail.com wrote: Please please please please don't do this! Please Please Please Do Not Hijack Threads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Thread-Hijacking (was: Re: [PHP] Fwd: Is it possible???)
On 25 June 2013 10:02, Tamara Temple tamouse.li...@gmail.com wrote: Maciek Sokolewicz maciek.sokolew...@gmail.com wrote: Please please please please don't do this! Please Please Please Do Not Hijack Threads. Hijacking would be starting a completely different discussion in the same thread. This wasn't a discussion-starter, rather a warning ;) - Tul
[PHP] Some Advice
I use sessions to store login information. However, a particular user of a site can only access it at the library which has cookies shut off. So, I'm thinking of creating an entry in the database with a unique identifier and expiration time. I would then pass that identifier to each page. Does that sound like a good alternative to sessions or is there something else I could do? Thanks! Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some Advice
Hope it helps: http://stackoverflow.com/questions/3740845/php-session-without-cookies (go directly to the answer) On Tue, Jun 25, 2013 at 9:15 AM, Floyd Resler fres...@adex-intl.com wrote: I use sessions to store login information. However, a particular user of a site can only access it at the library which has cookies shut off. So, I'm thinking of creating an entry in the database with a unique identifier and expiration time. I would then pass that identifier to each page. Does that sound like a good alternative to sessions or is there something else I could do? Thanks! Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some Advice
But please, PLEASE, read carefully: *If a user were to copy and paste the URL of the page they were on, and someone else were to click on it, they would both be using the same session.* On Tue, Jun 25, 2013 at 9:17 AM, Samuel Lopes Grigolato samuel.grigol...@gmail.com wrote: Hope it helps: http://stackoverflow.com/questions/3740845/php-session-without-cookies (go directly to the answer) On Tue, Jun 25, 2013 at 9:15 AM, Floyd Resler fres...@adex-intl.comwrote: I use sessions to store login information. However, a particular user of a site can only access it at the library which has cookies shut off. So, I'm thinking of creating an entry in the database with a unique identifier and expiration time. I would then pass that identifier to each page. Does that sound like a good alternative to sessions or is there something else I could do? Thanks! Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some Advice
Thanks for pointing me to that. Looks to be much simpler that they way I was going to do it. Thanks! Floyd On Jun 25, 2013, at 8:17 AM, Samuel Lopes Grigolato samuel.grigol...@gmail.com wrote: Hope it helps: http://stackoverflow.com/questions/3740845/php-session-without-cookies (go directly to the answer) On Tue, Jun 25, 2013 at 9:15 AM, Floyd Resler fres...@adex-intl.com wrote: I use sessions to store login information. However, a particular user of a site can only access it at the library which has cookies shut off. So, I'm thinking of creating an entry in the database with a unique identifier and expiration time. I would then pass that identifier to each page. Does that sound like a good alternative to sessions or is there something else I could do? Thanks! Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some Advice
You should at least check the IP of the client additionally to have some prove it is the same client you gave the session-ID. And it is better to put the session-ID in a POST-field than in GET. So it es very unlikely someone passes a session ID around accidently. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some Advice
Putting your session-ID into post will require you to POST every page, rather then GET it. And every anchor user clicks will have to POST, not GET. On Tue, Jun 25, 2013 at 4:32 PM, p...@nobswolf.info wrote: You should at least check the IP of the client additionally to have some prove it is the same client you gave the session-ID. And it is better to put the session-ID in a POST-field than in GET. So it es very unlikely someone passes a session ID around accidently. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some Advice
Just be cautious if going to check IP, because: 1) The two users could be in the same house or cybercafé, which gives them the same IP. 2) The user could be traveling with a wireless card, his IP would change quite a lot in this scenario. On Tue, Jun 25, 2013 at 9:32 AM, p...@nobswolf.info wrote: You should at least check the IP of the client additionally to have some prove it is the same client you gave the session-ID. And it is better to put the session-ID in a POST-field than in GET. So it es very unlikely someone passes a session ID around accidently. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Some Advice
On Tue, 25 Jun 2013 09:40:04 -0300, Samuel Lopes Grigolato wrote: --047d7b2e430e0b34d004dff9d47c Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Just be cautious if going to check IP, because: 1) The two users could be in the same house or cybercaf=E9, which gives the= m the same IP. 2) The user could be traveling with a wireless card, his IP would change quite a lot in this scenario. Or, it could be an AOL user and requess could be routed through who knows how many different requestors. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Migration of applications to PHP 5.4
Hello, i recently migrated my webserver from Debian Lenny (with PHP 4.x) to Wheezy with PHP 5.4. Some applications like mediawiki could be updated and they are running fine. But there are some old and beloved applications that run any more. A good example is PHPmyedit 5.7.1 http://www.phpmyedit.org/ The first page with data is displayed but all links and buttons are dead! There is no error produced by PHP and i have no idea why it is not working? I'm have only basic knowledge with PHP and would be glad to have some tips how to debug things without error. My hope is that this migration problem is known and can be fixed simply? Thanks Karsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Migration of applications to PHP 5.4
Hello, i recently migrated my webserver from Debian Lenny (with PHP 4.x) to Wheezy with PHP 5.4. Some applications like mediawiki could be updated and they are running fine. But there are some old and beloved applications that run any more. A good example is PHPmyedit 5.7.1 http://www.phpmyedit.org/ The first page with data is displayed but all links and buttons are dead! There is no error produced by PHP and i have no idea why it is not working? I'm have only basic knowledge with PHP and would be glad to have some tips how to debug things without error. My hope is that this migration problem is known and can be fixed simply? Thanks Karsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Migration of applications to PHP 5.4
On Tue, Jun 25, 2013 at 07:58:32PM +0200, Forum wrote: Hello, i recently migrated my webserver from Debian Lenny (with PHP 4.x) to Wheezy with PHP 5.4. Some applications like mediawiki could be updated and they are running fine. But there are some old and beloved applications that run any more. A good example is PHPmyedit 5.7.1 http://www.phpmyedit.org/ The first page with data is displayed but all links and buttons are dead! There is no error produced by PHP and i have no idea why it is not working? I'm have only basic knowledge with PHP and would be glad to have some tips how to debug things without error. My hope is that this migration problem is known and can be fixed simply? You should probably turn your error reporting threshold way up, so you can see what's happening. Ultimately, you'll probably need to contact the authors of the individual packages to get them to upgrade, so they can see the problems and fix them. Paul -- Paul M. Foster http://noferblatz.com http://quillandmouse.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with variables
Hello, I am working with php and codeigniter, but I have not yet experienced. I need create a variable that is available throughout system. This variable contains the number of company and can change. as I can handle this? Thank you, very much! Ferd
[PHP] Re: Problem with variables
On 6/25/2013 5:46 PM, Fernando A wrote: Hello, I am working with php and codeigniter, but I have not yet experienced. I need create a variable that is available throughout system. This variable contains the number of company and can change. as I can handle this? Thank you, very much! Ferd One way would be to create a file like this: ? // company_info.php $_SESSION['company_name'] = My Company; $_SESSION['company_addr1'] = 1 Main St.; etc. etc. etc. Then - in your startup script (or in every script), use an include statement: ?php session_start(); include($path_to_includes./company_info.php); Now you will have those SESSION vars available for the entire session, basically until you close your browser. You can also use the php.ini auto-prepend setting, which automatically does this for you, altho the vars would not be session vars, since the prepend-ed file happens before your script issues the session_start (I think). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php