Jump to content

uniflare

Members
  • Posts

    867
  • Joined

  • Last visited

Posts posted by uniflare

  1. Hmm, it seems i cannot debug any further, your server will not accept POST variables sent from an outside address, so i cant mess around with the form.

     

    Basically, put this into test.html:

     

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <base href="http://www.gamergun.nl" />
    <!-- 10eeb0a7337dc8db46881b3e2d4fb620mochiads.com -->
    
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>GamerGun - Play Games For Free - Free Flash Games</title>
    <meta name="Keywords" content="" />
    <meta name="Play games for free" content="" />
    <link href="index.css" rel="stylesheet" type="text/css" /><script type="text/javascript">//<![CDATA[
    
    function checkAgeCheckBox(f){
    
    var dob=new Date();
    var date=dob.getDate();
    var month=dob.getMonth() + 1;
    var year=dob.getFullYear();
    
    var cmbmonth=parseInt(document.getElementById("cmbmonth").options[document.getElementById("cmbmonth").selectedIndex].value);
    var cmbday=parseInt(document.getElementById("cmbday").options[document.getElementById("cmbday").selectedIndex].value);
    var cmbyear=parseInt(document.getElementById("cmbyear").options[document.getElementById("cmbyear").selectedIndex].value);
    
    age=year-cmbyear;
    
    if(cmbmonth>month){age--;}
    else{if(cmbmonth==month && cmbday>=date){age--;}}
    
    if(cmbmonth==0){alert("Je moet wel je geboortemaand opgeven.");return false;}
    else if(cmbday==0){alert("Je moet wel je geboortedag opgeven.");return false;}
    else if(cmbyear==2008){alert("Je moet wel je geboortejaar opgeven.");return false;}
    else if(age<18){alert("Je bent onder de 18 jaar en mag geen gebruik maken van deze adult games!");location.replace("http://www.gamergun.nl/");return false;}
    else if(!document.getElementById("agree").checked){alert('Je moet wel instemmen met de voorwaarden.');return false;}
    else{return true;}
    
    }
    
    //]]></script>
    
    <script src="/mint/?js" type="text/javascript"></script>
    </head>
    <body>
    
    <a name="top"></a>
    <table width="892" cellpadding="0" cellspacing="0" align="center" class="text">
    <tr><td>
    <div id="container">
    <!--[if lte IE 7]>
        <link rel="stylesheet" type="text/css" href="ie_style.css" media="screen" />
    <![endif]--> 
    
    <!--Thumbnails-->
    
    <div id="thumbblok"></div>
    <script type="text/javascript" src="js/thumbs.js"></script>
    <script language="JavaScript" src="w4ftell.js" type="text/javascript"></script>
    <!--End Thumbnails-->
    <div id="header">
    <h1>GamerGun</h1>
    
    <h2>Play games for free</h2>
    <ul>
    	<li><a href="index.php" accesskey="3" title="">Home</a></li>
            <li><a href="multiplayerbox.php" accesskey="2" title="multiplayer games">Multiplayer</a></li>
    	<li><a href="index_games.php?games=alle" accesskey="4" title="">All games</a></li>
    	<li><a href="index_cats.php?cat=alle" accesskey="5" title="">Categories</a></li>
    
    	<li><a href="help.php" accesskey="6" title="">Help</a></li>
    </ul>
    </div>
    <div id="box_random">
    <table width="250" border="0" cellpadding="3" cellspacing="0" class="random_text"><tr><td rowspan="2" width="75" valign="top"><a href="game/79/Bug_Patrol.html"><img src="411.png" width="75" height="75" border="0" alt="" /></a></td><td valign="top" width="175" height="10"><a href="game/79/Bug_Patrol.html">Bug Patrol</a></td></tr><tr><td valign="top">Spray down the approaching bugs using your deadly spray before they reach the flowers....</td></tr></table><table width="250" border="0" cellpadding="3" cellspacing="0" class="random_text"><tr><td rowspan="2" width="75" valign="top"><a href="game/2187/Metroid_Elements.html"><img src="1536.png" width="75" height="75" border="0" alt="" /></a></td><td valign="top" width="175" height="10"><a href="game/2187/Metroid_Elements.html">Metroid Elements</a></td></tr><tr><td valign="top">Guide Samus Aran through the dangerous Pyramid and destroy all the Metroids and defeat Ridley....</td></tr></table></div>
    
    
    
    <div id="content">
    
    
    <div id="games">
    <div style="text-align:center" /> 
    
    <h2>Snoopy Click</h2>Description: Snoopy Cilck is a game with its intention to test your memory capability.			<p align="center"><script  type="text/javascript" src="http://www.ads4free.nl/show_banner.php?user=gamergun&size=4"></script>
    		<object type="application/x-shockwave-flash" data="games/20529.swf" width="700" height="550"> <param name="movie" value="games/20529.swf" /> <param name="quality" value="high"/> </object>			<br />
    		<a href="javascript:newWindow('sendpage.php?'+document.location.href,'tell',500,400,'')">Notify someone about this game!</a> - 
    		<a href="javascript:newWindow('pre_send_mail_broken.php?'+document.location.href,'tell',500,450,'')">Game not working? Tell us now!</a><br />
    
    		</p> 
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>GamerGun - Play Games For Free - Free Flash Games</title>
    <meta name="Keywords" content="" />
    <meta name="Play games for free" content="" />
    <link href="index.css" rel="stylesheet" type="text/css" />Times played: 10 - Score: <b>0 / 10  </b>(0 votes)
    <form method="post" action="rating.php">
    <input type="hidden" name="ip" value="93.97.208.2" />
    <input type="hidden" name="id" value="443" />
    <label for="cijfer">Rate:</label>
    <select name="vote" id="vote">
    <option>10</option>
    
    <option>9</option>
    <option>8</option>
    <option>7</option>
    <option>6</option>
    <option>5</option>
    <option>4</option>
    <option>3</option>
    <option>2</option>
    <option>1</option>
    
    
    </select>
    <input type="submit" value="Vote!" />
    </form>
    <b>Tags:</b> <div id="footer_ads">
    <table class="footerding" align="center">
    <tr><td width="250"><b>Steun GamerGun</b><br />
    Steun GamerGun.nl door op <a href="http://www.gamergun.nl/out.php?id=17" target="_blank">deze link</a> te klikken.<br />
    Hiermee komen wij hoger in de GameTop.
    Bedankt!</td>
    
    <td width="50">|<br />|<br />|<br />|</td>
    <td width="500" align="center">	<p><a href="http://www.gamergun.nl/out.php?id=17" target="_blank"><img src="http://www.gamergun.nl/images/gametop_banner_xxx.gif" border="0" style="border-color: #000000" width="468" height="60" alt="Kom jij met mij spelen Gametop" title="Kom jij met mij spelen Gametop" /></a></p></td></tr>
    </table></div>
    
    <div id="footer">
    
    <div class="topimage"><a href="#top"><img src="images/top.jpg" alt="Go to top" border="0" /></a></div>
    
    <p style="text-align: center"> <br />Copyright (c) 2009 GamerGun - Play Games For Free - Free Flash Games. All Rights Reserved.<br />
    <a href="index.php" accesskey="8" title="">Home</a> | 
    
    <a href="help.php" accesskey="8" title="">Help</a> | 
    <a href="advertise.php" accesskey="8" title="">Advertise</a> | 
    <a href="linktous.php" accesskey="8" title="">Link to GamerGun</a> | 
    <a href="terms.php" accesskey="8" title="">Terms</a> | 
    <a href="newsletter.php" accesskey="8" title="">Newsletter</a> | 
    <a href="mail.php" accesskey="8" title="">Contact</a><br />
    
    Page loaded in 0.019 seconds
    </p></div>
    
    </div>
    </div>
    </div>
    </td></tr></table>
    </body>
    </html>
    

     

    Then, keep trying to post data from it, start with just leaving the form tags and the form elements, if that works then you know its something on the page; and you can start putting bits back in line b line until you find whats causing it.

     

    the fact that the small test.html works shows that there is something wrong with the way its posting data, maybe a server restriction bug (never seen this restriction b4), or just something in your html markup is messing up the form - you need to find out what it is.

     

    Good Luck.

  2. You can download "Free SMTP Server"s, they are like messengers, you ust click and install the server, and make sure ur php.ini smtp.path or w/e it is, is set to localhost.

     

    Most free smtp server software is buggy and unreliable.

     

     

    The other option would be to use a Mailer class library like PHPMailer to use authentication, you can use googles smtp server to send data to other emails then.

  3. gevans, he stated his version. but yes you could try request to see if the data is being accidentall sent threough the URL. via _GET.

     

    OR;

     

    save this to test.html (change ACTION_HERE to the URL of the buggy script).

     

    <form method="post" action="ACTION_HERE">
    <input type="text" name="text_input"><br />
    <input type="checkbox" value="Check1"><Br />
    <input type="submit" value="Submit Form">
    </form>

     

    view test.html in any browser (does not have to be off server can just double click the file.), and see if it has any post data then.

  4. This will fail if you dont select at least 1 checkbox. (implode failure).

     

    to fix this:

    $and_ornull = (count($_POST['criteria']) >= 1)? " AND" : "";
    $find2[] = $and_ornull." `".$Key."`='".$Value."'";

     

    Basically you only need the AND if there is at least 1 other search or 'where' term, so if any checkboxes are selected, then add the AND.

    ----------

     

    The implode function will still fail like this.

     

    You should put all the search elements into a single array (Add criteria to find2), then implode them all at once to fix this.

  5. There is something ouve missed or not told us,

     

    The page is not recieving any post information. at all. as if your not submitting the form to that page.

     

    make a normal html document, put the action to the URL of the buggy script, post any data with the var dump or print r at the top of your page. you should.

     

    Apart from;

    $_POST var being reset,

    accidentally posting URL arguments ($_GET);

    Old version of PHP (other scripts wouldnt work).

     

    there shud be no possible explanation why there is no post data. the other pages accept post data fine.

     

  6. Ok, im going to end this im afraid, if you dont understand the code have a good look through.

     

    To save time and page space, and me repeating myself again (no offense), here's the code that shud work:

     

    <?php 
    
    print "<link href='/skins/Cobalt/Cobalt.css' rel='stylesheet' type='text/css' media='screen'>";
    require('include/jamroom-include.inc.php'); 
    require_once('zipcode.class.php');      // zip code class 
    
    // FUNCTIONS
    Function array_limit($array,$start,$length){
       $return_array = array();
       for($i=$start;$i<($start + $length);$i++){
          $return_array[] = $array[$i];
       }
       return $return_array;
    }
    
    // creates a url without destroying the current one. (keeping it on the same page with the same values).
    function make_url($id_list){
       
       if(!is_Array($id_list)){
          echo("error, function make_url(arg), arg should be an array.");
          return;
       }
       
       // add each element
       foreach($id_list as $id_str=>$id_val){
          
          if($id_val === false){ // must use ===, since if you use ==, then 0, false, and null mean the same thing.
             
             $url = (!isset($url))? null : $url;
             
             $url = str_replace(
                array(
                   "&".$id_str."=".@$_GET[$id_str],
                   $id_str."=".@$_GET[$id_str]."&",
                   $id_str."=".@$_GET[$id_str]
                   ), 
                "", 
                $url
             );
          }else{
             // For the loop
             $url = (!isset($url))? $_SERVER['REQUEST_URI'] : $url;
             
             // if page is alread in the url somewhere get rid of it (or we will have lots of them,).
             $url = (isset($_GET[$id_str]))? str_replace(
                array(
                   "&".$id_str."=".@$_GET[$id_str],
                   $id_str."=".@$_GET[$id_str]."&",
                   $id_str."=".@$_GET[$id_str]
                   ), 
                "", 
                $url
             ) : $url; // the : colon is like the }else{ part of an if statement.
    
             $preq = (substr($url,-1) != "?")? "?" : "";
    
             // if there is already arguments u need to add the &, otherwise you need to add the ?.
             $url = ((count($_GET) == 1 && isset($_GET[$id_str])) || count($_GET) == 0)? $url.$preq.$id_str."=" : $url."&".$id_str."=".$id_val;
          }
       }
       
       return $url;
    }
    // END FUNCTIONS
    
    // GRAB ZIPS
    $z = new zipcode_class; 
    $zips = $z->get_zips_in_range($_POST['zip_code'], $_POST['miles'], _ZIPS_SORT_BY_DISTANCE_ASC, true); 
    
    // add searched for zip to $zips array 
    $zips[$_POST['zip_code']] = 0; 
    
    // make sure this is a multiple of $entriesperline;
    $rowsperpage = 16; // 4x4 grid - u can change this variable to change how many each page, without having to change any of the other code.
    $entriesperline=4;
    
    // PAGE VARIABLES
    $prev = make_url(
       array(
          "page"=>@$_GET['page'] - 1
       )
    );
    $next = make_url(
       array(
          "page"=>@$_GET['page'] + 1
       )
    );
    
    // Figure which row to start from.
    $startrow = (isset($_GET['page']) && $_GET['page'] != 0)? ($_GET['page'] - 1) * $rowsperpage : 0;
    
    // this is just to initialise the variable:
    $result_array = array();
    
    // Take only the result for this page...
    $zips = array_limit($zips,$startrow,$rowsperpage);
    
    // first we gather all the results into a single array:
    foreach ($zips as $key => $value){
       //find all locations within range using returned zipcode values 
    $sql_events = mysql_query("SELECT * FROM jamroom_band_info WHERE band_zipcode='$key' ORDER BY band_update DESC LIMIT 1");
    while ($row = mysql_fetch_array($sql_events)) 
    {
    	// we just add this row to the array:
    	$result_array[] = $row;
    }
    }
    
    // Used for Modulus
    $counter=1;
    print "<table>";
    
    // loop through each result row.
    $i = 0; // debug?
    
    foreach ($result_array As $row){
    
        if($counter%$entriesperline==1 && $i < 50){
                                         print "<tr><td align='center'><div class='body-zip'><a href=\"members/{$row['band_id']}\">{$row['band_name']}</a><br><a href=\"members/{$row['band_id']}\"><img border='0' src=\"image.php?band_id={$row['band_id']}&mode=band_image&width=100&theme=Sage\">{$row['band_image']}</a></div></td>";
       }else if($counter%$entriesperline==0 && $i < 50){
                      
                       print "<td align='center'><div class='body-zip'><a href=\"members/{$row['band_id']}\">{$row['band_name']}</a><br><a href=\"members/{$row['band_id']}\"><img border='0' src=\"image.php?band_id={$row['band_id']}&mode=band_image&width=100&theme=Sage\">{$row['band_image']}</a></td></div></tr>";
       }else if($i < 50){
                                          print "<td align='center'><div class='body-zip'><a href=\"members/{$row['band_id']}\">{$row['band_name']}</a><br><a href=\"members/{$row['band_id']}\"><img border='0' src=\"image.php?band_id={$row['band_id']}&mode=band_image&width=100&theme=Sage\">{$row['band_image']}</a></div></td>";
       }
       $counter++;
      $i++; 
    
    } //exit loop
    
    if($counter%$entriesperline!=0){
       print "</tr>";
       // Add my big function i told you about earlier to fix this header/footer problem.
    echo("<a href=\"$prev \">Prev</a> | ".htmlentities($_GET['page'])." | <a href=\"$next\">Next</a>"); 
    }
    
    print "</table>";
    
    ?>

     

    TAKE NOTE OF WHERE I PUT EVERYTHING, and figure out why.

     

    Thank you, and good night :P.

  7. ok i would use arrays, like youve done on the checkboxes.

     

    eg:

     

    in the form you use:

     

    <input type="text" name="form[username]" value="somevalue">

     

    this way you can do this:

     

    mysql_select_db($database_connuser, $connuser) or die;
    $find2 = array(); // rid us of those e_notice's.
    foreach($_POST['form'] As $Key=>$Value){
       $find2[] = " AND `".$Key."`='".$Value."'";
    }
    $find = implode("=1 AND ",$_POST['criteria'])."=1";
    $query = "select * from drinking where $find.$find2 order by venue asc";

  8. Ok, you need to understand where to put the code i gave you. You need to understand this its very basic so im only going to give you hints im afraid, dont worry though, you will hit yourself once u figure it out.

     

    You need to move a variable i mentioned earlier.

     

    and you need to move the $zips = array_limit.... line, the function code can be put anywhere (i put all my functions in a seperate file but i suggest putting them at the top at least).

     

    Read through and follow your code line by line. you can use echo() and print_r() (for arrays), to see what the value of each variable is at a specific point in the script - it really helps.

  9. I think to try keep things simple, why is it important that data is not inserted between those queries?

     

    Give us an example situation where this would be a problem, maybe there is a better method.

     

    lock tables, you will have to lock, then unlock straight away, thats 4 queries in total, unless those 2 queries are seconds apart, it wont make a difference.

  10. if ur making a config file, just make the first page of the install file -> the creation of the config file...

     

     

    Page 1-> Enter Configuration into a form, submit....

    Page 2-> Save Configuration silently using fopen/fwrite/fclose, then include() the file, install the script.

  11. the reason is the $zips array contais the list of zip codes found near that user, these zip codes are basically what you are displaying on ur tables, the mysql query is only there to get "more detailed" information about those zip codes.

     

    when you use a foreach, it s a For Each Zip Code.... Grab its single row.... since you cannot limit a single row, theres no need. you are getting the original "Rows" from the zip code function. all your doing with mysql is getting more information for each of those rows.

     

    Hope this helps clear things up.

  12. cookies cannot be used on the same execution that created them. use either a Header("location: ./url.php"); redirection, or log them in as you create the cookie, (rather than relying on the cookie to be there).

×
×
  • 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.