428 Posted Topics

Member Avatar for akvlko

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?

Member Avatar for mschroeder
0
146
Member Avatar for aizel

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.

Member Avatar for aizel
0
143
Member Avatar for terabyte
Member Avatar for terabyte
0
91
Member Avatar for aizel

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 …

Member Avatar for mschroeder
0
119
Member Avatar for The5sisters

[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 …

Member Avatar for The5sisters
0
155
Member Avatar for trilithon

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.

Member Avatar for mschroeder
0
89
Member Avatar for niths

Only place I have seen this kind of functionality is with Flash, Silverlight and Gears uploaders.

Member Avatar for mschroeder
0
65
Member Avatar for BzzBee

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 …

Member Avatar for BzzBee
0
3K
Member Avatar for Ender330

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 …

Member Avatar for dennishall
0
193
Member Avatar for keyroche

-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 …

Member Avatar for keyroche
0
148
Member Avatar for fuston05

Can you post an example of the format of the text files you're trying to work with?

Member Avatar for fuston05
0
120
Member Avatar for frazehmad

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 …

Member Avatar for frazehmad
0
3K
Member Avatar for TheSecOrg

[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, …

Member Avatar for TheSecOrg
0
755
Member Avatar for digital-ether
Member Avatar for digital-ether
2
1K
Member Avatar for dfaulted

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 …

Member Avatar for mschroeder
0
278
Member Avatar for Ghost

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 …

Member Avatar for mschroeder
0
5K
Member Avatar for nonshatter

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', …

Member Avatar for mschroeder
0
138
Member Avatar for abstrand

[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: …

Member Avatar for richieking
0
1K
Member Avatar for timpogue

[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 …

Member Avatar for mschroeder
0
95
Member Avatar for pearll

[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]

Member Avatar for richieking
0
138
Member Avatar for Manny7

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 …

Member Avatar for mschroeder
0
115
Member Avatar for akvlko

[url]http://www.php.net/manual/en/mysqli.query.php[/url] Demos in the manual. Try searching next time.

Member Avatar for akvlko
0
162
Member Avatar for qazplm114477

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 …

Member Avatar for Stefano Mtangoo
0
267
Member Avatar for scarcella

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 …

Member Avatar for Stefano Mtangoo
0
313
Member Avatar for dandixon

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.

Member Avatar for dandixon
0
136
Member Avatar for Jack_1

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, …

Member Avatar for justiceigwe
0
115
Member Avatar for qazplm114477

@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: …

Member Avatar for qazplm114477
0
121
Member Avatar for mathewmoozh

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 - …

Member Avatar for mschroeder
0
95
Member Avatar for BzzBee

[CODE] var Editor1 = FCKeditorAPI.GetInstance('editor1') ; var Editor2 = FCKeditorAPI.GetInstance('editor2'); Editor2.InsertHtml( Editor1.GetHTML() ); [/CODE]

Member Avatar for dennishall
0
420
Member Avatar for mpc123

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?

Member Avatar for P0lT10n
0
152
Member Avatar for iammirko

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 …

Member Avatar for iammirko
0
448
Member Avatar for crazyboy

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 …

Member Avatar for aquilax
0
96
Member Avatar for raul8
Member Avatar for mschroeder
0
99
Member Avatar for mayuri_desh

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 …

Member Avatar for hielo
0
184
Member Avatar for it200219

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?

Member Avatar for vibhaJ
0
109
Member Avatar for Muazam

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 …

Member Avatar for zark_yoc
0
314
Member Avatar for momofthree

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 …

Member Avatar for mschroeder
0
133
Member Avatar for deshpandemayuri

[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 …

Member Avatar for mschroeder
0
439
Member Avatar for Karthik.gautham

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 …

Member Avatar for mschroeder
0
125
Member Avatar for Designer_101

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]

Member Avatar for mschroeder
0
129
Member Avatar for ayooshkasmth

[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 …

Member Avatar for ayooshkasmth
0
99
Member Avatar for pietpiraat

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 …

Member Avatar for pietpiraat
0
205
Member Avatar for avario

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 …

Member Avatar for avario
0
123
Member Avatar for GigsD4X

[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 …

Member Avatar for GigsD4X
0
451
Member Avatar for andydeans

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. …

Member Avatar for andydeans
0
157
Member Avatar for deepakrajpal

Personally I prefer the Zend Framework. Have used it for numerous large projects and I'm very happy with the results.

Member Avatar for mschroeder
0
139
Member Avatar for phplover

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 …

Member Avatar for phplover
0
188
Member Avatar for gchurch

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 …

Member Avatar for gchurch
0
115
Member Avatar for jkaye

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.

Member Avatar for vibhaJ
0
109
Member Avatar for lifeworks

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 …

Member Avatar for lifeworks
0
171

The End.