Jump to content

xwishmasterx

Members
  • Posts

    186
  • Joined

  • Last visited

Posts posted by xwishmasterx

  1. Hello

     

    I am having problems setting some security to a prize page on my website.

    What I need, is to make sure that a user cannot just refresh and get the price again.

    The price page is loaded in a frame so redirection is no good, and that doesn't stop the user from just hitting the "back" button and then refresh.

     

     

    Anyone have an idea how to do this the simple way?

  2. I have checked the connections and both are fine. It seems the problem running this part, when the other connection is there:

     

    <?php
    $away_members = mysql_query ("SELECT name FROM vtp_members WHERE id='58106' ", $dbh1)
    or die(mysql_error()); 
    $rs_away_members = mysql_fetch_array( $away_members );
    $away_member = $rs_away_members['name'];
    echo " $away_member ";
    
    ?>
    

     

    If I remove the connection to the remote server the above part works fine.

  3. What I have done is this, following an example I found..

     

    <?php
    $server = "xxxxxxxxxxxxxxx";
    $dbname = "lxxxxxxxxxxxxxxx";
    $user = "xxxxxxxxxx"; //Allowed for the ip
    $password = "xxxxxxxxxxxx";
    $link = mysql_connect($server,$user,$password) or die(mysql_error());
    mysql_select_db($dbname);  
    ?>
    <?php 
    $hostname = "localhost";
    $username = "xxxxxxxxxx";
    $password = "xxxxxxxxxxxxxxxx";
    $dbname2 = "xxxxxxxxxx";
    $dbh1 = mysql_connect($hostname, $username, $password) or die(mysql_error());
    mysql_select_db($dbname2);  
    ?>
    

     

    I have tried these to queries:

    <?php
    $home_members = mysql_query ("SELECT DISTINCT (credit_members_id) as homememberid FROM vtp_tracking WHERE action_date>date_sub(NOW(),interval 5 minute) AND credit_members_id=57983", $link)
    or die(mysql_error()); 
    $rs_home_members = mysql_fetch_array( $home_members );
    $home_member = $rs_home_members['homememberid'];
    echo " $home_member ";
    ?>
    
    <?php
    $away_members = mysql_query ("SELECT name FROM vtp_members WHERE id='58106' ", $dbh1)
    or die(mysql_error()); 
    $rs_away_members = mysql_fetch_array( $away_members );
    $away_member = $rs_away_members['name'];
    echo " $away_member ";
    
    ?>
    

     

    I can get a result from the first query, but none from the other. I am certain that it is the connection that is the problem or the wrong database.

  4. After a look at this, I simply have no idea what to do with it  :wtf:

     

    So here are some more info; I am trying to list some events by date. My problem is listing 2 events happening the same day where a "variable" can be 2 things.

     

    teamwartable.png

     

    As picture above shows team with id "21" is both attacker and defender on same date. (disregards war_ended date)

     

    When showing the events, It should show the date, the defending team name if any, and the attacking team if any.

     

    my query right now is:

    $sql_getevent = "SELECT DATE(war_started) AS war_started, attacker_name, defender_name, won, lost FROM teamwar_info 
    WHERE attacker=".$_GET['t']."
    ORDER BY DATE(war_started) DESC ";
    $rs_getevent = mysql_query($sql_getevent);

     

    This will show the date the right team name of the team being attacked.

    The next column should show the team name of the team ATTACKING (on picture it should be "Black Beards Crew" as this team is attacking the team with id 21.

     

    Using above picture: Assume our team has id 21. The event list should show date: 2011-5-10, attacking (the team WE attack): Jack Sparrow, the team attacking US: Black Beards Crew.

     

    How can I do this?

     

    (I am sure this is confusing, so please ask and I'll try to further explain.)

     

     

  5. Thanks for the suggestions. As being fairly new to this I'm getting more and more confused lol. I'll see if I can make some of this work, otherwise I'll reply with the code I have so it is more clear what I am trying to achieve (there's usually a simple answer to my questions) :)

  6. I am really lost here with this date issue of mine. The below code is the last part of a query:

    $defendercheck_3 = $row_checkifattacked3['atdate'];
    $defendercheck1_3 = strtotime("$defendercheck_3");
    $defendercheck2_3 = date("D", $defendercheck1_3);

     

    The query does not return any results as expected, but when echoing the various steps I get following:

     

    echo "$defendercheck3"; = nothing (as expected)

     

    echo "$defendercheck1_3"; = nothing (as expected)

     

    echo "$defendercheck2_3"; =  result! (NOT expected)

     

    why does it return anything on "date("D", $defendercheck1_3)" when "$defendercheck1_3" is blank?

  7. I have the code below to output a list:

     

    while ($row = mysql_fetch_array($rs_teambydate)) {
        echo "<tr><td width='200'>".$row['team_name']." (".$row['members_count'].")</td><td><input type='submit' name='".$row['team_name']."' value='Plunder'/></td>";
    
    }

     

    This is all inside a form so I can use the following to get various includes:

     

    <? if(isset($_POST['".$row['team_name']."'])){ include ('resources.php');} ?>

     

    My problem is this part : $_POST['".$row['team_name']."'], as this obviously doesn't work.

     

    Anyone know how I can add the "$row['team_name']" inside $_POST[' '] ?

  8. I am looking for some info on creating a textfield /dropdown menu that works just like a standard browser: when you type in something in the textfield/dropdown it should show results (this is needed to quickly find a member)

     

    eg. I type "use" and dropdown should contain members(results) starting with "use" (user1, user2 ...)

     

    Anyone know where I can find info on this?

  9. ok here is the code I would like to get to work first:

     

    $sql_teamwarinfo = "SELECT count(vtp_tracking.teamid), vtp_tracking.action_date, teamwar_info.war_started
    FROM vtp_tracking, teamwar_info
    WHERE vtp_tracking.teamid=".$members_teamid." AND teamwar_info.war_started < vtp_tracking.action_date";
    $rs_teamwarinfo = mysql_query( $sql_teamwarinfo );
    $row_teamwarinfo = mysql_fetch_array($rs_teamwarinfo);

     

    This part is the problem : "teamwar_info.war_started < vtp_tracking.action_date"

     

    I want to count ONLY where the date is AFTER "teamwar_info.war_started"

    (in the end I want to count the between the date of "teamwar_info.war_started" and 2 days ahead)

     

    I tried doing as you posted earlier (DATE ...) AS atc_date, but that only returns the first date..

     

    Any ideas?

    Any ideas?

  10. Thanks pikachu2000 that did the trick with just getting the date.

    Unfortunately this did help me as I thought. Goin back to previous post I still need:

     

    WHERE DATE(teamwar_info.war_started) = DATE(vtp_tracking.action_date)
    

     

    Is there a way I can combine them? I am amazed how difficult it is to just compare to timestamps...

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