428 Posted Topics
Re: Are you trying to connect to a third party API using curl, e.g. Flickr, or are you trying to create an API for your application that other people will be able to connect to and utilize your application? | |
Re: Is the date still stored as a string or is using a DATE column type in mysql? [CODE] UPDATE table SET column = 'finish' WHERE STR_TO_DATE( date, '%m/%d/%Y' )= CUR_DATE() [/CODE] Something like that would probably work for you, assuming your structure is similar to what it was previously. | |
Re: What aspect of that is not working for you? That code works fine for me. | |
Re: If I follow correctly, when the user selects a month from the drop down, a two digit representation of the month is passed to the script. 01, 02, 03, etc. and you wish to then pull anything departing in that month. You can do this relatively easily in SQL using … | |
Re: [QUOTE=robindell10;1334477]This is Very Normal Error This is Error Comes Due to the Full of Memory Means Your Computer's Memory is Full.You have to Remove the Temporary Files,Cookies,Browsing History and also Recycle Bin Form the Your Computer.You can Manually Delete it or You can Use any Software like the Ccleaner.It will … | |
Re: I've only come across a few examples of this: [url]http://php-security.net/archives/3-X.509-PKI-login-with-PHP-and-Apache.html[/url] Is one I bookmarked a while ago. | |
Re: Only place I have seen this kind of functionality is with Flash, Silverlight and Gears uploaders. | |
Re: When I view your site, I see two different content-type meta tags: [CODE] <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Морайра Инвест - недвижимость в испании - Buy, Sell, Resa</title> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <meta http-equiv="content-language" content="ru"> ... </head> [/CODE] You should only have 1 and you probably want to be using UTF-8 … | |
Re: PayPal provides a variety of SDK's just for this specific purpose [url]https://www.x.com/community/ppx/sdks[/url] I see no reason to use something that doesn't appear to have been updated since 2005. -OP If you are requiring all of your users to pay to have access then this is easy. If they are not … | |
Re: -nevvermind Singletons are almost always an indication of poor code design. They're extremely difficult to mock and test. Essentially the problem with singletons is you place the responsibility for determining the objects life cycle in the wrong place. More beneficial to have a factory class that handles initialization and returns … | |
Re: Can you post an example of the format of the text files you're trying to work with? | |
Re: Check out something like plupload [url]http://www.plupload.com/[/url]. It supports chunking on multiple different types of uploaders which won't make the upload go any faster, but effectively the user sees progress and the script isn't running for the entire 10mb upload, only long enough to process a chunk of n size. My … | |
Re: [OFFTOPIC] My apologies for taking this off topic for a second. But this comment struck my interest. [QUOTE=richieking;1350667]TheSecOrg Also try not to use session variable raw like.. [code] echo $_SESSION['username'] [/code] dont keep to that. always put it in a standard variable. eg.. [CODE] if($_POST){ $_SESSION['name']=$_POST['name']; //dont forget to trim,strip_tags, … | |
Re: What was the reasoning for it to be designed as a singleton? | |
Re: Line 27: [code]list($file,$extension) = explode('.', basename($path));[/code] explode is not returning 2 array pieces. So that means $path does not contain what you think it does from somewhere higher up. My guess is [ICODE]$path = $uriparts['path'];[/ICODE] is not returning a filename but rather a path. [CODE] $fileParts = explode('.', $basename($path)); $file … | |
Re: There is a fatal flaw to loading the entire file into an array like that. It loads the entire file into memory. If the file only has 30 lines no big deal. If the file as 30000 lines then it will be an issue. Here is what I recommend instead … | |
Re: Just an FYI, [URL="http://us.php.net/array_filter"]array_filter[/URL] will also do just this when not supplied with a callback function. It will remove anything that when compared as a boolean evaluates to false. More examples in the menu. [CODE] <?php $array = array( '1', '', 'Full, Gen. 3', '', 'TMSWK2D', '9', 'Poor write quality', … | |
Re: [QUOTE=richieking;1351123]Why this??? All this concatenations ??? from line 6-14. Writing code like this means you want a bug. you could do all that in a very simple like this. [CODE] $message ="New Contact Information $row[FIRST] $row[LAST] $row[AGE] $row[GENDER] $row[EMAIL] Cell $row[CELL] Home $row[HOME] $row[CITY] $row[LOCATION] $row[TIMEBLOCK] $row[PREFCTCT] $row[COMMENT] Fitness Goals: … | |
Re: [QUOTE=richieking;1351246]you can also do this simple on php. this is very simple function. ha ha [CODE] <?php funtion foo(){ // first receive the post variable from the form $bar=$_POST['num'] ; $numberDetails= split ('+',$bar); // split and take details for ($c=0;$c<count($numberDetails);$c++){ // basic run through $hoo+=$numberDetails[$c]; } echo "The sum is … | |
Re: [QUOTE=richieking;1351140][CODE] [form] [input type='text' name='username' value='<?=$value?>'] [/form] [/CODE] The little php snippet inside the form input value. Are you getting the idea?? :)[/QUOTE] Unless php short tags are disabled. Some good discussion on the topic: [url]http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use[/url] | |
Re: I was going to suggest array_pop(explode(', ', $string)); but the more I thought about it I figured creating an array out of n items in a string wasn't going to be the most efficient way to do it. So I ran some quick micro benchmarks to get an idea of … | |
Re: [url]http://www.php.net/manual/en/mysqli.query.php[/url] Demos in the manual. Try searching next time. | |
Re: I know this has been solved but I see some misconceptions that need to be clarified. I have developed with Zend for the last 2+ years. I develop almost purely on Zend these days and have several relatively large applications running on it. ------ I'm sort of messing around with … | |
Re: Besides the immediately glaring issues I see: [LIST] [*]The session isn't started in your code example e.g. session_start() isn't called. [*]$_POST['submit'] is not defined when you just load the form. [/LIST] That query is also extremely vulnerable to SQL injection. If you take the query: [ICODE]$sql = "SELECT * FROM … | |
Re: You need to use a many-to-many join table. Create a table like StaffGroups, with columns GroupId (key to group table) and StaffId (key to staff table). So it allows for n staff members to be in n groups at any one time. | |
Re: Unless you're familiar with configuring php and apache skip all of the trouble and download [URL="http://www.wampserver.com/en/"]WAMP[/URL] or [URL="http://www.apachefriends.org/en/xampp-windows.html"]XAMPP[/URL] There are others like this as well. They will install everything you need to get a fully functional php, apache and mysql environment in windows. WAMP seems to have gone stale lately, … | |
Re: @arionyx That design won't work because employee_id in that table can not be a primary key or even a unique index. If it is set that way than 1 employee can only have 1 row in that table representing only one field and value combination. @qazplm114477 Check out this article: … | |
Re: Your question has less to do with inheritance and more to do with visibility in php. ([url]http://www.php.net/manual/en/language.oop5.visibility.php[/url]) Generally speaking: [LIST] [*]Public - When a method or variable is defined as public it can be called outside the scope of the class or by any class which inherits it. [*]Protected - … | |
Re: [CODE] var Editor1 = FCKeditorAPI.GetInstance('editor1') ; var Editor2 = FCKeditorAPI.GetInstance('editor2'); Editor2.InsertHtml( Editor1.GetHTML() ); [/CODE] | |
Re: Do you want to hard limit it to x charachters, or do you want to split it up by the nearest word? Also, does the string contain any kind of formatting/html? ![]() | |
Re: You don't have name="" attributes in your html form code. [CODE] <form action="CreateUser.php" method="post"> <table class=CreateUser cellpadding=4px, cellspacing=2px> <tr class=TableHeading> <td colspan=2>Enter the infomation below</td> </tr> <tr class=FormContents> <td>Username</td> <td><input type=text id=usrName name=usrName size=20px></input> </td> </tr> <tr class=FormContents> <td>Password</td> <td><input type=password id=pWord name=pWord size=20px></input> </td> </tr> <tr class=FormContents> <td></td> <td … | |
Re: No framework is going to be easy or faster than any other at this point. Without learning any framework well enough to use it properly you'll slow yourself down. Personally the only framework I use and like working with is the Zend Framework. But everyone is going to have their … | |
Re: [url]http://php.net/manual/en/class.recursivedirectoryiterator.php[/url] | |
Re: This was already covered in: [url]http://www.daniweb.com/forums/thread310238.html[/url] Almost this exact question, with the exception the op there asked for a way to break a string down first then convert a numerical array into an assoc. [CODE=PHP] function toAssoc(array $array){ //Temporary array to hold new pieces $temp = array(); //Iterate over supplied … | |
Re: Are you trying to paginate the content automatically, by x number of lines, or are you looking to insert some kind of tag or something (e.g. <!--break-->) into the content and have it split apart by that? | |
Re: For starters a configuration file should only contain configuration values. If you're working with OOP move the database initialization to some sort of database class. In my opinion there are two approaches to this. You could make your database connection into a class and use the singleton pattern. Basically this … | |
Re: If they are logged into your site, you can use the session or the cookie you are using to make the connection between their account and whatever link is incoming. If they are not logged in or do not have an account, provide them with a quick login/registration process and … | |
Re: [CODE=PHP] <?php /** * Explodes the supplied string by the supplied delimiter * and reassembles based on each even key getting the next odd value * * @param String $string * @param String $delimiter * @return Array */ function toArray($string, $delimiter){ $pieces = explode($delimiter, $string); $temp = array(); foreach($pieces as … | |
Re: While I'm sure this can be done with the very old mysql extension, mysqli makes this very easy. This is taken from the php mysqli::commit documentation. [url]http://www.php.net/manual/en/mysqli.commit.php[/url] [CODE=php] <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $mysqli->query("CREATE … | |
Re: I know I've posted this before, but this scribd slideshow covers how to really optimize to the best of your abilities this particular functionality in mysql. [url]http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL[/url] If you have access to the physical server, you could also check out the Spatial extensions for mysql. [url]http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html[/url] | |
Re: [QUOTE=ayooshkasmth;1326548]Hi, I am trying to print different messages based on what is selected. The selections are stored in a database as $perm, and the options are low, intermediate and high. I am using switch, however i only get the first case printed: [CODE] $low = "Low"; $int = "Intermediate"; $high … | |
Re: For new code, strtotime really should be avoided. While we are a considerable amount of time away from Y2k38 and I really don't think you would run into an issue, if your script would ever need to process a date after 2038, maybe like the end date of a 30yr … | |
Re: Your first example would require returning a potentially massive data set from the database simply for a count so I wouldn't suggest that. I've seen the second one mentioned when dealing with massive datasets as well. Usually in conjunction with a set of triggers that when an row is inserted … | |
Re: [QUOTE=vibhadevit;1316243]how could it display php tags? its a scripting language and when you echo it it automatically executed. Post your exact output if issue is still not solved.[/QUOTE] -vib That is not true. When you use something like file_get_content() it does not parse/execute what it reads in. If you included … | |
Re: In the short and simple, you don't. sha1 is a hashing function not encryption. It is designed to only work in one direction. e.g. 'dog' => 'e49512524f47b4138d850c9d9d85972927281da0' If you require the ability to decrypt an encrypted string then you will need to use an encryption package like openssl or mcrypt. … | |
Re: Personally I prefer the Zend Framework. Have used it for numerous large projects and I'm very happy with the results. | |
Re: You want to filter input and escape on output. You could also add another layer of filtering to the output if you by chance needed the data in a different way than how it is stored in the database. e.g. If the data in the database is a validated and … | |
Re: If the value of $day-$month-$year evaluates to a string like 'd-m-Y' or any other combination of php date formats then yes you could. [CODE=php] <?php $day = 'd'; $month = 'm'; $year = 'Y'; $format = "$day-$month-$year"; // d-m-Y echo date($format); // 31-08-2010 [/CODE] If the value of $day-$month-$year evaluates … | |
Re: Can you describe your database a little more in depth, this seems overly complex for what you're trying to do and I think it has to do with how the database is structured. | |
Re: I'd say a lot of people is very open to interpretation. In my experiences with this it is very easy to get an ip or domain blacklisted and difficult to get it unlisted. If you're looking for mass mailing capabilities and it needs to be built in php than using … |
The End.