HuggieBear
Members-
Posts
1,899 -
Joined
-
Last visited
Everything posted by HuggieBear
-
Try something really simple at first, like this: <?php // Check the error code if ($_FILES['uploaded']['error'] == 0) { // Just use the file name and save in the current location $target = basename($_FILES['uploaded']['name']); if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "File moved OK"; } else { echo "Couldn't move file"; } } else { echo "There was an error uploading the file"; } Regards Huggie
-
[SOLVED] Update database with all post data from previous page?
HuggieBear replied to SicKn3sS's topic in PHP Coding Help
Very helpful! firstly, who are you addressing, secondly, how about offering something constructive? Regards Huggie -
[SOLVED] Update database with all post data from previous page?
HuggieBear replied to SicKn3sS's topic in PHP Coding Help
You could, hence the above post. If you're only submitting certain fields each time then there needs to be an allowance for this in the database, and you'll also either need to make sure the columns in the database are the same as the fields in the form, or alternatively (and more secure) do some mapping between fields. Regards Huggie -
So there's another page that submits to this one is there? One with a form I take it? Regards Huggie
-
Yes actually, a search of these forums proved really fruitful. Give it a try, and if you don't have any luck then post back. Regards Huggie
-
How about an error message for a start. Code would also be a plus. Regards Huggie
-
In that case you'll want to change each instance of $HTTP_POST_FILES to $_FILES for a start. Then as MadTechie says, you can use $_FILES['ufile']['size'] to get the size. As for how you want to chose the file type, this can be either by extension or mime type. Regards Huggie
-
In that case I'd probably use foreach ($_POST as $key => $value) { if (empty($v)) { continue; } else { $posted[$key] = $v } } You should have an array ($posted) that just contains the relevant fields. Regards Huggie
-
[SOLVED] Update database with all post data from previous page?
HuggieBear replied to SicKn3sS's topic in PHP Coding Help
Are you saying that all your fields in the database are allowed to be null, and only certain fields will be inserted each time? You're also relying on the field names in the db matching the field names in the form? Regards Huggie -
You can use that... if (!$_POST) or if (!isset($_POST)) or if (empty($_POST)) Take a look at each of those functions. Regards Huggie
-
[SOLVED] Update database with all post data from previous page?
HuggieBear replied to SicKn3sS's topic in PHP Coding Help
You don't need to use a loop to insert data into a database, in fact, you sould do it in one SQL statement if you can. INSERT INTO table_name (column1, column2, column3) VALUES ('$var1', '$var2', '$var3') etc... Regards Huggie -
What version of PHP are you using? Regards Huggie
-
COOKIE? Why would you want to? Regards Huggie
-
Some installs support both read and write support. Regards Huggie
-
Any one got any thoughts on this one? I was going to post it in Third Party Scripts, but as I'm not actually using one yet, it doesn't seem like the right place, and I need help with deciding, not with one that I've already chosen. Regards Huggie
-
I've had a look at PHP Classes for a mail parser and there seems to be quite a few on there. Does anyone here recommend a particular reader? I want something really simple. All I want to do is be able to save an image that's attached to an email. That's all. I guess I'll need to connect to the mail server and retrieve the specific email (something I can already do with sockets) but just need to parse the attachment string. Any ideas? Regards Huggie
-
You're right, it would reduce the queries but it doesn't make the data as 'flexible'. Check out Database Normalization Regards Huggie
-
I'd say it isn't, one of my transactional tables is getting over 1 million rows a day, but then I'm using Oracle, so it can cope with it! Regards Huggie
-
[SOLVED] Netscape and Mozilla Dont See my CSS Files!
HuggieBear replied to vajra_hendry's topic in CSS Help
Yes, IE will automatically convert a backslash to a forward slash. It's always best to use a forward slash as unix/linux paths are delimeted by a forward slash, and although Windows uses a backslash as it's delimiter, it also understands a forward slash. Try it out. Regards Huggie -
Morning All, I'm designing a newsletter application and need some advice on how it should be set out. I'll give you an idea of the functionallity I want and maybe you could advise accordingly. Content: Feature stories - 3 each issue Notes from editor Caption Competition Random photo Quote of the month Poll I'll have a three column layout, the center column will display the Notes from Editor by default, and when clicked the following will appear in the center column: Each of the features Notes From editor Random Photo Page to enter your caption for the caption competition The left hand column will always display just the navigation links. The right hand column will display the caption competition photo at the top and the Poll beneath that. The quote of the month will appear at the bottom of the page in a footer. So that's the scope of the project. Here's what I'm thinking... A single index page that displays all the initial content, then if you click any of the dynamic content, it submits data to another page and redirects you back to the index page. e.g. You're on index.php, you select your answer in the poll and submit. This submits the data to poll.php to process and uses a header redirect to send you back to index.php which displays the updated poll information. As for the features, I thought I'd pass that to index.php with a single GET parameter and have that process it. So that's the only processing that index.php will do, the rest will be done by other pages. What do you think? Regards Huggie
-
Thanks Mad, I completely missed that when looking at the manual, I saw the count parameter and thought "That's not what I want". Regards Huggie
-
*bump* Anyone have any ideas, or should I try re-phrasing the question for a better response? Regards Huggie
-
That's the way I'd go, and use CSS to style it. Regards Huggie
-
Not really what they want I'm afraid. She's obviously expecting an email to an address that's already been given out.# Regards Huggie