Jump to content

I-AM-OBODO

Members
  • Posts

    439
  • Joined

  • Last visited

Posts posted by I-AM-OBODO

  1. Helo.

    I am not sure what to call my subject, but what am asking is this: in my db i am a column for serial number, lets say i want a couple rows for a particular user who has many entries (in the db his entries might be in serial number 4, 7, 15, 100 etc) is there a way that i can sieve the output so i just get 1, 2, 3 etc for that user and any user base on my comand?

     

    Thanks

  2. The problem now is how to make the result of my calculation (date diff) apear in al the rows in my table. This is wat i hav in my code

    <?php
    $query = "select date, date_order from table where description = '$description'";
    $result = (mysql_query($query));
    while ($newArray=(mysql_fetch_array($result))){
    $date = $newArray['date'];
    $date_order = $newArray['date_order'];
    
    $time1=strtotime($date_order);
    $time2=strtotime($date);
    $check=date("d:m:Y",$time2);
    $check2=date("d:m:Y",$time1);
    
    $diff = intval(($time1 - $time2) / 86400 + 1));
    
    
    echo $diff;
    
    ?>
    

     

    the problem is i have many field in my tables that match query but query outputs only one result. I want the difference be linked to each row in table

     

    Thanks

     

     

     

  3. Hi all.

    In my database i want to pull out the dates from two different tables. What i did was as pull out the date from one table and assigned it to a variable and used session to pass it to another page which has the second table that contains the second date etc.

    $first_date=$_Session['date1'];
    $query="SELECT * FROM table2 WHERE name = 'name'";
    $result = mysq_query('$query');
    blah blah blah
    

    Note: the date format is 200-10-10

    How do i get the difference between the dates?

    Hope am making sense here, or a better way of getting the required results.

    Thanks

  4. Helo,

    I have a file i don't want unauthorised users to access. I created a login to the page restricting access, but if one knows the name of the file and type it on the browser the file loads and subsiquently can be accessed and downloaded. eg www.mysite.com/user/getfile/file.exe

     

    the file to be protected is the file.exe and its located on the get file page which you can access only if you have a valid username and password. but if typed the address as shown above file is downloaded.

     

    how do i restrict access to this file?  please and thanks

  5. Oh! thanks for the help. I have designed the login and all seems to be working fine, but the problem now is when a user is loggen in, and for a reason or another he refreshed the page, the log count increases by 1 and its a problem. Is there a way of solving these?

    Thanks

  6. I have not started anything on it yet, i was just told i if i could do something like that and i told them i could. i am doing it from the scrash. the code you gave, would it work with a basic usrname and password login? modified of corse

  7. i have designed a login that works fine.

    users could login, but the problem is when i clicked to see a users details it does not show details.

    unless i indicate the users name.

     

    when two or more registers, it display just the first registerd person, that means it brings the detail that is partaining to another user. thats my problem

     

  8. please where can i find a tutorial on this stuff or better still where i can get a script so i can modify it to suite my taste

    1. a user registers with his details

    2. login wit his username and password

    3. when he clicks on a link sees all his personal details (which will contain all his transactions)

    4. logs out.

     

    the one i designed don't show the transaction the user did.

    will appreciate a link to a tutorial or a script so i could modify.

     

    thanks

  9. if you go through the code, you'll notice that it has been reassigned, so after clicking go back, it returns an empty result

     

    but i want the result that was parsed to the page3 and still on the page3 it must be reassigned?

     

    thanks

  10. what am actualy saying is that is there a way to recal a session after it has been renamed? take for instance:

     

    Page1.php

    <? session_start(); ?>

    <form id="form1" name="form1" method="post" action="page2.php">

      <table width="100%" border="0" cellspacing="2" cellpadding="0">

        <tr>

          <td>Amount:  <input name="amount" type="text" id="amount" /></td>

        </tr>

        <tr>

          <td> 

            <input name="trxref" type="hidden" value="<? $rand = range(0,10);

    shuffle($rand);

    echo implode(' ',array_slice($rand,0,8)); ?>" /></td>

        </tr>

        <tr>

          <td> </td>

        </tr>

        <tr>

          <td>

     

    Page2.php

    <? session_start(); ?>

      <? $_SESSION['amount'] = $amount=$_REQUEST['amount'];

      $_SESSION['trnxref'] = $trxref=$_REQUEST['trxref'];

    ?>

     

    Amount = <font color="#000066" ><b><?php echo $_SESSION[amount]; ?>

    <p>

    Transanction Ref = <font color="#000066" ><b><?php echo $_SESSION['trnxref'];

    ?></p>

    <p>Click to make <a href="page3.php">payment</a>  </p>

    </body>

     

    Page3.php

    <html>

    <head>

    <title>Untitled Document</title>

    </head>

    <body>

    <p>

      <?php

    $amt = $_SESSION['amount'];

    $txRef = $_SESSION['trnxref'];

    ?>

     

    Amount = <font color="#000066" ><b><?php echo $amt; ?></b>

    <br>

    Transanction Ref = <font color="#000066" ><b><?php echo $txRef; ?>

    </p>

    </p>

    <p><a href="page2.php">Go Back</a>

    </p>

    </body>

    </html>

     

    Thats it. I if i click on go back, i want the details (i.e amount and trnxref ref to display) knowing well that the value of amount and trnxref have been reassigned in page3. is there a way i could get these values back if i go to page2?

     

    Hope it helps

    Thanks

  11. Helo all,

    I am designing a site that has to do with transaction. i want after each transaction a confirmation be display to the client showing the transaction status wether failed or completed. there is a code that represents each transaction status. each transaction is moved on to another page via session, the problem am having is that after a failed transaction, i tried to anchor to the sattus of failed transfer to payment page but the payment details does appear on the payment page again, i want a situation where the payment details will appear to the client notifying them of failed transfer to to retry the payment again with having to fill all the forms they've filled before.

     

    Thanks

  12. Thanks all for your help. Finaly i gat it done and working. This is how i did it.

     

    
    <?php
    mysql_connect ("localhost", "name","password") or die (mysql_error());
    mysql_select_db ("database");
    
    $keyword = $_POST['keyword'];
    if ( $keyword == '' ) {
    die("Query failed. Ensure you gave a criteria");}
    
    $sql = mysql_query("SELECT * FROM easylife WHERE Firstname LIKE '%$keyword%' OR Middlename LIKE '%$keyword%' ");
    
    while ($row = mysql_fetch_array($sql)){
    echo 'Transaction Ref: '.$row['txnref'];
    echo '<br/> Beneficiary: '.$row['Beneficiary'];
    echo '<br/> Amount: '.$row['amount'];
    echo '<br/> PaymentType: '.$row['PaymentType'];
    echo '<br/> Address: '.$row['Address'];
    echo '<br/> Firstname: '.$row['Firstname'];
    echo '<br/> Surname: '.$row['Surname'];
    echo '<br/> Middlename: '.$row['Middlename'];
    echo '<br/> Phone: '.$row['Phone'];
    echo '<br/><br/>';
    }
    ?>
    
    but the funny thing is that if no criteria was provided on the on the search box, it brings out all the entry in the database.
    how do i stop that now, cos my validation is not okay. but am still trying something.
    help will be appreciated
    
    thanks all once again

  13. I have users in my database, but i want to be able to perform a search by a criteria eg username or transaction ref, how do i go about that, cos i tried using select where, but it seems not working. i need a better way if my way is not good.

    thankz

     

    here is what i did:

     

    <?php
    include_once("../includes/connection.php");
    ?>
    <?php
    $result = mysql_query( "SELECT * FROM easylife WHERE Firstname LIKE '%$keyword'" )
    or die("SELECT Error: ".mysql_error());
    $num_rows = mysql_num_rows($result);
    
    while ($get_info = mysql_fetch_row($result)){ 
    
    foreach ($get_info as $field) 
    
    print "</tr>\n";
    }
    print "</table>\n";
    mysql_close($link);
    ?>
    <style type="text/css">
    <!--
    .style1 {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 14px;
    font-weight: bold;
    }
    -->
    </style>
    
    <br>
    <form method="POST" action="choice2.php">
      <span class="style1">Keyword</span> 
      <input name="keyword" type="text" id="keyword" size="25">
    <input name="Submit" type="submit" value="Search">
    <input type="reset">
    
    </form>
    </body>
    </html>
    
    and then....
    
    <?php
    $keyword=$_REQUEST['keyword'];
    $conn = mysql_connect("localhost","user","pasword");
    mysql_select_db("database_db",$conn);
    $sql = "SELECT * FROM easylife WHERE Firstname LIKE '%$keyword%'";
    $result = mysql_query($sql, $conn) or die(mysql_error());
    while ($newArray = mysql_fetch_array($result)) {
    $txnref = $newArray['txnref'];
    $Beneficiary = $newArray['Beneficiary'];
    $amount = $newArray['amount'];
    $PaymentType = $newArray['PaymentType'];
    $Address = $newArray['Address'];
    $StartDate = $newArray['StartDate'];
    $EndDate = $newArray['EndDate'];
    $Firstname = $newArray['Firstname'];
    $Middlename = $newArray['Middlename'];
    $Surname = $newArray['Surname'];
    $OfficialAddress = $newArray['OfficialAddress'];
    $BillingAddress = $newArray['BillingAddress'];
    $Email = $newArray['Email'];
    $Phone = $newArray['Phone'];
    $date_of_order = $newArray['date_of_order'];
    
    }
    ?>
    <style type="text/css">
    <!--
    .style1 {
    color: #000066;
    font-weight: bold;
    }
    -->
    </style>
    
    <a href="select.php">Home</a> | <a href="logout.php">Logout</a>
    <p>
    <h3>Client's Information</h3>
    <table width="351" border="2" cellpadding="1" cellspacing="0" bordercolor="#000000" style="border-collapse:collapse ">
      <tr>
        <td width="104"><strong>Trans Ref</strong></td>
        <td width="231"><span class="style1">
          <label>
          
          <?php echo $txnref ?> </label>
        </span></td>
      </tr>
      <tr>
        <td><strong>Beneficiary </strong></td>
        <td><span class="style1">
          <label>
          
          <?php echo $Beneficiary ?> </label>
        </span></td>
      </tr>
      
      <tr>
        <td><strong>Amount</strong></td>
        <td><span class="style1">
          <label>
          <?php echo $amount ?> </label>
        </span></td>
      </tr>
      <tr>
        <td><strong>Payment Type</strong></td>
        <td><span class="style1">
          <label>
         
          <?php echo $PaymentType?> </label>
        </span></td>
      </tr>
      <tr>
        <td><strong>Address</strong></td>
        <td><span class="style1">
          <label>
         
          <?php echo $Address?> </label>
        </span></td>
      </tr>
      <tr>
        <td><strong>Start Date</strong></td>
        <td><span class="style1">
          <label>
          
          <?php echo $StartDate ?> </label>
        </span></td>
      </tr>
      <tr>
        <td><strong>End Date</strong></td>
        <td><span class="style1">
          <label>
          
          <?php echo $EndDate ?> </label>
        </span></td>
      </tr>
      <tr>
        <td><strong>Firstname</strong></td>
        <td><span class="style1"><?php echo $Firstname ?></span></td>
      </tr>
      <tr>
        <td><strong>Middlename</strong></td>
        <td><span class="style1"><?php echo $Middlename ?></span></td>
      </tr>
      <tr>
        <td><strong>Sastname</strong></td>
        <td><span class="style1"><?php echo $Surname ?></span></td>
      </tr>
      <tr>
        <td><strong>Official Address </strong></td>
        <td><span class="style1"><?php echo $OfficialAddress ?></span></td>
      </tr>
      <tr>
        <td><strong>Billing Address </strong></td>
        <td><span class="style1"><?php echo $BillingAddress ?></span></td>
      </tr>
      <tr>
        <td><strong>Email</strong></td>
        <td><span class="style1"><?php echo $Email ?></span></td>
      </tr>
      <tr>
        <td><strong>Phone</strong></td>
        <td><span class="style1"><?php echo $Phone ?></span></td>
      </tr>
    
      <tr>
        <td><strong>Date/Time Ordered </strong></td>
        <td><span class="style1">
          <label for="register"><?php echo $date_of_order ?></label>
        </span></td>
      </tr>
    </table>
    <p>

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