Jump to content

ejay

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ejay's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It is. After having a look at your code (which is not complete, so the solution will be a guess), I think you'll need to do following 2 steps //1. add the named anchor above your div <a name="line1"></a> <div id="line1>hello</div> //2. add following code just above the closing body tag ( </body> ) <?php if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($submit_line)) { ?> <script type="text/javascript">window.location.hash = 'line1';</script> <?php } ?> I hope this works.
  2. No that's not what I meant. It seems that you're not applying PRG (Post-Redirect-Get) pattern, if I understand correctly. Please post the form handling code.
  3. you were misreading the array structure. The first line in var_dump output in reply # 3 is "array(1) {" which indicates that the outer array has only one element in it, so you can't do $matches[1] Please mark solved if it is solved
  4. headers don't have to do anything with it. You will not be using the div's ID but a named anchor just above the target div instead. Say you want to "redirect (as you say)" the user to a specific div element with id=line1, you do something like this //page test.php //... <a name="line1" /> <div id="line1>hello</div> and then from the form submit handling script, redirect user to test.php#line1 instead of just test.php The div's id is not bound to be same as named anchor's name.
  5. If you are using header("Location: ....."); after setCookie(...) , cookie might not be set in all cases
  6. This might work -------------------------------------- ATSnotes.php class ATSnotes extends ATSdb //... function getNotes($stationID = 0) { $col = $this->getColumnNames(); if (count($col) > 0) { //... $yada = $this->query("SELECT * FROM " . $this->getTableName() . ($stationID > 0? " WHERE fldStationID = $stationID " : '') . " ORDER BY $col[2] DESC, $col[2] DESC"); //... _________________________________________________ ____________________________________ 3. stationNotesEditDel.php //... //... unset ($dada); $dada = $db->getNotes($StationID); //... //...
  7. try adding return true; as the first line of validateForm() or just try removing onsubmit = \"return validateForm()\" from your string
  8. you need to do echo $match[0][1]; instead of echo $match[1];
  9. you may need to do <?php $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $domain_name = $_SERVER['HTTP_HOST']; $site_url = $protocol.$domain_name; ?> <link rel="stylesheet" href="<?php echo $site_url ?>/css/style.css">
  10. //code to divide array into chunks of size 10 $group_size = 10; $input_array = array_chunk($input_array, $group_size, true)
  11. Pls post your table HTML (not php code that generates the table) and the PHP code that does database update.
  12. replace if(mysql_num_rows($blog_sql==0)){ with if(mysql_num_rows($blog_sql)==0){
  13. ejay

    PHP Help!

    <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (isset($_POST["pokemon_id"])) { $result = mysql_query("SELECT * FROM firemap WHERE id = " . intval($_POST["pokemon_id"])); $row = mysql_fetch_assoc($result); // or whatever you do with plain mysql functions if (isset($row['id'])) { echo "<div class=\"pokemonalign\">"; echo $row['image']; echo "</br>"; echo 'You have captured Wild'; echo $row['name'] . ""; echo "</div>"; $add = mysql_query("INSERT INTO pokemon (pokedex_id, owner_id, type, nickname) VALUES ('$row[id]', '$id', '1', '$row[name]')"); } } } else { $map = rand(1, 10); $result = mysql_query("SELECT * FROM firemap ORDER BY RAND() LIMIT 1"); while ($row = mysql_fetch_array($result)) { if ($map == 1) { echo "<br />"; echo '<img src="' . $row['image'] . '" alt="" />'; echo "<br />"; echo "A wild "; echo $row['name'] . " Appeared. <br /> Level: " . $row['level']; echo "<br />"; echo "<form action='map1.php' method='post'>"; echo "<input type='hidden' name='pokemon_id' value='$row[id]' />"; echo "<input type='submit' class='catchpokemon' value='Catch $row[name]' />"; echo "</form>"; } else { echo "<div class=\"pokemontext\">"; echo "<b>No more wild Pokémon appeared.</b>"; echo "<br />"; echo "<i>Keep moving around to find one.</i>"; echo "</div>"; } } } ?>
×
×
  • 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.