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
~397.17K People Reached
PC Specs
15" Macbook Pro (2011), OS X 10.7.
Favorite Tags
Member Avatar for wackyal
Member Avatar for Dani
0
3K
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
369
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
198
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
309
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
148
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
345
Member Avatar for Sanchixx

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

Member Avatar for Sanchixx
0
170
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
79
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
100
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
166
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
164
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
125
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
163
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
137
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
172
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
165
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
118
Member Avatar for mohan gold