428 Posted Topics
Re: There are many different services that provide this kind of functionality. For example: [url]http://sendgrid.com/[/url] (One of my favorites) [url]http://www.streamsend.com/[/url] [url]http://mailchimp.com/[/url] They're all going to charge you for their services though. In return you'll get high deliverability as well as all kinds of analytics. Send Grid has a great set of … | |
Re: While I don't really understand why you got down voted, I will make an assumption it has to do with the lack of effort on your part. If I was going to approach this, I would probably be looking at the php DOM extension ([url]http://www.php.net/manual/en/book.dom.php[/url]). Using an xPath query ([url]http://www.php.net/manual/en/class.domxpath.php[/url]) … | |
Re: $_FILES["file"]["type"] is supplied by the browser and is not checked by php for accuracy. You can overcome this by using something like the Fileinfo extension to actually check the file's mime type ([url]http://www.php.net/manual/en/book.fileinfo.php[/url]) You could drastically simplify the way that code reads by supplying an array of file types and … | |
Re: Seems i am a bit late to the game, but your problem definitely lends itself to using AJAX. and it would be a rather simple solution at that. Although instead of recommending you learn AJAX from scratch, I'm going to point you to the prototype library [URL="http://www.prototypejs.org/"]http://www.prototypejs.org/[/URL] I'm sure you've … | |
Re: For free any of the the Eclipse variations will work really well. PDT being my personal favorite [url]http://www.eclipse.org/pdt/[/url] However for the money I really prefer to work within Zend Studio. | |
Re: [CODE] <?php $count=1; $disk = array( 'test1', 'test2', 'test3', ); foreach ($disk as $device) { $var = 'strDisk'.$count; $$var = "<dataset seriesName='$device'>"; $count++; } var_dump( get_defined_vars() ); [/CODE] if you look through the variable output you should see: [CODE] 'strDisk1' => string '<dataset seriesName='test1'>' (length=28) 'strDisk2' => string '<dataset seriesName='test2'>' … | |
Re: Two things immediately jump to mind, are short php start tags enabled? Also are you using a version of php > 5.3.0? | |
Re: I believe the link was supposed to be [url]http://ical.mac.com/ical/Portuguese32Holidays.ics[/url] .ics is commonly associated with the [URL="http://tools.ietf.org/html/rfc5545"]iCalendar format[/URL] and is actually a standard. iCalendar is not an xml format. [URL="http://tools.ietf.org/html/draft-ietf-calsch-many-xcal-02"]xCal[/URL] is the xml representation of iCalendar format The content of that file if you open it with a text editor is … | |
![]() | Re: Hashing is a one-way algorithm it can not be run in reverse. Encryption is a two-way algorithm where a string and be encrypted and then decrypted. md5 and sha1 can't be decrypted, but what those sites do, is maintain giant databases of common lookups. So if you make your password … ![]() |
Re: This can be done by combining a few SPL iterators. [CODE] <?php $iterator = new RegexIterator( new RecursiveIteratorIterator( new RecursiveDirectoryIterator('/path/to/your/directory/') ), '/.*\.css$/' ); foreach( $iterator as $file ){ echo $file.PHP_EOL; } [/CODE] Where $file in the foreach loop will be an instance of [URL="http://php.net/manual/en/class.splfileinfo.php"]SplFileInfo[/URL]. You could also skip the regex … | |
Re: I have personally used [url]http://www.plupload.com/[/url] with a 250MB/file upload limit with no issues. It will break the file up into pieces and then your script will need to reassemble the temporary uploads. Works really well from my experiences. | |
Re: No, classes can only extend one class, but they can implement multiple interfaces. | |
Re: Captchas are used to prevent the automated submission of your forms. To prevent things like comment spam, automated signups etc. | |
Re: There are major difference between the Mysql and Mysqli extensions. Unless you're using MySQL < 4.1 or PHP 4 you should be using the mysqli extension, even if you're using the procedural version of it. There is NO reason to be using the mysql extension, it is not receiving active … | |
Re: Objects which can not be serialized or are composed of objects that can't be serialized will cause headaches with your sessions for starters. In my experience there is a bigger performance hit for the server to serialize and unserialize session data than there is to recreate the objects from persistent … | |
Re: If your hosting company is telling you their version of php does not support the mysqli extension then you should quickly find a new host. This would indicate to me either they are still running php 4, php 5 was release in july 2004, or they are to stubborn/lazy to … | |
Re: The actual countdown functionality is not php it is javascript. If you were going to implement this, on the page where you pull a list of auctions, calculate the remaining time by subtracting now from the end date/time. In your page you will need some JavaScript mechanism to take this … | |
Re: For windows check out pycron ([url]http://www.kalab.com/freeware/pycron/pycron.htm[/url]) | |
Re: WAMP should just work, right out of the box. Either your installation did not complete or possibly you have some installation of apache that is running? Did you try installing apache by itself prior to downloading wamp? Personally i prefer WAMP ove XXAMP because the prior updates their packages alot … | |
Re: Depends, session_start needs to be called before any output occurs or you'll get an error. If your header include contains everything that would be between the header tags on the page, what is creating the container html? If your code looks like the following and you put the session start … ![]() | |
Re: There probably isn't a reason to actually delete records. On the query you use to pull the comments you should add an ORDER BY clause that sorts them by the date they were added to the database (assuming you have a column for this) and then add a LIMIT clause … | |
Re: Assuming DateAdded is a Date or DateTime column in mysql. [CODE] SELECT COUNT(CigarID) AS ReviewCount FROM reviews_cigar WHERE $UserID = UserID AND $CigarID = CigarID AND WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= DateAdded [/CODE] This should find any rows that have been added within the last 30 days of the DateAdded … | |
Re: You should have started a new thread for starters, but your problem is rather simple. You're development environment is running at least php 5.3.0, which deprecated the session_is_registered function. ([url]http://php.net/manual/en/function.session-is-registered.php[/url]) Anywhere you have if( session_is_registerd('key') ) replace it with if( isset( $_SESSION['key'] ) ) session_register is also deprecated btw.([url]http://www.php.net/manual/en/function.session-register.php[/url]) | |
Re: If your string is always going to be in the format of ID-QUANTITY [URL="http://www.php.net/manual/en/function.explode.php"]explode()[/URL] would be faster and removes the need to use a regular expression. [CODE] <?php $value = '1234-57'; $result = explode('-', $value); echo $result[0].PHP_EOL; //1234 echo $result[1].PHP_EOL; //57 [/CODE] | |
Re: I assume you want functionality like wordpress, where as you type into your title, the url is generated from it and displayed for the user. While this could be achieved with pure javascript, I think your best solution will be to use an ajax request, so it can check the … | |
Re: @chrishea I have a development server where projects get subdomains configured as virtual hosts all other unmatched subdomains resolve to a single catch-all vhost. I don't think it is terribly uncommon just depends on the usage. @tcollins If you call [ICODE]<?php phpinfo(); ?>[/ICODE] from that file and look though the … | |
Re: If you want to keep the flow of your application at it is now, when the user clicks on the "Rate this Cigar" button and the cigar id is passed to the second page via a GET value e.g. ?CigarId=#### Then on the second page, if that get value is … | |
Re: PHP's DateTime ([url]http://www.php.net/manual/en/book.datetime.php[/url]) object accepts the MySQL DateTime format natively. [CODE] <?php $dt = '2038-12-31 23:59:59'; $dtObj = new DateTime( $dt ); echo $dtObj->format('h:i:s a').PHP_EOL; $ss = strtotime($dt); echo date("h:i:s", $ss).PHP_EOL; [/CODE] [CODE=TEXT] 11:59:59 pm 00:00:00 [/CODE] Keep in mind PHP's strtotime and date functions are not compatible with dates … | |
Re: You would want to use the Geocoding API: [url]http://code.google.com/apis/maps/documentation/geocoding/[/url] This could be as simple as capturing the output of [url]http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false[/url] with file_get_contents, and then using json_decode on the result to get a multi-dimensional array. If you put the url above into your browser you'll see the json response returned. [CODE] … | |
Re: This is not caching. You're actually causing your script to do more work when it tries to serve from cache than when you're just generating the content dynamically. The way caching should work, is when your script runs, it attempts to load a cache, via unique identifier (key, hash, filename, … | |
Re: A tree structure is probably the wrong way to go about this. The data structure you describe would be more of a graph. Where each node can have 1:n connections to additional nodes. A tree structure is really best suite for parent-child kind of relationships. [url]http://en.wikipedia.org/wiki/Graph_(data_structure)[/url] has some general information … | |
Re: @andrewschools I don't believe you are using the correct definition of stable sort. By definition a stable sort, the sort is performed by key/index. Where when duplicate keys exist the relative order of their values is maintained. In PHP you can not have two array items with the same key. … | |
Re: Are you running the 64bit WampServer package? If so, can you access [url]http://localhost[/url] ? | |
Re: [CODE] <?php $db_host = "localhost"; $db_username = "root"; $db_pass = ""; $db_name = "el"; @mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect"); @mysql_select_db("$db_name") or die ("No database found"); echo"you are connected to the DB<br>"; $result = mysql_query('SELECT * FROM attendace_info_old'); //Will return a positive integer $fieldCount = mysql_num_fields( $result ); //Access field … ![]() | |
Re: There is little that can be avoided of mixing html with your php in this instance however, I think the alternative control structures make for a nicer read than having your block of html encased in a single echo statement. If you want to remove your php even more from … | |
Re: Would second the use of GIT. I have used CVS and SVN previously but GIT beat them both hands down. It does take some getting used to though since you're not dependent on any central repository/server. | |
Re: That error would imply you have a mismatched open/closing curly bracket somewhere in your code. | |
Re: [CODE] <?php $subjects = array( 'abcd124', 'abc1234', 'passesTheTest', 'fai1TheTest', 'abc', '123', ); $pattern = '/^[a-zA-Z]{4}/'; foreach( $subjects as $test ){ if( preg_match( $pattern, $test ) > 0 ){ echo 'pass'.PHP_EOL; } else { echo 'fail'.PHP_EOL; } } [/CODE] [CODE=text] pass fail pass fail fail fail [/CODE] | |
Re: What is the reasoning for encrypting/protecting what is in the url? Considering this is supplied/visible/modifiable by the user it should never be treated as trusted data and should always be filtered/validated before you use it in your application. | |
Re: Technically this is possible, in fact there are a vast amount of services that offer this kind of functionality. However, the complexity of creating something like this is outside of the scope of this forum. If you want this kind of functionality I would suggest you look at some of … | |
Re: You have basically finished the script, with the exception of two things. You need to call the function, and your SQL statement should be looking for any delete_date values that are less than or equal to the current time. If you leave it as >= you will be deleting all … | |
Re: My initial guess after reading this, is that you are either not supplying a value for `component_item_id` (which can not be null) OR you are supplying a value which does not exist in your component_item table. Can you post both the structure of your two tables, and also the query … | |
Re: A quick count from my editor reveals 23 opening and 22 closing brackets. So you definitely got an issue there. Beyond that I see a lot of other issues. [LIST=1] [*]include is not a function it is a language construct and does not need the parenthesis around the string. [*]Line … | |
Re: You have to first get the contents of that page. Some options for this would be cURL, file_get_contents, sockets, fopen/fread/fclose, etc. Once you have the content you have a few options for extracting that particular piece of information. You can try to use a regular expression with the preg functions … | |
Re: Whats the reasoning behind hard deleting the row in the first place? | |
Re: You could use a honey pot. Essentially a form field that is hidden from display to the user and is purposely designed to be left empty. The thought is that when a bot comes along and spiders the form it will fill all the fields including the one supposed to … | |
Re: Be careful with the getmxrr function, only since 5.3.0 has it been available on windows. If you know the environment you're writing the script for this won't be a problem, but if you're writing a script for others to deploy this is a limitation you will want to work around. … | |
Re: I've never seen an official naming convention either. jkon would have described the closest to what I'm familiar with. If you are going to code to a standard I would suggest looking at the PEAR standards and than looking at their implementation in some larger projects. PEAR: [url]http://pear.php.net/manual/en/standards.php[/url] Zend Framework: … |
The End.