Jump to content

pmccall2

Members
  • Posts

    7
  • Joined

  • Last visited

pmccall2's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. http://php.net/manual/en/function.str-replace.php
  2. I usually try and separate the logic from the html. For the current code it would be something like. <?php //logic goes here if (isset($_GET['action']) && $_GET['action'] = "myaction") { $action = ""; } else { $action = "html string"; } ?> <div> <?php echo $action; ?> </div>
  3. Probably has something to do with your php tags. If the second else statement is used you have 2 sets of end tags.
  4. Ok, so found some js stuff in the project, and figured out how its done.... the display pages arent included if the variable from javascript is found. A simple way to do this in testing was: if (!isset($_POST['java_var']) { //include html } which works (though to be honest i dont understand it 100%). and the get variables, well there are none for the js, its all done in post. (I guess somebody already ran into that issue =p)
  5. http://us2.php.net/manual/en/language.operators.string.php .= is like add to previous value. Since there is no previous value for $password it cant add anything...
  6. Make sure $error is set. if (isset($error)) { // do error stuff } else { //no error do regular stuff }
  7. I'm new here and looking for help with a problem (already tried googling it, though I'm not sure I'm even explaining it correctly). The only file visible to the user is this <?php include "../../the-actual-site/index.php"; ?> The rest of the site is behind the "www" folder, and uses includes, get, and session, variables to navigate the pages. Now I want to add some javascript to the display pages, but some nasty things are happening when i do, i trimmed everything down to a bare example (just to make sure something else was not interfering), but these problems still persist. So for the example page I have setup the index.php in the www folder the same way, and used the page from this tutorial as a working example. The tutorial pages work fine if laid out as instructed, or renamed/moved around (but not included). So the first problem is that that the javascript requires me to expose the "index.php" part of the url to send a get variable. (I trued outputting just the "?var=" part, and it did not work) The production site never exposes this, and while I don't believe it would cause an issue, I would rather keeps things "as-is" than having people freak out over it. The second issues is that the javascript is making the page display twice once it starts working. Another instance of the page is created below the first one (the second is non-functional). So first, how can I use js in an include without the page duplicating? And second how do I get javascript to output clean GET variables without showing the "index.php" part?
×
×
  • 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.