Posts
 
Reputation
Joined
Last Seen
Ranked #191
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
95% Quality Score
Upvotes Received
161
Posts with Upvotes
122
Upvoting Members
78
Downvotes Received
10
Posts with Downvotes
10
Downvoting Members
4
45 Commented Posts
11 Endorsements
Ranked #154
Ranked #195
~294.40K People Reached
Interests
Games, Movies, Music.
PC Specs
Ubuntu 13.04/Win8, i5-2500k, 16Gb 1600Mhz, GForce 560Ti.
Favorite Tags
Member Avatar for hemgoyal_1990

Hey. You could do this using a recursive function. For example, using a table like this: [code=text]mysql> SELECT * FROM tree; +----+----------+ | id | parentID | +----+----------+ | 1 | NULL | | 2 | 1 | | 3 | 1 | | 4 | 1 | | 5 …

Member Avatar for Manabendra
1
19K
Member Avatar for test.mag

Your code is specifically outputing HTML. You can't just slap a CSV content-type at the top of that. You need to update the code and remove the HTML output, and replace it with code that creates CSV output. You'd usually not generate CSV files like that, though, by echoing the …

Member Avatar for Yuriy_2
0
1K
Member Avatar for Oliver_5

If you are just looking for a generic WYSIWYG editor, there are plenty of different choices. (Try to Google that term, you should get a bunch of results.) For example, [TinyMCE](https://www.tinymce.com/) is perhaps one of the more popular. Most people will be comfortable using something like that, and it's not …

Member Avatar for diafol
0
152
Member Avatar for Joe_10

The table structure of the `survey` table you are using in the first snippet must be very odd for something like that to work. The second snippet looks more reasonable, but there are a lot of errors. For one thing, the VALUES list is missing one value. The big question …

Member Avatar for ryantroop
0
529
Member Avatar for gyno

PDO also deserves a mention, when talking about different MySQL APIs. It's not exclusively for MySQL, but the support for it is superp. In fact, it has some features MySQLi does not. (Like named parameters.) And, as an added bonus, if/when you ever start using other databases, you don't have …

Member Avatar for Atli
0
187
Member Avatar for Brett_2

Can you post the entire email source, including all the headers and the data? It's kind of hard to see the problem judging just by the additional headers. On a side-note. The PHP `mail()` function is generally not a good choice for anything more complex then simple text emails. I'd …

Member Avatar for Atli
0
205
Member Avatar for garyjohnson

Like dpste123 said: > Check the errorcode from $_FILES["file"]["error"]. The value 1 means the file is larger than the allowed filesize (from php.ini). It's likely that this is a file size issue, in which case changing the config will help, but there are also other issues that could be affecting …

Member Avatar for diafol
0
3K
Member Avatar for happygeek

I just hope Adobe Reader and the Flash Player weren't among those unnamed "other products". Those two are extremely widely used, and have enough security problems as it is. If hackers get hold of the actual source code for them, it would be a major security threat for most Windows …

Member Avatar for diafol
3
486
Member Avatar for wallet123

It seems you already have MySQL 5.5 installed and running on your machine. By default, MySQL uses port 3306, and if you install multiple instances of MySQL on the same machine, by default they will all try to use that port. However only one of them can do so at …

Member Avatar for Atli
0
6K
Member Avatar for rohan19

Those are really two entirely different things: PHP based web services, and Android development that uses web services. If you study them like that; separately, you'll get much better results than if you try to find matterial where both are linked together. PHP doesn't really care what type of client-side …

Member Avatar for superirale
0
322
Member Avatar for AdventDeo

Hey. You can specify the array index for <input> name arrays, and PHP will respect those in the receiving code. So you could do: [code=php] while($row = mysql_fetch_assoc($query_resault)) { echo "<input type='checkbox' name='Update[{$row['id']}]' value='Box #{$row['id']}'>"; echo "<input type='text' name='Value[{$row['id']}]' value='{$row['value']}'><br />"; } [/code] And, lets say that generates a list …

Member Avatar for laljaseh
-1
2K
Member Avatar for sktthemes

Nobody is just going to do all your work for you. We come here to help people solve coding problems, not to act as code-monkeys for people who can't be bothered to do the work/research themselves. I suggest you start by reading up on the [Facebook PHP SDK](https://developers.facebook.com/docs/reference/php/). It has …

Member Avatar for fireburner29
0
243
Member Avatar for amit.chaudhari.71

> means pdf flie is generate Actually, no, it's not. This code does not generate a PDF file. All it does is print the `EMPCODE` values in plain-text, on separate lines, and then tells the browser that *that* is a PDF file. It's still just a normal text file, all …

Member Avatar for yamaha.jeba
0
5K
Member Avatar for sandipan.rcciit

Hey. It's a LOT more stable to just do: [code=html] <form action="script.php" method="post"> <input type="hidden" name="isSubmitted" value="1"> <input type="image" src="myfile.jpeg" name="submit" value="Submit"> </form> [/code] [code=php] <?php if(isset($_POST['isSubmitted'])) { // etc... } ?> [/code] You should never actually test to see if the submit button was sent, because there are cases …

Member Avatar for diafol
0
952
Member Avatar for jothimathi

You're going to have to explain that in a whole hell of a lot more detail. http://www.catb.org/esr/faqs/smart-questions.html

Member Avatar for Lsmjudoka
-1
116
Member Avatar for Indians

What is the error? Right now your code just prints "Error" if the `curl_exec` isn't successfull. You need to have it print or log the actual error message. Look into the [curl_error](http://www.php.net/manual/en/function.curl-error.php) function to get that. The first thing you should always look at when you get an error is …

Member Avatar for iLikePHP
0
431
Member Avatar for Master Mascus

After having worked on PDF creation in PHP recently myself, I would recommend the [TCPDF](http://www.tcpdf.org/) library over the [FPDF](http://www.fpdf.org/) library suggested in the tutorial LastMitch posted. Both will do the job fine, but I found the TCPDF library easier to work with, an it has better HTML injection than FPDF, …

Member Avatar for Atli
0
308
Member Avatar for everton.retweets

MD5 has no place in password security any more. Hasn't for a long time now. It's an old and easily defeated algorithm. These days you should at the very least be using something akin to SHA512 or Whirlpool, if not something more advanced like Bcrypt or PBKDF2. Besides, this is …

Member Avatar for everton.retweets
0
258
Member Avatar for Red_Rain

Regardless of how the client-side code is handled, whether by old-fashioned forms or a complex JavaScript application, the data must be fetched via a request. The trick would then not be to mimic the entire JavaScript application process, but only figure out what requests are being sent by the app …

Member Avatar for chrishea
0
158
Member Avatar for blueguy777

What is the PK in that table? SQL databases don't really have a defined order of rows, unless that order is defined somehow. Usually with a PK integer column, that acts in many ways like a row counter. If the order doesn't really matter, and all you want is any …

Member Avatar for diafol
0
203
Member Avatar for ncis_sg1

You've got some big problems there. The most urgent of which would be your `INSERT` statement. The syntax is incorrect, and it's also extremely insecure. I'll explain both briefly: ## The Syntax ## When you want to insert string values, you want the INSERT command to look something like this: …

Member Avatar for ncis_sg1
0
1K
Member Avatar for jayreis

The first thing that comes to mind is that the email structure should always use the Windows form of newlines, `\r\n`, rather than the Unix form, `\n`. However you are making this far more difficult on yourself than it has to be. The `mail` function is only really a good …

Member Avatar for LastMitch
0
221
Member Avatar for lewashby

The problem doesn't seem to be with the lines you provided, but rather with the value of the `$email` variable. What exactly does that variable hold? Try adding this *above* the two lines, and show us *exactly* what it prints out. var_dump($email); exit;

Member Avatar for Atli
0
2K
Member Avatar for mmcdonald

What is actually causing the error is hard to say, but the *main* problem here is the lack of error handling in your code. You are assuming that the `$mysqli->query()` call on line 13 is always successful. If that is not true, which seems to be the case now, when …

Member Avatar for Atli
0
888
Member Avatar for venkyb47

You are redirecting the wrong request. The request you are showing there is the one that downloads the file. *It* doesn't show any content to the browser; it just downloads a file. Redirecting *it* wouldn't have any effect. What you need to do is redirect the page that triggers the …

Member Avatar for venkyb47
0
3K
Member Avatar for madmax9922

Since you have the session open at that point, it seems simplest just to use that. Save the path to the page that redirects to the login page in the session, and then once the login is successfull, use that session value to redirect back to that page. In the …

Member Avatar for madmax9922
0
42K
Member Avatar for mmcdonald

This is why I like using "[Yoda Conditions](http://en.wikipedia.org/wiki/Yoda_conditions)". Even if you make mistakes like these, the variable isn't overwritten. if ("1" = $calcDays") This would result in an actual error being thrown, since you can't assign to a constant value like that. Also, why are you quoting the numbers in …

Member Avatar for mmcdonald
0
274
Member Avatar for GlenRogers

There really is no need to store the reply count in the questions table to begin with. That is a value you can easily calculate based on the data. If you did that, you wouldn't have to go out of your way to keep that value in sync with the …

Member Avatar for GlenRogers
0
291
Member Avatar for tibor.marias

You seem to be printing each row in a separate table. If you were to print each row in an actual row inside a single table, then the browser would automatically adjust things so all the fields in a column had the same width. The browser's behaviour to automatically adjust …

Member Avatar for tibor.marias
0
582
Member Avatar for jacob21

What do you mean by "developer and dba profile"? There are a lot of factors to consider when choosing a database. One does not simply choose without some details about *how* it's going to be used.

Member Avatar for Atli
0
196