Posts
 
Reputation
Joined
Last Seen
Ranked #162
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
95% Quality Score
Upvotes Received
176
Posts with Upvotes
142
Upvoting Members
80
Downvotes Received
8
Posts with Downvotes
8
Downvoting Members
5
46 Commented Posts
16 Endorsements
Ranked #90
Ranked #128
~399.64K People Reached
PC Specs
15" Macbook Pro (2011), OS X 10.7.
Favorite Tags

505 Posted Topics

Member Avatar for wackyal
Member Avatar for Dani
0
4K
Member Avatar for benson.tairuakinsola
Member Avatar for vinod tik

This example is taken from PHP.net > setcookie [CODE] <?php // set the cookies setcookie("cookie[three]", "cookiethree"); setcookie("cookie[two]", "cookietwo"); setcookie("cookie[one]", "cookieone"); // after the page reloads, print them out if (isset($_COOKIE['cookie'])) { foreach ($_COOKIE['cookie'] as $name => $value) { $name = htmlspecialchars($name); $value = htmlspecialchars($value); echo "$name : $value <br />\n"; …

Member Avatar for alan.davies
0
2K
Member Avatar for rayrenz

I'm not 100% sure what it is you're trying to do. If you're trying to find all of the consonants in a given string, what about something like the following. This will include the same letter in $matches multiple times, if it is matched multiple times. To get unique consonants …

Member Avatar for Aravinth_2
0
371
Member Avatar for rajendra87

How about something outside of the box: $array = array(3, 5, 2, 5, 3, 9); $duplicates = array_duplicates($array); function array_duplicates(array $array) { return array_diff_assoc($array, array_unique($array)); }

Member Avatar for diafol
-1
22K
Member Avatar for masterjiraya

It really isn't clear from the code you've posted what your starting array structure or desired finished array structure should be. At a guess, you can do the following: $array = array(); $array['key1'] = 'one'; $array['key2'] = 'two'; print_r($array); /* array( 'key1' => 'one', 'key2' => 'two', ) */ If …

Member Avatar for diafol
0
72K
Member Avatar for padma525

Hi, Have you considered saving the Excel data as a CSV file, then reading the content of the file into PHP using file_get_content. You should then be able to explode the data by the comma symbol or something I am sure. What do you think? R.

Member Avatar for sankartomogo
1
3K
Member Avatar for ruwanaru

[CODE] $strText = file_get_contents( 'file.txt' ); $strFind = 'word'; $blMatch = false; if( preg_match( "/$strFind/", $strText ) ) { [INDENT]$blMatch = true; $strText = str_replace( $strWord, '', $strText );[/INDENT] } [/CODE] That will tell you if your word is found, and it will remove it from the string. R.

Member Avatar for diafol
0
200
Member Avatar for Gunnas

I didn't think JavaScript running in a browser had access to the file system of a computer, as this would be a pretty huge security flaw. You could use PHP to create a text file on the server for the user to download.

Member Avatar for Troy III
0
26K
Member Avatar for garyjohnson

Okay, well it looks like you're most of the way there already. At the moment, you're uploading the file and using the original name of the uploaded file - that's the `$_FILES['file']['name'];` part. Instead, what you need to do is replace that with the new file name. E.g. $file_name = …

Member Avatar for Thobby
0
15K
Member Avatar for daniel36

Sounds like the array doesn't have an index with value 9. Try changing line 5 above to: <?php if(isset($url['11'][$i]['11']) && $url['11'][$i]['11']>0){ ?> And if you're using PHP conditional statements inline with HTML, I find the following statements easier to read than tracking brackets: <?php if(true): ?> <!-- Your HTML here …

Member Avatar for Nabeel_2
0
6K
Member Avatar for rahul10721

Hi, Surely the FTP will map your public_html folder, within which will be your PHP scripts. So can you not simply use the unlink function in PHP? Sorry if I am over simplifying the problem. R

Member Avatar for veedeoo
0
1K
Member Avatar for atzaman

Hi, How about trying the following? [CODE=php] function convertDate($strDate) { return date('Y/m/d G:i:s', strtotime($strDate)); } [/CODE] R.

Member Avatar for diafol
0
5K
Member Avatar for vaultdweller123
Member Avatar for joonaroshi
0
311
Member Avatar for liphoso

You cannot upload a PDF file and then just read it's content. The file content is encoded. There are ways to extract the content of a PDF as plain text, but this won't work with images. Alternatively, you could use `file_get_contents` to read the content of the file, as is, …

Member Avatar for IIM
0
149
Member Avatar for aneeqtariq_143

