Jump to content

Flight19

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Female

Flight19's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks and apologies! It's been a while since I logged into their Yahoo! site and it looks like Yahoo! updated what they allow as of October. When I first uploaded a test chunk of the site around August, Yahoo! was not allowing inclusion and was recommending another statement to access a local path, but when I tested it out, none of my variations worked out. I can see that that they still don't allow access to .htaccess or php.ini files though. I just uploaded new test files to Yahoo! (same PHP as in August but with recent changes to CSS) and it appears to be working. Thank you all for your help!
  2. Hello! I am in the process of building a site for which I would ordinarily use include statements to pull page content into the main template. I'm also using a switch statement that involves includes to randomly pull content into a supplementary element on each "page." My problem? The person I am creating this site for has INSISTED on hosting with Yahoo! and Yahoo! places all sorts of restrictions on allowable PHP including the prohibition of include statements and disallowing the client from accessing php.ini and .htaccess files. I am, of course, using CSS for 100% of the styling and I know that I could revert to separate XHTML pages for all of the content and utilize JavaScript for the random content. But with the amount of content that I need to include, the JavaScript in particular would end up being very bulky indeed. Here is the code I ordinarily use to call in the page content: <?php require_once("utils.php"); $_params = getParams(); /* $_pageName = ($_params["page"] != "" ? $_params["page"] : "home"); $_pageName .= ".php"; */ $_pageName = getPage() . ".php"; ?> -and- <div class="text"> <!-- page main content area --> <?php include($_pageName); ?> <!-- end page main content area --> </div> Here is the switch statement I was utilizing for the supplementary content: <div class="feature"> <?php //chooses a random number $num = Rand (0,4) ; //starts the random quote switch loop switch ($num) { case 0: include("features/placeholder.php"); break; case 1: include("features/placeholder2.php"); break; case 2: include("features/placeholder3.php"); break; case 3: include("features/placeholder4.php"); break; case 4: include("features/placeholder5.php"); break; } ?> <div class="feature_bottom"></div></div> Does anyone have a suggestion for accomplishing these tasks without use of the include statement? Any assistance is much appreciated!
  3. Hmmm... My last reply from a few days ago didn't post. Odd. Anyway, I'll just repeat what I had set to post before... Thank you so much for your help. That last suggestion worked beautifully. Since I am trying to learn this, (only if you have time and it's convenient) can you explain to me why the extra parenthesis work and are needed? And also why the || wouldn't work in my earlier versions of this PHP statement? Thanks so much again!
  4. Wow! This seems to have done it. I can follow most of it since it's mostly what I started out with, but what do the extra parenthesis around the "getPage" mean and why do they need to be there? One of the problems I've been having with tutorials is that while they offer very basic examples of the syntax to use, they don't really give exercises or examples for how to build on them. Thank you so much for your help! I really really appreciate it.
  5. http://flight19creative.com/webtest/home http://flight19creative.com/webtest/overview.html (Still trying to figure out why this one comes up with the .html extension. There is no overview.html in this directory, and no links for overview.html, so something odd is going on here.) Anyway, hopefully you can see what's going on and tell me what I am doing wrong! I'm a decent designer, and I'm good with XHTML and CSS, but I want to learn more than that, and I really want to learn PHP! Thanks for all of your help!
  6. I don't know if the problem is with the header, or if it's something else. It does pull content in, but only the default. The switch does not get made.
  7. All of the page content is pulled into the index.php via include statement.
  8. At the moment, all of my .php documents are just in the root folder. (Hopefully that's what you were asking me to clarify. if not, let me know!) Thanks again!
  9. Okay. I tried using: $page = $_GET['page']; and $page = "_pageName"; as well as leaving it blank like this. $page = ""; If I don't include the statement to set the page at all, no part of the site loads. If I do include it and set it to "home," only the material for the "home" set is pulled into all of the pages. If I do either of the above, the site loads, but with the content to be called by the switch statement completely absent. I know I have a lot to learn, and all help given is much appreciated.
  10. Thanks! That helped quite a bit. I was not aware that I could not use "||" for this. The include for the "home," "contact," etc. pages is now working, but it pulls into the other pages as well, so I don't think the switch is working. I've gone back over everything and it looks correct. Is there some dumb little thing I am missing? Thanks!
  11. A little background on the document... This script is already being used in conjunction with an include statement to pull the appropriate page content into the file. It works just fine, but I figured I should mention it in case it has any bearing on the script I'm having trouble with: <?php require_once("utils.php"); $_params = getParams(); /* $_pageName = ($_params["page"] != "" ? $_params["page"] : "home"); $_pageName .= ".php"; */ $_pageName = getPage() . ".php"; ?> My site has a number of sections. The above script pulls individual page material in, but I'm also trying to include some graphics and a sub-menu that are specific to the "section." For example, I want one set of images and sub-menu to display when someone is viewing the "home," "company," "contact," or "faq" pages, and another set of images and sub-menu to display when someone is viewing the "print overview" or "printing arrangement pages. I've started the following Switch script to accomplish this, but it doesn't work yet. I'm new to PHP and still learning so if anyone can make a suggestion or let me know what I am doing wrong, it would be greatly appreciated. Here is the Switch script thus far: <?php //set page name $page = "home"; switch ($page) { case "home || overview || contact || faq": include("imgdefault.php"); break; case "pr_overview || pr_arrangement": include("imgprint.php"); break; case "web_overview": include("imgweb.php"); break; } ?>
×
×
  • 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.