Jump to content

suzzane2020

Members
  • Posts

    233
  • Joined

  • Last visited

    Never

Posts posted by suzzane2020

  1. It would be better to have  a separate class for the connection and queries.

    You have created the $db object for the connection class correctly.

    So for the second class which will contain all the functions for a query create an object like this:

      $query =new Db_mysql_statement();

     

  2. What exactly is this section of code supposed to do?

     //first, find out which set it's in
        if($i < count($setOne)){
           $set_num = '1';
            $temp_set_array = $setOne;
            $count = $i;
          }
       if(($i >= count($setOne)) && ($i < (count($setOne) + count($set_Two)))){
          $set_num = '2';
          $temp_set_array = $set_Two;
          $count = $i - count($setOne);
          }
       if($i >= (count($setOne) + count($set_Two))){
          $set_num = 'e';
          $temp_set_array = $encore;
          $count = $i - count($setOne) - count($set_Two);
          }
       

     

    If you are trying to display the file paths , wont it be a better option to allow the user to select the file they want to upload?

    you can provide an option to upload multiple files at a time.

  3. Did you check if the values are available in the second page? btw the band value is not being called in the else part

    else{
       //If not, assign other variables
       $year = $_POST['year'];
       $month = $_POST['month'];
       $day = $_POST['day'];
       $date = create_date($year, $month, $day);
       $setOne = $_POST['setOne'];
       $set_Two = $_POST['setTwo'];
       $encore = $_POST['encore'];
       }

  4. could anyone tell me where to post a question about amazon payment.  Iam a php coder and use amazon payment service as my payment gateway.

                      I have posted the issue in the amazon site but dint get the response I wanted.

    I just wanted to know if anyone here has worked on this before?

     

    ** plz dont mind that i posted this here. I just dint have a clue where to!!!

     

     

  5. How do I read and output an image file using php.

    I have a function that get the image path and then uses fread to read the image file.

     

     

    This throws an error  " supplied argument is not a valid stream resource"  pointing to the fread

     

    I found out we need the header("Content-type: image/jpg")

    but not sure about the rest of the code.

     

    Could anyone plz help?

     

    thank you

  6. yeah you could use ajax.  If you would lik to stick with php for nw u can do that too witha little bit of javascript.

     

    The form can be divided into two. have the login filed in a separate form and the rest of the fields in another form

    eg:

     

     

            <?php
                     if(isset($_POST["check"]))
                          {
                               $user   = $_POST["user"];
                                 }
    
    ?>
    <form action="register.php" method="POST" name="form1">
    
           <tr> 
          <td class="textsr">Username*</td><td><input name="user" type="text" class="textbox" value="<?php echo $user;?>">
              <input name="check" type="submit" value="check availability" class="button">
                               </td>
      <tr>
         
       <td></td>
          
          <td class="textsr">
            <?php
    if(isset($_POST["check"]) && ($_POST["user"]!="") && (trim($_POST["user"])!=''))
    {$user=trim($_POST["user"]);
    
    $res=mysql_query("select * from table where username='$user'");
    $trows=mysql_num_rows($res);
    if($trows==0)
    {
      echo "<font color='green'>The username is available</font>";
      
      }
      else
      {
         echo "<font color='red'>The username is not available.<br>Please select another one</font>";
     }
    }else
    {
    echo "";
    } ?>
          </td>
      
    </form>

     

    This way you can have the message appear right under the username box.

     

     

  7. Yes, Thats exactly what i want to do. And as I would  be reading the contents of a file and passing that as the string, there would a lot more tags than the bold. <html><head>....etcIs there a way to do that.

  8. Hi friends,

     

        I had a doubt regarding the gd library functions in php. This is what iam trying to do:

     

    I need to read contents from a html file and convert that to an image uding the gd functions. I can get the code to work using simple text(without html tags) but not without them.

      How do I convert the contents of the file which has html tags to an image.

    This is the code i have been using:

     

    <?php
    header ("Content-type: image/png");
    $handle = ImageCreate (400, 400) or die ("Cannot Create image");
    $bg_color = ImageColorAllocate ($handle, 255, 0, 0);
    $txt_color = ImageColorAllocate ($handle, 0, 0, 0);
    ImageString ($handle, 5, 5, 18, "<b>hello</b>", $txt_color);
    ImagePng ($handle);
    ?>

     

    I would really appreciate it if someone could help.

    Thank You

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