User Profile

Collapse

Profile Sidebar

Collapse
bucabay
bucabay
Last Activity: May 12 '09, 12:58 PM
Joined: Apr 10 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • bucabay
    replied to PHP persistent UNIX sockets between sessions
    in PHP
    I know this is an old thread.

    What you need to do is forget about saving the variable returned from:

    stream_socket_c lient("unix:///tmp/hs.socket",$err no,$errstr,2.0,
    STREAM_CLIENT_C ONNECT|
    STREAM_CLIENT_P ERSISTENT);

    The stream_socket_c lient() is persisted when you make an identical call, from the same process.

    So you can...
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to coding an if condition
    in PHP
    There are a few problems going on here:

    The first is in the javascript.


    Code:
    <textarea name="coment" id="coment" cols="32" rows="5" value="Search" onfocus="if
    (this.value==this.defaultValue) this.value='';">type here your comment
    </textarea>
    You have defined in the HTML that the value="Search". So when the...
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to Enum Foreaach
    in PHP
    How are you viewing the HTML source?
    Some browsers will interpret a <tag></tag> as <tag />.

    [HTML]if (is_null($key) || !isset($key))[/HTML]

    Is useless here. isset($key) will always return true. NULL converts to an empty string with echo() so there is no need to test if its null, then write out the literal <option></option>....
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to Asynchronous logging in PHP
    in PHP
    Code:
    exec('/your/shell/command &');
    Maybe?...
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to sanitizing USER input
    in PHP
    Code:
    return apply_filters('sanitize_user', $username, $raw_username, $strict);
    That piece is most likely there in the wordpress username filter to re-run the filter until the input and output are the same.
    This is only necessary if the filter replaces or removes patterns of characters in a sequence. For global replacements like htmlentities() it would not be needed.
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to Submitting form automatically
    in PHP
    You've named one of your form fields "submit".
    [HTML]
    <input type="submit" name="Submit" value="Execute" >[/HTML]

    That overwrites the submit() method of the form. Name it something else so that you can still use the submit() method....
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to Reading Binary Files in PHP
    in PHP
    You have to send the right HTTP Headers that define the Content-Type.. eg:
    [PHP]
    header('Content-Type: image/png');[/PHP]

    If you image is a png image.

    Then read the binary image data from teh file and output it in the HTTP Body.

    [PHP]
    // send HTTP headers
    header('Content-Type: image/png');
    header('Content-Length: '.filesize($bin ary_file_path)) ;

    // send...
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to SoapClient Escaping XML Tags
    in PHP
    I haven't used PHP's built in SOAP client so I can't help you with how to turn the escaping off.. however, if you remove the <![CDATA[ tags it would be equivalent to the actual CDATA wrapped in <![CDATA[.
    It would work unless the soap server actually needs the <![CDATA[ tags?...
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to How to force data not to load from cache?
    in PHP
    I know this is considered solved, but I want to mention that:

    These cache problems are because you're using HTTP GET Requests. If you don't want a your XMLHTTPRequests to be cached, use a HTTP POST. Thats what it's for...

    see: http://fijiwebdesign.com/content/view/92/77/

    If you're really worried about it caching so much, then use unique URIs for your HTTP POST.

    eg: pseudo code:
    ...
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to how to decrypt the md5 encrypted password
    in PHP
    md5 is supposed to be a one way encryption. The reason you use it, is so only the user knows their password, but you can still validate the password.
    How you validate it is to create an md5 hash of the password supplied by the user, and compare that with the md5 hash of the password in the database.

    eg: pseudo code
    [code=php]
    $user = $_POST['user']; // username from form
    $password = $_POST['password'];...
    See more | Go to post
    Last edited by Atli; Oct 19 '10, 10:27 PM. Reason: Updated the code tags.

    Leave a comment:


  • bucabay
    replied to Views and Why We Love Them
    How is this better than creating a table based on a select query?

    CREATE TABLE `View_WidgetTag s` SELECT `Data_Widgets`. `widgetid`, `Data_Widgets`. `desc` AS `widgetdesc`, `Data_Tags`.`ta gid`, `Data_Tags`.`de sc` AS `tagdesc` FROM (`Data_Widgets` LEFT JOIN `Map_WidgetTag` USING(`widgetid `) LEFT JOIN `Data_Tags` USING(`tagid`)) WHERE `Data_Widgets`. `widgetid` > 999;

    And then running queries on that table?
    ...
    See more | Go to post

    Leave a comment:


  • What do you mean by "when I click on the SUBMIT button, it doesn't work"?

    What actually happens when you click the submit button?
    Does it not do anything at all?
    Do you got to the next page, but the it is blank?
    Does it go to the next page, but you don't get an email with results?
    Do you get an error?

    Also, the use of "$HTTP_POST_VAR S" is deprecated since PHP4.1+. Use...
    See more | Go to post

    Leave a comment:


  • The function "mysql_num_rows ()" returns the number of rows in the mysql result of a SELECT or SHOW statement.
    An UPDATE statement does not return any rows. To find out if the update actually worked, or affected some rows in the database table, then use: "mysql_affected _rows()"

    If you're doing an INSERT and want to know the id of the row the insert was made, use: "mysql_insert_i d()"...
    See more | Go to post

    Leave a comment:


  • Very interesting.
    You don't really need version tracking.

    A user has their own folder. They have a read folder, and a write folder.
    Each file upload they make is sent to SQL, and removed from the ftp write folder. Each download they make is the SQL query result, and is also removed after reading.

    That way, a user only has data in their write folder when they have written an sql query and are waiting...
    See more | Go to post

    Leave a comment:


  • This is definitely a JavaScript question.

    As this can only be achieved via JavaScript, you don't have to worry about the href attribute.

    So do something like:

    [HTML]onclick="this.o nclick=function () { return false; };"[/HTML]

    If the onclick returns false then the browser will stop the link/form from being submitted.

    So after the first click, the onclick will look...
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to read and display content from URL
    in PHP
    If you post a bit of your code it would be easier to figure out the problem.

    What you're trying to do I believe is "screen scrape" the contents of another webpage and display it on your webpage?

    If you do something like:

    [PHP]echo file_get_conten ts("http://www.sample.com/a.php");[/PHP]

    You will echo the whole HTML of the page http://www.sample.com/a.php from your php...
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to sha1 entry disparity
    in PHP
    could there be a problem with the character encoding?
    See more | Go to post

    Leave a comment:


  • bucabay
    replied to Grab Text Between Tags
    in PHP
    What is happening is that PHP is matching as many characters as it can for the quantifier .* in your regular expression.

    To make the quantifiers match the least amount of characters use the "un-greedy" indicator, "?".

    eg:

    [PHP]preg_match_all( "/(\[([\w]+)\])(.*?)(\[\/\\2\])/", $content, $matches);[/PHP]

    notice you now have (.*?) matching the characters in between...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...