- Strength to Increase Rep
- +11
- Strength to Decrease Rep
- -2
- Upvotes Received
- 161
- Posts with Upvotes
- 122
- Upvoting Members
- 78
- Downvotes Received
- 10
- Posts with Downvotes
- 10
- Downvoting Members
- 4
- Interests
- Games, Movies, Music.
- PC Specs
- Ubuntu 13.04/Win8, i5-2500k, 16Gb 1600Mhz, GForce 560Ti.
Re: 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 … | |
| Re: 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 … |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: > 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 … | |
Re: 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 … | |
Re: 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 | |
Re: 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 … | |
Re: 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, … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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: … | |
Re: 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 … | |
Re: 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; | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. |