Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by AyKay47

  1. Also there's no such thing as a timespamp, so...

     

    Yes, there is..

    In this particular case I would recommend using it, since it carries nice automatic initialization and update properties with it.

    To add these properties to a TIMESTAMP data type field, you will need to add the CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP attributes to the field's definition.

  2. Your use of the exit statement here is incorrect. You should be using the correct if { }else { } conditional instead:

     

    if ($productMatch > 0) {
        'true block'
    }else{
        'false block'
    }
    

     

    Also, check to make sure the file was actually uploaded before using header();

     

    if(move_uploaded_file( $_FILES['fileField1']['tmp_name'], "../inventory_images/$img1"))
    {
        header("location: inventory_list.php");
    }else
    {
        'error handler'
    }
    

  3. i do this

     

    mysql_query("SELECT id, randid, center, customer_name, home_phone, time, approval * FROM table ORDER BY DESC");

     

    and i get lank page why?

     

    Jesi asked for your table structure, which would help us solve your problem. You will need to supply that information before we can really help you. If you have a unique column that is auto_increment, you can order the results by that column descending. As to why you are seeing a blank page, in your query you are not descending by a column and you are misusing the * asterisk symbol, therefore the SQL syntax is invalid and an error is being triggered. You should have error_handling set to -1 and display_errors set to on.

  4. A suggestion to the above code would be to strengthen the regex filter a little. As is, a file named jpg.exe would pass the filter. Something such as:

    preg_match('/^[a-z0-9]+\.(jpg|gif|png)$/i', $entry)
    

     

    should be fine for what you are using it for.

  5. Hello everyone! It has been some time since I have been to phpfreaks. Now that the wedding is over and everything is back to normal, I hope to continue being an active member in this community. I would like to take this time to state that I'm diggin' the new site look, so whomever took part in the design of it, well done!

  6. Just to add more context to my question and to make it more complex!

     

    I have a big list of company names i.e. acme company, red widgets ltd

     

    and I want to send out a mailshot with URLs as

     

    www.domain.com/acmecompany

    www.domain.com/redwidgetsltd

    ...etc

     

    Can I grab these specific keywords and rewrite them so that I can have something like

     

    www.domain.com/user.php?company=acme-company

     

    And consequently I am then able to use that variable within my page copy?

    I can't get my head round the situation when there are a lot of words in a company name AND how do I separate words in the company name??

     

    eddy

     

    Yes you can do that, it all wraps around regular expressions.

  7. sorry AyKay47, Its what another site posted (about.com), which was incorrect. Please dont knock people down for trying to help.

     

    I wasn't trying to knock you down, everyone makes mistakes.

    But you must ask yourself if the answer will help or hurt the person asking.

    Sometimes it is better to not say anything at all.

  8. Ah i thought as much. The page i got it from said it wrong.

     

    So the correct way would be:

     

    RewriteEngine On
    RewriteRule user.php?username=$1 ^([a-zA-Z0-9_-]+)$
    RewriteRule user.php?username=$1 ^([a-zA-Z0-9_-]+)/$

    ??

     

    no, the actual rewrite was correct the first time, you just stated what it would do incorrectly.

    Please do not post responses unless you are sure of what you are talking about.

    It can be more detrimental then helpful.

    OP, there are many resources on the subject, you will want to google "mod_rewrite" or "rewrite rule" and you will get an idea of how to go about this.

  9. Since these are in one form, I recommend either having the inputs in array format or assigning them unique names, unless the user is only allowed to fill out 1. eg

     

    option 1: <input name="option1" type="text">   Price: <input name="price1" type="text"><br><br>
    option 2: <input name="option2" type="text">   Price: <input name="price2" type="text"><br><br>
    option 3: <input name="option3" type="text">   Price: <input name="price3" type="text"><br><br>
    option 4: <input name="option4" type="text">   Price: <input name="price4" type="text"><br><br>
    option 5: <input name="option5" type="text">   Price: <input name="price5" type="text"><br>
    

     

    But as to your mysql question, you want to display the data that the user input from the database?

    Can you give us a layout of the db please.

     

  10. yes it's possible.

    You could use .htaccess to rewrite the URL so when someone accesses for example  www.example.com/AyKay47 the server will actually serve them www.example.com/index.php?username=aykay47 and handle the query string accordingly to serve the correct data in correlation to that user.

  11. I can't even decipher the logic behind your code, it's a mess.

     

    1. you should be joining queries together instead of querying inside of a while loop, this will save resources and cut down on server load times.

     

    Please explain in English exactly what you are trying to do so we can assist you further.

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