Thread: Php 7

Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,544
    Plugin Contributions
    127

    Default Re: Php 7

    LOL fair enough. Thanks for updating this in your contribs. Once MAMP releases a version with PHP7 I will do likewise.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  2. #12
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Php 7

    Quote Originally Posted by swguy View Post
    LOL fair enough. Thanks for updating this in your contribs. Once MAMP releases a version with PHP7 I will do likewise.
    Not saying need to un out and make the change, but if touching the files in the mean time, __construct would work just as well on pretty much anything runniing PHP 5.x and above (yes, I know there is a lower limit, but can't remember now what it is/was). I've been moving that way relatively recently.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #13
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Php 7

    Quote Originally Posted by mc12345678 View Post
    Not saying need to un out and make the change, but if touching the files in the mean time, __construct would work just as well on pretty much anything runniing PHP 5.x and above (yes, I know there is a lower limit, but can't remember now what it is/was). I've been moving that way relatively recently.
    Usually just renaming the function to __construct is enough ..... but, double check your code to be sure that you don't ever directly call that function from code either inside or outside that class.

    For example, in ZC the Admin object_info class gets called in numerous files via pInfo->objectInfo() ... so, we've rewritten (and are rewriting the v160 rewrite of) the class to have both a __construct() and an objectInfo() function ... which makes it PHP7 compatible and also backward-compatible to PHP5.
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #14
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,544
    Plugin Contributions
    127

    Default Re: Php 7

    The MAMP team just announced that they'd be releasing a new MAMP with PHP7 in the next 10 days!

    https://twitter.com/mamp_en/status/673846269643726848
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #15
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Php 7

    And for Debian based Linux users try this PPA for your LAMP stack:

    https://launchpad.net/~ondrej/+archive/ubuntu/php-7.0

    Other downloads of PHP 7.0.1 from the php.net server:

    https://downloads.php.net/~ab/

  6. #16
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Php 7

    Quote Originally Posted by DrByte View Post
    Usually just renaming the function to __construct is enough ..... but, double check your code to be sure that you don't ever directly call that function from code either inside or outside that class.

    For example, in ZC the Admin object_info class gets called in numerous files via pInfo->objectInfo() ... so, we've rewritten (and are rewriting the v160 rewrite of) the class to have both a __construct() and an objectInfo() function ... which makes it PHP7 compatible and also backward-compatible to PHP5.
    I appear to have some sort of bran fog today, thought about wating to post back, but might as well get the ball rolling... Trying to understand if in fact the reverse compatibilty isn't really wth PHP 5 in general, but instead wth older ZC versions (ie. "This" file will work on ZC versions that are compatible wth Php 5.x and PHP 7...) Such that the older code that still calls the previous constructor doesn't need to be modified (as much) to work wth the newer version(s)... Otherwse I don't see the potential compatibility issue of leaving out the function by the name of the class when referring to PHP 5 (brain fog part at the moment)...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #17
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Php 7

    Quote Originally Posted by mc12345678 View Post
    I appear to have some sort of bran fog today, thought about wating to post back, but might as well get the ball rolling... Trying to understand if in fact the reverse compatibilty isn't really wth PHP 5 in general, but instead wth older ZC versions (ie. "This" file will work on ZC versions that are compatible wth Php 5.x and PHP 7...) Such that the older code that still calls the previous constructor doesn't need to be modified (as much) to work wth the newer version(s)... Otherwse I don't see the potential compatibility issue of leaving out the function by the name of the class when referring to PHP 5 (brain fog part at the moment)...
    I don't think I fully understand what you're saying.

    PHP5 will understand __construct() just fine. So will PHP7.

    What PHP7 and 8 are moving towards is not automatically treating a class method of "foo" inside class named "foo" as the constructor. Instead, it will ignore the "foo" method and assume the class has no constructor if no __construct() method exists. To create the same functionality as PHP5, the __construct() method can simply call $this->foo(); to accomplish the old behaviour.
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #18
    Join Date
    May 2016
    Location
    Bulgaaria
    Posts
    28
    Plugin Contributions
    0

    Default Re: Php 7

    This is my website http://hopshop.bg/, .this is product page http://hopshop.bg/index.php?main_pag...oducts_id=7187. added a contact form on products and quick order, but does not work on php 7 .... this is the code:

    My Version Zen Cart 1.5.5a

    PHP Code:
    <! ------------------------------------------------ --------------------------------------->
    <? Php echo "Quick order with a click of product: .. (* for this product on this page): >>"?> <B> <? Php echo $ products_name; ?> <? Php echo "... Price"?>
    <! - Bof Product Price block ->
    <? Php
    ####echo $ one_time. ((Zen_has_product_attributes_values ​​((int) $ _ GET [ 'products_id']) and $ flag_show_product_info_starting_at == 1)? TEXT_BASE_PRICE: ''). zen_get_products_display_price ((int) $ _ GET [ 'products_id']);
    ?>
    <! - Eof Product Price block ->
    </ B>
    <? Php
    // Contact Form via email // itbg.eu // Dev7 //
    $ Gg = 'http: //';
    $ Ggg = $ products_name;
    $ Gggg = $ one_time. ((Zen_has_product_attributes_values ​​((int) $ _ GET [ 'products_id']) and $ flag_show_product_info_starting_at == 1)? TEXT_BASE_PRICE: ''). zen_get_products_display_price ((int) $ _ GET [ 'products_id']);
    $ Contact_email = $ _POST [ 'EmailAddress'];
    $ Contact_subject = $ _POST [ 'Subject'];
    $ Contact_name = $ _POST [ 'FullName'];
    $ Contact_message = $ _POST [ 'Message'];
    $ Mydate = date ( 'l, F d Y g: i A', time () + 240);
    $ To = "[email protected]"; // E-mail to which messages will be sent //
    $ Message. = "Address:". $ Address. "\ R \ n";
    $ Subject = "HopShop-Order:". $ Ggg. "\ R \ n". "Name:". $ Contact_name. "\ R \ n". "Tel:". $ Contact_subject. "\ R \ n"; // // Subject
    $ Message = "From HopShop.Bg ---- Tel: 0878843093 \ r \ n \ r \ n" // text message //
    . "Product: $ products_name \ r \ n". "Price: $ gggg \ r \ n"
    . "Model: $ products_model; \ r \ n"
    . "Link product ordered: $ gg {$ _ SERVER [ 'SERVER_NAME']} {$ _ SERVER [ 'REQUEST_URI']} \ r \ n"
    . "------------------------------------------------ ------------------------------- \ r \ n "
    . "------------------------------------------------ ------------------------------- \ r \ n "
    . "Name: $ contact_name \ r \ n"
    . "Phone client: $ contact_subject \ r \ n"
    . "Shipping Address (+ Other information on order): \ r \ n \ r \ n $ contact_message \ r \ n"
    . "------------------------------------------------ ------------------------------- \ r \ n "
    . "------------------------------------------------ ------------------------------- \ r \ n "
    . "Date: $ mydate \ r \ n"
    . "From IP: {$ _SERVER [ 'REMOTE_ADDR']} \ r \ n \ r \ n";
    $ Headers = "From: $ contact_name <$ contact_email> \ n"
    . "Content-type: text / plain; charset = UTF-8 \ n"
    . "Reply-To: $ contact_email \ n"
    . "X-Mailer: PHP /". Phpversion ();
    if (empty ($ contact_name) || empty ($ contact_email) || empty ($ contact_subject) || empty ($ contact_message)) {
    ?>

    <Form id = "contact" method = "post" action = ""> <br/>
    <Div id = "from">
    Full name: <br /> <input type = "text" name = "FullName" size = "25" /> <br/>
    </ Div>
    E-mail: <br/> <input type = "text" name = "EmailAddress" size = "25" /> <br/>
    Phone: <br /> <input type = "text" name = "Subject" size = "25" /> <br/>
    Delivery address (or Econt office)
    <br/> <textarea rows = "6" name = "Message" size = "10" cols = "10" class = "input"> </ textarea> <br/>
    <Input type = "submit" value = "confirm order with just one click" /> <input type = "reset" value = "Clear" />
    </ Form>

    <? Php
    } Elseif (! Ereg ( "^ [_ a-z0-9 -] + (\. [_ A-z0-9 -] +) * @ [a-z0-9 -] + (\. [A-z0-9 -] +) * (\. [az] {2,3}) $ ", $ contact_email)) {
    echo "<p> Error: Please enter a valid e-mail. </ p>";
    } Else {
    mail ($ to, $ subject, $ message, $ headers);
    echo "<h3> Your order is accepted! </ h3> <p> $ contact_name, <br /> as possible - will soon contact you $ contact_email.";
    }
    ?>

  9. #19
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Php 7

    Does that work on php anything? There appear to be a number of coding errors throughout. Not to mention that with the use of the form tag, it is not ZC compliant and will cause an issue if attempting to submit it because it doesn't have the applicable session information saved with it.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #20
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,544
    Plugin Contributions
    127

    Default Re: Php 7

    @Mustang80 have you looked at the Ask A Question contribution in the plugins area? It might do what you want, and it already works with PHP7.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v154 application/x-httpd-php html_header.php PHP script text
    By Parafanaylya in forum General Questions
    Replies: 3
    Last Post: 29 Aug 2015, 03:06 PM
  2. Replies: 4
    Last Post: 17 Jul 2015, 04:44 AM
  3. v151 Incorrect Error 406 from application_top.php in some PHP configurations
    By steele in forum Installing on a Linux/Unix Server
    Replies: 0
    Last Post: 24 Nov 2012, 05:08 AM
  4. Linking Page_2.php, Page_3.php, Page_4.php In Footer
    By gws76 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 May 2007, 10:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg