User Profile

Collapse

Profile Sidebar

Collapse
coffear
coffear
Last Activity: Nov 29 '07, 01:59 AM
Joined: Nov 7 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • coffear
    replied to read html file with php
    in PHP
    You can either get the html form by using fopen or using cURL.

    fopen may not work with external pages it all depends on how php has been setup. And of course cURL may not be installed (you can check this by looking at the output from phpinfo()).

    Once you have the content of the html form in a variable you will need to use a regular expression to find all instances on the page that are form inputs.
    See more | Go to post

    Leave a comment:


  • the code was provided in an earlier post:-

    ini_set('memory _limit', '12M');

    change the 12M to the value you want. However you may not have permission to increase this.
    See more | Go to post

    Leave a comment:


  • what pbmods says is 100% correct another thing that should be done is proper validation of user input. If for example you ask someone their age then ensure they provide you with an int.
    See more | Go to post

    Leave a comment:


  • coffear
    replied to Change url without actually changing it.
    in PHP
    Not quite \w is for the following range:-

    a-zA-Z0-9_

    so misses out the - but of course you could add that in. I personally however prefer whenever possible to use ranges so that it is easier to see what a regular expression does. Unless you specifically know what \w does you will have problems decoding the regexp whereas you have a better chance with actually using the ranges....
    See more | Go to post

    Leave a comment:


  • PHP has a configuration option that limits the memory a script can use. The error message that you show indicates that the operation requires more memory than you are allowed....
    See more | Go to post

    Leave a comment:


  • coffear
    replied to Searching a string for a lot of characters...
    in PHP
    As suggested by ManWithNoName they will be using preg_match or some other regular expression based function.

    However they won't be checking for all characters that cannot be used they will be checking if the string only contains characters that can be used. A username for example may only allow letters and numbers so they could use the following regular expression:-

    '/[a-zA-Z0-9]+/'

    If it fails then they...
    See more | Go to post

    Leave a comment:


  • try putting the following at the top of your script:-

    [PHP]error_reporting (E_ALL);[/PHP]

    It is possible that you are running out of memory when trying to resize.
    See more | Go to post

    Leave a comment:


  • If the output is valid HTML then you will get the desired output. As long of course as you have not used something like html_entities.
    See more | Go to post

    Leave a comment:


  • coffear
    replied to displaying mySQL data in php
    in PHP
    use a limit clause in your sql
    use mysql_query to execute the query
    use mysql_fetch_ass oc to load it into an array
    iterate through the array doing whatever you wish to do with it.

    Now have you made a start ?
    See more | Go to post

    Leave a comment:


  • DELETE FROM table_name WHERE date < (SELECT CURDATE()-6) AND user_id = 3

    I have not checked the SQL but this was just to give you the gist. This code would delete all records from table_name that were older than 6 days old and belonged too user with the id 3.
    See more | Go to post

    Leave a comment:


  • coffear
    replied to Change url without actually changing it.
    in PHP
    just 1 thing you have 0-1 in the regexp. You definitely only going to have 0 or 1 in the name?
    See more | Go to post

    Leave a comment:


  • coffear
    replied to Getting php to run ob button click
    in PHP
    have you made a start at all?
    See more | Go to post

    Leave a comment:


  • coffear
    replied to select_audio.php on line 43
    in PHP
    Try echoing out $word and print_r() $repository

    1 possible reason for the error is that the database is not returning any rows so $repository is not getting set.
    See more | Go to post

    Leave a comment:


  • coffear
    replied to Random generator
    in PHP
    when you navigate to the page look in the source and see if the image loadtion is as it should be.
    See more | Go to post

    Leave a comment:


  • coffear
    replied to Random generator
    in PHP
    You say the only problem is with the image. Are you actually going to tell us what that problem is or should we guess?

    An error message would be nice, if not an actual description of the error is needed.
    See more | Go to post

    Leave a comment:


  • coffear
    replied to Problem in reading a file from database
    in PHP
    presumably drgulrez[02,00][2].doc is actually a file? Also it might be best using a server path to the file in fopen as well.
    See more | Go to post

    Leave a comment:


  • coffear
    replied to Change url without actually changing it.
    in PHP
    A normal mod rewrite rule is what you are looking for. As long as you do not specify the R flag in the rule the user will be unaware of anything happening.

    For example something like this will work:-

    Code:
    RewriteEngine on
    
    RewriteRule ^viewer/([-_a-zA-Z0-9]+.jpg)$ /viewer/?id=$1 [L]
    See more | Go to post

    Leave a comment:


  • coffear
    replied to \n and endl: What's the difference?
    in C
    As stated = is an assignment but == is a comparison. Be very careful not to get the 2 mixed up. For example if you have:-

    while(a=b)
    {
    execute code here
    }

    you will end with with an endless loop as a=b will always evaluate to being true (unless for some reason the assignment failed.

    With regards to the \n and endl question. I believe \n is platform specific but endl (of course depending...
    See more | Go to post

    Leave a comment:


  • coffear
    replied to Send SMS
    in PHP
    touchring some SMS gateways allow 2 way SMS messages. Clickatell for example have this facility (of course it costs)
    See more | Go to post

    Leave a comment:


  • coffear
    replied to array_rand() problem
    in PHP
    if you only require 1 record from the database why not just select 1 record from the database?

    Use sort by RAND() LIMIT 1 at the end of your query and it will return 1 record randomly as a result.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...