Jump to content

nancygraz

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by nancygraz

  1. I really appreciate your trying to help - I guess I am having trouble describing/conveying what it is I am asking. :-( I already have my two target pages created, hidden, and I know what their specific urls are. What I cannot figure out is the specific command to use to display the desired page. I have tried using an echo construct formatted as shown above in my previous post. Although I provided a "dummy" url in my sample code above, I used my actual page urls when testing my code. When I format my target urls within the echo construct as shown in my sample code, the expected page is not displayed - all I get is a blank page. I suspect I am either not formatting the urls properly for use in the echo construct, or I should be using another command to display the pages. Hopefully third time is the charm and I have explained myself better this time... :-D Thanks again! Nancy
  2. I just reread my original post and realized that I neglected to make clear what my question/difficulty is... DOH! [FWIW, I am using a WP plugin (i.e., Shortcode Exec PHP,) to define my shortcode - this plugin is perfect for my particular needs at this point. I am sure down the road I will graduate to doing this the proper way as described in mweldan's response. :-) ] Anyway, here is my question for everyone: How should I code the two urls for the pages I want displayed? So far I have tried using two echo constructs similar to the following (sample) to display the desired webpages: echo '<a href="http://url_to_wp_page.com"></a>'; This did not work - nothing was displayed. Just got a pretty white page... But when I echo text alone, everything works perfectly, and the text string is displayed as expected. I am obviously either using the wrong method to "display" the pages, or I have not used the proper syntax for the echo construct... Anyone have any ideas? Thanks again! Nancy
  3. I am a PHP newbie, and although I have done some programming (not a lot) in the distant past (Pascal, Fortran, Assembly, dabbled in C slightly,) please forgive me if this is a classic "newbie's" dumb question. I just implemented a WordPress-based online registration form for an upcoming event. Registration will be closing on a specific date, and I am trying to create a PHP routine with the following logic: If registration is open, the Registration Form should be displayed; If registration is closed, a Registration is Closed page/message should be displayed. I have the date comparison code written and it works like a charm provided all I do is echo "hard coded" text to the screen. Both the Registration Form and the Registration is Closed pages are WordPress pages within my site and can be accessesd via Permalinks/URLs. Although I could hardcode the content of each of these two pages into my PHP routine, I would prefer to point to the two pages to facilitate future content updates/changes/additions/etc. Additionally, I would like to implement this routine as a ShortCode which would be placed on its own WordPress page. The page containing the shortcode would be accessed via a Menu Tab on my page - when the tab is clicked (i.e., someone wants to register,) the PHP routine would ascertain the status of Registration (i.e., open or closed,) and then display the appropriate page. Here is my code as it stands now (with text hardcoded within the echo construct rather than my pages' urls...): <?php /* This compares today's date with the date registration closes. If registration is open, the registration page will be displayed. If registration is closed, the registration is closed page is displayed. */ $reg_close_date = "2013-04-08"; $todays_date = date("Y-m-d"); $today = strtotime($todays_date); $registration_closed_date = strtotime($reg_close_date); if ($registration_closed_date >= $today){ echo 'display registration form'; } else { echo 'display registration is closed form'; } ?> As I mentioned earlier, I am a PHP newbie, and I GREATLT appreciate any help anyone can offer... For all I know, what I would like to do is not possible, although I suspect my use of echo constructs may be the incorrect choice for what I want to achieve. Thanks in advance! Nancy
  4. Hi Everyone, Although I have been creating/customizing/administering several WordPress sites for a few years (including the installation, creation of the DBs, etc.,) I am just now starting to gain some courage and have started playing with PHP. I have even done some minor code tweaking to one of my plugins to add an additional level of functionality to it. I apologize in advance for any questions I may ask that may have been asked previously. Before posting my question though, I will make every attempt to find an answer using the "search" feature for the forum, as well as by perusing the various forums for an answer. Thanks in advance for any and all help! Nancy
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.