The click event is bound upon DOM ready state. If you change the DOM thereafter by adding new elements, these will not have the click event bound to them. You can either, rebind the click event (a little pointless), or you could use the on function. $(document) .on({click: function(event) { …

Member Avatar for ruchi18
0
347
Member Avatar for Sanchixx

This assumes that `time` is a MySQL DateTime field. DATE_ADD(`time`, INTERVAL 1 HOUR)

Member Avatar for Sanchixx
0
174
Member Avatar for sahil.bhatia.18

URL encode is used to encode certain characters within a URL. It's not used to encode all characters and certainly isn't a means of encryption. 24 URL encoded is 24.

Member Avatar for blocblue
0
82
Member Avatar for wuzere.crewzz

I've used a foreach loop instead, but something like the following should work. $month = null; foreach($data as $row) { if(is_null($month) || $month <> $row['month']) { $month = $row['month']; echo "<strong>{$month}</strong><br />"; } echo "{$row['name']}<br />"; }

Member Avatar for blocblue
0
102
Member Avatar for Vijaysurya

Try: <?php if(! $viewee['name'] && ! $viewee['occupation'] && ! $viewee['education']): ?> <!-- Display your message here --> <?php endif; ?> <div id="container1"> <div id="friends-cta"> <?php echo $viewee['name']; ?> </div> <div id="friends-ata"> <?php echo $viewee['occupation']; ?> </div> <div id="friends-emp"> <?php echo $viewee['education']; ?> </div> </div>

Member Avatar for blocblue
0
168
Member Avatar for Setvir

Is the file less than 50000 bytes and is there definitely not an error code set in the `$_FILES` array? Perhaps try adding an else to the if statement on line 6, to `var_dump` the `$_FILES` array.

Member Avatar for fobos
0
166
Member Avatar for liphoso

You should be able to view the local server of another computer on your network using it's network IP address. You can find this on Windows via the command prompt using `ipconfig -all`. If you're using multiple vhosts, you'll need to update the hosts file on the remote (non-hosting) machine.

Member Avatar for blocblue
0
127
Member Avatar for dinhunzvi

Are you using PHP 5.2 or above? If so, you could use to validate the email address as a whole: `filter_var('bob@example.com', FILTER_VALIDATE_EMAIL);` And then using strpos and substr extract the domain element and do a string comparison to restrict the domain.

Member Avatar for dinhunzvi
0
165
Member Avatar for OsaMasw

Post your database schema for the articles, category and sub category tables and the PHP code you already have.

Member Avatar for OsaMasw
0
2K
Member Avatar for eyeda

If I understand your explanation, you're asking how to redirect the user to the folder on their computer which contains the file they downloaded from your website? In short - it's not possible. Neither PHP or any front-end languages have access to the filesystem on the user's computer to do …

Member Avatar for eyeda
0
141
Member Avatar for shuka79

>I have used the same code on another part of the site and it works perfectly. I don't see that you've reinitialised the `$files` array anywhere. It could be populated with the results of the last time you used the code. Add `$files = array();` immediately after line 4.

Member Avatar for shuka79
0
174
Member Avatar for <M/>

Line 30 probably should not be commented out, unless I've overlooked a closing `</tr>` tag somewhere else. It may also be helpful if you could post a sample of your CSV file too, just to check that all lines contain the same number of comma separated values and no blank …

Member Avatar for <M/>
1
1K
Member Avatar for anandschiru

What have you tried thus far? I would suggest you try one of the PHP XML libraries to parse the content from the feed. [SimpleXML](http://uk.php.net/manual/en/book.simplexml.php) is an easy one to start with.

Member Avatar for blocblue
0
166
Member Avatar for spidyrace

Hiding form fields doesn't really help improve security. However to create a hidden field, simply use the hidden type attribute: <input type="hidden" ... />

Member Avatar for broj1
0
120
Member Avatar for mohan gold
Member Avatar for subrata_ushasi

If the snippet you've posted is for the `$answer` variable, then it looks to actually be an array, not an object. Do you have the actual `var_dump` output? Based on the above: echo $answer['AnswerId']; echo $answer['LicenseInt']['licenseID']; echo $answer['LicenseInt']['Prod_ID']; echo $answer['LicenseInt']['LicenseDate']->date;

Member Avatar for subrata_ushasi
0
212
Member Avatar for gogs85

Do you have permission from the third party site to use their content? If so, could they not provide you with a data feed?

Member Avatar for diafol
0
159
Member Avatar for shahai.ali

Why does your query not have any spaces between words? Also, values should be quoted to stop MySQL treating them as table fields. SELECT `file_title` FROM `uploads` WHERE `string_file` LIKE '%ab383292%'

Member Avatar for diafol
0
194
Member Avatar for daniel.conlinjr.1

Looks like you're missing the author and possibly other values from your insert query. Either explicitly list each field you intend to provide a value for or ensure you provide a value for all fields.

Member Avatar for daniel.conlinjr.1
0
208
Member Avatar for cssweb

Are you getting any errors when uploading the files either on screen or in the server error log? Do the images you're trying to upload exceed the filesize limit? Are the 50 images appearing in the database? Are the 50 images being successfully uploaded into your images directory?

Member Avatar for diafol
0
205
Member Avatar for showman13

$string = 'username Membership Fee' or 'Username29473 Membership Fee'; $string = explode(' ', $string); $username = $string[0];

Member Avatar for diafol
0
91
Member Avatar for Venter

Why have you started a new thread, asking the same question when someone has already taken the time to respond to your first thread? http://www.daniweb.com/web-development/php/threads/442914/suggestions-please

Member Avatar for diafol
-2
203
Member Avatar for dalilice

@veedoo - the shortcode you posted may be useful, but why re-invent the wheel when WordPress already supports shortcodes for embedding video content? http://codex.wordpress.org/Embeds @dalilice - I would be surprised if a plugin which can do as you require already existed. You *could* use nested categories, or nested pages to …

Member Avatar for blocblue
0
250
Member Avatar for magwebonline
Member Avatar for cussel

If the structure is going to remain consistent: <?php $data = array( array( array( 0 => 'chelsea everton villa liverpool', ), array( 0 => 'milan inter juventus napoli', ), ), array( array( 1 => 'madrid barcelona altetico getafe', ), array( 1 => 'milan inter juventus napoli', ), ), ); $bold …

Member Avatar for diafol
0
186
Member Avatar for scaiferw

You're going along the right lines, although one reason for salting passwords is that if your database should be comprised, your passwords cannot easily be broken. By storing the salt in the database, you're almost entirely removing that added protection. I would suggest either: 1. Using a single salt for …

Member Avatar for diafol
0
195
Member Avatar for simplypixie

On line 7, you want to merge the arrays, not add one as an item to the other. This assumes that the array keys are numeric. $images = array_merge($images + glob($imgDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE));

Member Avatar for simplypixie
0
707
Member Avatar for Lynne Good

Just remove `the_excerpt` or `the_content` tag from the loop outputting the custom posts in the template.

Member Avatar for picassokaka
0
426
Member Avatar for Diogo Martinho

Try using INNER JOIN in your query instead: SELECT `group`.`GroupID`, `car`.`Name`, MAX(`price`.`Price`) AS `Price` FROM `car` INNER JOIN `group` ON (`group`.`CarID` = `car`.`CarID`) INNER JOIN `price` ON (`price`.`CarID` = `car`.`CarID`) GROUP BY `car`.`CarID`

Member Avatar for blocblue
0
162
Member Avatar for jstfsklh211

Quick piece of feedback... In your example, either the `$titleInclude` variable needs to include the `<title>` tags, or you need to wrap the output in the tags within the template. Also, I think the use of the output buffer for capturing a single page title value is a bit much. …

Member Avatar for jstfsklh211
0
433
Member Avatar for eburlea

When looking for a book, make sure you buy one for the correct version of the framework. Zend 1.8 is rather old. The framework is on version 2.0.5, and was heavily rewritten for the release of version 2 to include the new PHP 5.3 features. Version 2 is therefore not …

Member Avatar for eburlea
0
241
Member Avatar for hwoarang69

According to the PHP docs, money_format is unsupported on Windows environments. Are you running Windows? As an alternative, you could try [number_format](http://php.net/manual/en/function.number-format.php). number_format(0, 2); // 0.00 number_format(1.00, 2); // 1.00 number_format(1.2, 2); // 1.20

Member Avatar for blocblue
0
173
Member Avatar for jacob21

On a side note, it is rather concerning to see that the message and recipient details are being sent as plain text over an unsecured connection. Does the API not offer SSL support? R.

Member Avatar for bokerinni
0
152
Member Avatar for hakeemtunde
Member Avatar for solomon_13000

The path should be relative to the file the JavaScript code is stored in. If that's not query.html, you'll likely get undesirable results. Try making the path absolute from your webroot. E.g. `url: '/abc/foo.htm'` (guessing at file structure)

Member Avatar for Airshow
0
1K

The End.