Jump to content

requinix

Administrators
  • Posts

    15,071
  • Joined

  • Last visited

  • Days Won

    414

Posts posted by requinix

  1. My index.php file is a clone of my index99.html test page. Both are the same: They contain a form and a connection to a DB. It is still in production. The .html page works fine, but the reason I am trying to use an index.php file is because someone suggested I do that in order to get my include files to work/be displayed, but they are not being displayed.

    Now that you've announced your index99.html, you should take it down. I can see your code. And database credentials.

     

    What is not happening for you? Do you mean that the page does not automatically redirect to the index.html holding page?

    Right. Blank page every time.

     

    Normally a blank page is the result of a parse error; as it so happens, line 199 is missing a semicolon and the if block on line 229 is unfinished. You should be getting error messages about this, and if not right on the page (a bad idea in production) then in some error logs.

     

    You also need to learn about SQL injection. It's a bad thing and you're vulnerable to it.

  2. You can still use those lines but you can't put them in the .htaccess. Try the virtualhost config instead; if you have multiple sites and more than one needs it, in the global config.

  3. You could just alter the execution time: figure out how long a single image should take and multiply that by the number of images (then add a bit more just in case), change the time limit accordingly, and do your work.

     

    Processing multiple images at once will be a bit faster than each one individually, though I wouldn't expect there to be that huge of a difference.

  4. Well, you know how to get the make, and you know how to put things into URLs, so... do that. The next page uses $_GET to get the make and runs a query with it.

     

    How about giving that a shot? If you have problems, post your code and explain what's going wrong.

  5. That's not (supposed to be) a problem that you simply find-and-replace your way around. It's being inserted by something, odds are your browser, because you've given it characters to display that aren't valid for the character set you told it to use.

     

    Where are you seeing that and what code and/or database do you have behind the scenes powering it?

  6. The problem is how you're fetching the data in your code. You can't use an associative array, like $row["description"], because the row has multiple columns named "trans_ref" and "description".

     

    You could use another fetch method that lets you refer to each value by column number, which sucks because then you have to keep track of what column has what values, or you can use aliases in your query:

    SELECT
    	table1.trans_ref AS table1_trans_ref,
    	table1.description AS table1_description,
    	table1.date_paid AS table1_date_paid,
    	table1.recurring AS table1_recurring,
    	table1.amt AS table1_amt,
    	table1.bill_code AS table1_bill_code,
    	table2.trans_ref AS table2_trans_ref,
    	table2.description AS table2_description,
    	table2.amt_deposited AS table2_amt_deposited,
    	table2.deposit_date AS table2_deposit_date
    FROM table1
    RIGHT JOIN table2 ON table1.username = table2.username
    (named all the columns with "tableN_" for consistency)

     

    And I think you should be using a LEFT JOIN, if either at all. Ask yourself what you want to happen (a) if there are rows in table1 with no matching rows in table2, and (b) if there are rows in table2 with no matching rows in table1. How you answer determines whether it's LEFT, RIGHT, or INNER JOIN.

  7. Server access logs generally are in a file. But whatever.

     

    Make waitfile.php write to a log itself. Build a string with the information you want, like

    $line = date("m.d.Y h:ia ") . $_SERVER["REMOTE_ADDR"] . $filename;
    then write to the file with file_put_contents with the append flag. Make sure you don't take the $filename blindly from $_GET - you should make sure it looks valid (like http://site1.com/download/) before writing it to a file.
  8. Yeah... I don't really care for Dreamweaver. I could go on a long rant about it (no, really) and other things like it, but suffice it to say: I don't like the habits it teaches.

    Which is not to say anything about you. Showing initiative is a good thing and everybody has to start somewhere.

  9. Take a look at how the recipient, purpose, and description make their way into the HTML:

              <td width="230" align="left" valign="top"><?php echo($rsBenefactions->getColumnVal("be_recipient")); ?></td>
              <td width="230" align="left" valign="top"><?php echo($rsBenefactions->getColumnVal("be_purpose")); ?></td>
              <td width="230" align="left" valign="top"><?php echo($rsBenefactions->getColumnVal("be_nature")); ?></td>
    It's not particularly good (shakes fist at Dreamweaver) but you need to mirror what it does with $rsBenefactions in your own code. Optionally mirroring the style too:

    <?php echo($rsBenefactions->getColumnVal("be_index")); ?>
    You also cannot use smart quotes in code. Probably Dreamweaver's fault again (continues shaking fist).
  10. Locks everything up = basically the computer won't work. No keys will function within Dreamweaver and I can't Alt-Tab to any other software I may have running. The only option I have is to use Ctrl-Alt-Del to access Dreamweaver and shut it down.

    Well, that's Dreamweaver's fault.

     

    The live code is

    Actually, how about posting the full PHP code to the entire file? This pointy-clicky bull with Dreamweaver just doesn't cut it.
    • Like 1
  11. You need a separate page that shows the message and has the delay. Ever seen one of those "your download should start in X seconds, click here if it does not" pages? That.

    <html>
    <head>
    <meta http-equiv="Refresh" content="3;url=http://www.example.com/download.php?f=downloadfile.zip">
    </head>
    
    <body>
    <p><a href="http://www.example.com/download.php?f=downloadfile.zip">Download</a><p>
    </body>
    </html>
    If the page were more complicated than that, it would take the average user at least a couple seconds to even find where the link is. (The first time.) If you don't want them to even see the link then you can hide it with CSS and do some simple Javascript work to show it.

    window.setTimeout(function() {
        // show the link
    }, 3000);
  12. Notice: Undefined index: min in /phpvalidation.php on line 100

    [edit] At some point there was a response in here... Something, something, array doesn't have a min in it. [/edit]

     

    Warning: Cannot modify header information - headers already sent by (output started at /phpvalidation.php:100) in /doeditprofile.php on line 53

    Can't use header() if there's been output. In this case the output came from that first error message (notice where it said the output started) so when you fix that then this one will go away too.
×
×
  • 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.