osCmax v2.5 User Manual
Results 1 to 3 of 3

From account_details.php Tutorial, what does <?php } ?>

This is a discussion on From account_details.php Tutorial, what does <?php } ?> within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi, I'm new around here, and I hope that the forum will accept my &quot;newbie&quot; stage, as I get accustomed ...

      
  1. #1
    Lurker
    Join Date
    Jun 2003
    Posts
    2
    Rep Power
    0


    Default From account_details.php Tutorial, what does <?php } ?>

    Hi, I'm new around here, and I hope that the forum will accept my "newbie" stage, as I get accustomed to what types of questions are appropriate for this forum. If I make any mistakes, just let me know!

    Here's my first question. I'm new to php, so it would be great, if someone could point me in the right direction (tutorials, explanations, etc.)

    So, from the Mod Guide Chapter 3 Practice Exercises, I changed the order of the address items to: City, State, Post Code, and Country. And it works, see: http://bloomfront.com/purchase/default.php!

    Now, this may seem like a trivial question, but I'm thinking that I can avoid some problems later on down the line if I ask now. Here's the code that I moved to move the position of State:

    *************************************************
    &lt;?php
    if (ACCOUNT_STATE == 'true') {
    ?>
    &lt;tr>
    &lt;td class="main">&amp;&lt;?php echo ENTRY_STATE; ?>&lt;/td>
    &lt;td class="main">&amp;
    &lt;?php
    $state = tep_get_zone_name($country, $zone_id, $state);
    if ($is_read_only == true) {
    echo tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state']);
    } elseif ($error == true) {
    if ($entry_state_error == true) {
    if ($entry_state_has_zones == true) {
    $zones_array = array();
    $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' order by zone_name");
    while ($zones_values = tep_db_fetch_array($zones_query)) {
    $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
    }
    echo tep_draw_pull_down_menu('state', $zones_array) . '&amp;' . ENTRY_STATE_ERROR;
    } else {
    echo tep_draw_input_field('state') . '&amp;' . ENTRY_STATE_ERROR;
    }
    } else {
    echo $state . tep_draw_hidden_field('zone_id') . tep_draw_hidden_field('state');
    }
    } else {
    echo tep_draw_input_field('state', tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state'])) . '&amp;' . ENTRY_STATE_TEXT;
    }
    ?>&lt;/td>
    &lt;/tr>

    &lt;?php
    }
    ?>

    *************************************************

    Now, here's my question, the first question for me on this forum! What does the

    &lt;?php
    }
    ?>

    do? Does it need to be below the STATE information, or is it something that needs to be above certain code? Should I have left it above the COUNTRY info? I could do a test and just move it up and down in the file and see what happens, but I'd rather ask. There's one after GENDER or before ENTRY_FIRST_NAME in the original account_details.php file, but I don't know which, so I'm not sure how to move things around.

    OK, that's it, I may have missed something very simple, so I thought I'd ask.

    Looking forward to participating at oscdox.com.

    Sincerely,
    Dainis

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default

    That just opens and closes a php statement. The easiest way to see what happens when you remove something is to remove it, and test your cart. If everything works fine, move on. If not, put it back.

    I know it sounds simplistic, but sometimes trial and error is the best teacher.

    In this case, just leave it be, since everything is working.
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    Lurker
    Join Date
    Jun 2003
    Posts
    2
    Rep Power
    0


    Default

    I guess I'll really need to go deeper here, b/c it looks to me like &lt;?php opens a php statement, and ?> closes one. }{ look like sub section demarkers along with (). But

    &lt;?php
    }
    ?>

    all by itself, to me, at this time, looks like an empty piece of useless code. Aha, unless it's some kind of insertion of the } into the php code. I wonder if there's a

    &lt;?php
    {
    ?>

    above it somewhere?

    With regard to "leaving it be," I already didn't do that when I did the practical exercise -- I needed to choose whether to bring that piece of code along with the code for STATE (leaving it BELOW state), or whether to leave it ABOVE whatever it was above, I can't remember what that was right now.

    At any rate, thanks for the tip. I'll be on the lookout and prowl for further info.

    --Dainis

Similar Threads

  1. Were is the tutorial on adding new boxes For version 2?
    By badadz in forum osCMax v2 Features Discussion
    Replies: 0
    Last Post: 10-18-2005, 12:09 AM
  2. Replies: 7
    Last Post: 10-15-2005, 10:52 AM
  3. osCMax dynamic meta tag tutorial
    By michael_s in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 01-12-2005, 11:10 AM
  4. htmlarea / WYSIWYG Editor 1.7 a tutorial, or a guide?
    By prot in forum osCMax v1.7 General Mods Discussion
    Replies: 7
    Last Post: 06-28-2004, 02:43 PM
  5. Remove Country DropDown in account_details.php
    By Petter in forum osCommerce 2.2 Modification Help
    Replies: 10
    Last Post: 05-10-2004, 12:20 AM

Bookmarks

Posting Permissions

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