- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 32
- Posts with Upvotes
- 31
- Upvoting Members
- 21
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
FlashCreations (aka PhpMyCoder) is a freelance PHP programmer and website designer mainly focused on Web 2.0 startups and interactive online tools. He also writes tutorials and articles about the web, programming, and design on his blog.
- Interests
- Programming Baseball Basketball
- PC Specs
- Dell E1705 with 2GB DDR2 Intel Core Duo Running Windows Vista Home Premium SP1
Re: Well, I'm not expert with PHP, but I would suggest creating an SQL table called onlineUsers or somthing like that. Then when users login a PHP script adds them to the table. When they logout, simply remove them from the list. Something like: [code=php]<?php //Log the user in $con = … | |
Re: Awesome snippet!!! No longer to webmasters have to sift through a SQL database full of emails such as [email]random@thisisnotahost.com[/email]!!!! | |
Here's how this one works. I'll start by posting one line of PHP script. The next person to post will add another line and copy the script into their post. You will simply add a line of PHP code to the script everyone wrote above you. Also don't forget to … | |
Re: How about trying a Google search? You could search within the HTML for your Javascrpit code. If you would like it in script form, try using the Google Ajax Search widget and simply count the results!!! | |
Re: What about JQuery?? jQuery Documentation: [URL="http://docs.jquery.com/Ajax/load#urldatacallback"]http://docs.jquery.com/Ajax/load#urldatacallback[/URL] If not maybe try this code: [code=PHP] /*For safety reasons I would only allow the PHP file to determine the location of the file...if you want the ability to pick your file just post and I will modify my code*/ $file = "test.txt" //Test … | |
Re: It's also important to note that overuse (Multiple requests made in under a couple seconds) of websites such as Yahoo, Google, or Bing can get your IP banned from accessing their services. Furthermore, if you are on a shared IP your chances of being blocked are higher since there is … | |
Re: Since you're new we'll cut you some slack! But if you noticed there is a pinned thread at the top of the forum that talks specifically about this error. Be sure to [URL="http://www.daniweb.com/forums/thread191031.html"]check out this great thread[/URL]. It's bound to have your solution! | |
Re: It all depends on what you are looking for. Java has the best implementation of OOP, but requires the JRE (Java Runtime Environment) to be installed for applications to work. It should be used for cross-OS programs or to server web content (JSP). PHP is best suited for web applications … | |
Re: [QUOTE=vibhadevit;1316560]The function will not internally parse it. But lets say i have one php page : [url]http://www.mysite.com/register.php[/url] And i use file_get_contents('http://www.mysite.com/register.php') then html source will be returned by file_get_contents function. Simply we can have 'View Source' type of functionality.[/QUOTE] From the PHP.net documentation: "file_get_contents() is the preferred way to [b]read[/b] … | |
Re: Props to you for using something other than MD5. Now on to business. The basic way to validate a password stored in a database is to use a one way encryption such as SHA1. This involves hashing the password the user provides at registration and storing it in a database. … | |
Re: I think the question is not Flash/PHP vs. AJAX/PHP. Since Flash also designs content I would argue the debate is actually Flash vs. HTML5/CSS/JavaScript. The latter is an inseparable and pretty much unbeatable trio. Besides the open source benefits of HTML, CSS, and JavaScript, the big seller for most font … | |
Re: [QUOTE=britoniah3480;1316693]Lol because of this [CODE=php] $id = $_GET['id']; //you forgot to put the $id = $username = "root"; $password = '123456'; $hostname = "localhost"; $db = mysql_connect($localhost, $username, $password) or die ("Unable to connect to mySQL".mysql_error()); mysql_select_db('mynewdbase'); $del = "DELETE FORM newdbase WHERE id = $id"; $nres = mysql_query("$del); ?>[/CODE] … | |
Re: I'd suggest a simple variable that increments with each iteration of the foreach loop. With something like the code below, you can access the number of the element with the counter variable. [code=PHP] // +-- // | Loop through the products. // +-- $counter = 0; //Init the counter foreach … | |
Re: Sure it is. As long as you don't have any includes or extensions that could access this global. My guess would be that you won't be including and malicious scripts on your site intentionally, so with the details you gave, I would say you're safe! -PhpMyCoder | |
Re: You don't, well technically you can, but there's a better way in my mind to store avatars. Simply upload them to a writeable directory (and be sure to check their name for validity: ensure to remove and null characters) and rename them to the user's name. You can also rewrite … | |
Re: For the first URL, you can retrieve the var parameter by exploding the string returned by parse_url. You can also use a Regex if you want. [code=PHP] $param = explode('&', parse_url($url, PHP_URL_QUERY)); if(is_int($param['var'])) { //$param['var'] for the var parameter } //OR preg_match("/var=([0-9]+)/i", $url, $matches); //$matches[1][0] for the var parameter [/code] … | |
Re: Limits are based on characters and not by words. Longtext allows for 4GB of characters, so in theory it depends on how long your words are. It is possible to have ten words that contain more characters than 100 words. But I doubt this is the case. Some possible limitations … | |
Re: You probably couldn't find anything because this is not a PHP specific feature. It only requires some HTML & CSS. I found [URL="http://www.chami.com/tips/internet/052898I.html"]this tip on adding printer-only page breaks[/URL]. Is this what you're looking for? | |
Re: If application/octet-stream works, why not use it? The only problem you mentioned is that Opera reports the file as 1.2MB instead of 1.12MB. This is probably not an error on your part. Opera usually rounds up all sizes to the tenths place so a file might be 12.56 MB but … | |
Re: If you are using this code to download an image to [i]your[/i] computer (and not a server), I would use Python instead since it is suited for server side development as well as little scripts you want to schedule on your computer. If you would like to continue with PHP, … | |
Re: Regarding for your original code, the reason why the IP displayed but you couldn't click the link is because you were missing an = between the href and the first quote. Try this: [code=HTML] <a href="<?= $ip ?>"><?= $ip ?></a> [/code] Also notice that since you have shorttags enabled I … | |
Re: [URL="https://www.google.com/adsense/"]Google Adsense[/URL] is nice, free too. It's not PHP, but it should work. | |
Re: Well the most basic way in PHP would be to simply use the header function to report the 301 and then notify the user of the new location. That can be done like so: [code=PHP] <?php //301 Redirect header('HTTP/1.1 301 Moved Permanently'); header('Location: http://sub.domain.com/index.php?product='.urlencode($_GET['product'])); ?> [/code] Though, if you want … | |
Re: What do you mean by blank bookings? Is the email you receive blank or are the spaces where data should be blank? Do you enforce the filling of required fields via PHP? You can also enforce this via JavaScript (it doesn't seem like you do), but you should always enforce … | |
Re: Props to you for having the most creative greeting I've seen on DaniWeb! :D Ahoy Captain Syphilis (Sounds a little strange, but anyway), I'd suggest registering [icode]socket_close()[/icode] as a shutdown function after the child makes a connection. This way any early exits will close the socket before ending the script. … | |
Re: Something like this will have to be achieved with a combination of AJAX and PHP. The frontend (JavaScript) will call your backend (PHP) with a request when a new name is selected from the list. At its most basic form, that would like something like this: [code=PHP] <?php //If a … | |
Re: A few years back I made a simple Pagination Class w/ documentation. I'm not trying to pedal my script, but if want to take a look you can [URL="http://files.phpmycoder.net/1209da/"]find it on my site[/URL]. | |
Re: To be absolutely sure, you could split the string into the date and time part with [icode]explode()[/icode]: [code=PHP] //Split it and eliminate the time list($date,) = explode(' ', $date); //Show the result echo $date; [/code] On the off change that the date format does not add leading zeros to one … | |
Re: You will need to edit your theme (this can be done in Wordpress) and find your footer.php file. Locate the appropriate code, in this case some kind of heading for a bookmarking list, and remove it. Save the file and refresh a blog page. Your undesired content should be gone! … | |
Re: I'm no Wordpress expert, but I'll give it a shot. My guess is that your functions are being called before Wordpress outputs a header (such as a redirect). This will cause problems because headers are sent after the first character of content has been outputted. It might help to actually … |