-
<br/> in PHP
For future reference, you shouldn't use <br /> in emails. It's better to use \n
-
First attempt...
Not too bad for a first design. Just try and add a few more colors in there to help it flow a bit better!
-
Selling website templates
Hi, I've just recently decided to make some website templates to sell and was wondering where the best place to sell them would be. They are relatively simple designs, probably worth around $50 each. They contain html, css and a little bit of php. Just wondering if anyone could give me links to some sites that allow me to sell them (I don't want to do affiliate stuff or commission or anything). Some popular forums and the like would be great! Thank you!
-
mail form problems
Use a simple if statement to check whether the email was entered and, if it wasn't, change it to an email of your choice that you know exists: if(empty($email_from)) { $email_from = 'new email'; }
-
Keeping POST data if an error occurs
Finally got it working! What I needed to do was use an $errors array and have the form in a function which can be recalled if an error occured. Thanks for everyones help
-
Keeping POST data if an error occurs
So I have a form that submits user supplied data which is then checked for a few things and (if successful) added to the database. The form submits to itself and sets a "submitted" value to 1, so that when the page reloads, it gets caught by the "if($_POST['submitted']))". The only problem is that if something goes wrong with the users input (they forget to fill in a field) the error message will be displayed, they will click "Back" and all of the information they put in is gone! For example, this is how I check the data: if (empty($_POST['artist']) || empty($_POST['description'])) { echo "Oops! Looks like you haven't filled in all of the fields. Go back and try again."; } Then they click on Back and it's all blank. I know this is going to be very frustrating if it happens to anyone as they are inputting reviews and a lot of formatting so they will not be happy if they have to do it again! How can I fix this problem? Thanks!
-
Album Art
So I've gotten a little further. My users are able to upload a picture when they create a new artist on my site. I don't have any problems storing the picture, I'm only having troubles resizing it to 300x300. Here's the code I'm using: $artistart = $HTTP_POST_FILES['image']; if ($artistart['type'] == 'image/jpeg') { $tempimg = $artistart['tmp_name']; $tempsize = getimagesize($tempimg); $width = $tempsize['0']; $height = $tempsize['1']; $newwidth = 300; $newheight = 300; $uniq = uniqid(""); $filename = DOCUMENT_ROOT . 'artistart/'.$uniq . '.jpg'; $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($tempimg); imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); return imagejpeg($thumb,$filename); } When I do this, I get a bunch of very odd (and long) code appear across the screen instead of the image I want. Can anyone help?? Thanks in advance!
-
Album Art
Thanks for the help guys. I'm gonna have a sit down and check all that stuff out when I get a chance and hopefully get something working! I'll post back here if I run into any troubles
- Album Art
-
PHP changing variable depending on which link is clicked?
You can parse through the url. E.G - www.mysite.com/thumbs.php?id=3 Then you can use PHP to get the id.. if (isset($_GET['id'])) { Put your query and display thumbnails }
-
Album Art
Thanks for your help I'm using PHP and mySQL at the moment. I know I've got the correct image libraries installed on my server so that's all cool. All I need help with is uploading an image and then converting it into two sizes (one full album, one thumbnail) with a random name (something like xfgh3sdh38.jpg) so that none of the names overlap. I'd really appreciate any help
-
Album Art
Okay, so I'm making a music review site and want to sort out the way images for albums are stored. So firstly, I'm guessing I will have a field in the "album" table called "imgpath" and that will contain something like "images/32/dsfx.jpg". But what I want to know is how I would go about having a form where the user chooses an image from their computer, the script will then take this image, resize it to 300x300 and put it inside a folder and then will create a "thumbnail" version of the image at 60x60 and put it in a different folder. I've got no idea where to start with this, a google search didn't provide much help and I want to know I'm doing it the right way so any help would be greatly appreciated!
-
CSS float properties
Thanks a bunch for your help
-
CSS float properties
Thanks for your interesting explanation So I will have to put this at the end of all my floats so that mr. browser doesn't get confused and mess everything up?
-
CSS float properties
I was going to put a div on the left for an image later but wanted it to go to the right for now. Adding that code you gave me to the bottom fixed everything though Thanks! If it wasn't too much trouble, could you just explain to me what exactly that code does to fix it? (Just for future reference)