Jump to content

steveboj

Members
  • Posts

    21
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

steveboj's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It's looking good so far, you're almost there. This line "echo '<a href="albuminfo.php?albumid=' . $row[0] . '">' . $row[1] . '</a>';" makes the 'albumid' available to albuminfo.php. So on albuminfo.php you just have to query the database to return all the data for that albumid, e.g. with a query like: $result = mysql_query("SELECT * FROM album WHERE albumid = '" . $_GET["albumid"] . "'");
  2. Yes!!! This has solved it. I had come across "SET NAMES" before, but for some reason thought you only used it when you were inserting data into a database... Thanks for taking the time to explain this – I got so excited when I realised it was working, I didn't notice my dinner was burning
  3. Thanks ChemicalBliss, using your function does make the text appear, but it also changes some of the non-standard characters to squares. I've done some testing with a different MySQL database and discovered the problem isn't actually a result of using PHP 5.2.8, e.g. The code works with PHP 5.2.8 and MySQL 5.0.51a, but it doesn't work with PHP 5.2.8 and MySQL 5.1.30 So I'm guessing it may be a character set or configuration issue with MySQL 5.1.30 - or the combination of PHP 5.2.8 and MySQL 5.1.30. Does this sound familiar to anyone else?
  4. I thought I'd finally figured out how to work with UTF-8 data and htmlentities(), until I encountered PHP 5.2.8... This code works perfectly on PHP 5.2.6, but returns an empty result on PHP 5.2.8 echo htmlentities($input_text, ENT_NOQUOTES, "UTF-8"); The $input_text comes from a MySQL database. I've done some Googling and it sounds as though this is caused by characters in the $input_text that aren't actually UTF-8. Has anyone else had this problem and found a solution?
  5. You have to do this with jQuery and AJAX - there's a good tutorial which includes a bit on loaders image here = http://blog.themeforest.net/tutorials/jquery-for-absolute-beginners-day-13/
  6. Looks like you've got into a bit of a muddle with your HTML, it seems you've included <img> tags within your links, e.g. I think this should be right: <?php do { ?> <a href="http://www.domain.com/photo_album/images/<?php echo $row_photos['photo']; ?>" rel="lightbox[roadtrip]"> <img src="http://www.domain.com/photo_album/images/small/<?php echo $row_photos['photo']; ?>" /> </a> <?php } while ($row_photos = mysql_fetch_assoc($photos)); ?> </p></div>
  7. There are pros and cons to all the different rollover methods depending on the code your working with. Your next issue will be to find a suitable way to pre-load the hover image so it displays immediately when the user hovers over the button.
  8. You really need to stop and take a few moments to make sure you understand what oni-kun has been kind enough to tell you. It simply isn't possible to style using PHP or create image rollovers using PHP. So you have posted in the wrong forum and you need to look into CSS and Javascript.
  9. You'll be really lucky to find something that does exactly what you want, e.g. do you know whether you want it to crop images to exact dimensions, or just resize the images to the longest edge. Do you know whether the initial source images will always be the same orientation and dimensions, etc. I suggest you need to work out exactly what you need the script to do, then look to create your own script using the GD functions. It'll take quite a bit of time and effort, but it'll be worth it because that's probably the only way to get an image upload/resize script that does exactly what you need. This is impossible, because a pixel is a different size depending on the monitor resolution, so a pixel is a measurement that's only relevant to monitors. It can't be translated into real physical dimensions. ...I guess it's kind of like trying to convert inches into litres
  10. You really shouldn't have all that HTML inside a PHP variable - I'm surprised it actually works! You've got two options: 1. Put all that HTML inside a text file and simply include that text file wherever you want it to appear, e.g. include("menu_file.inc"); 2. Create a new PHP file, create a function inside that file called top_nav() to contain all that HTML, then include that file at the top of your pages and use the following code to call that function wherever you want it to appear, e.g. top_nav(); If you're not already familiar with PHP functions, you should read up about them. Personally I would create a function for this, but because that code doesn't include any PHP, it would probably be simpler for you to use the text file option.
  11. That is a 'relative' path. Try using an 'absolute' path like I showed in my previous message.
  12. Since the opendir() is failing, have you checked your file path is correct? I always use an absolute path with $_SERVER["DOCUMENT_ROOT"] when using opendir(), e.g. $dir = $_SERVER["DOCUMENT_ROOT"] . "/my_folder/";
  13. Thought I should help since I contributed to making a bit of a mess of your thread... There were two main issues with your code which should have been resolved in the code below: [*]A number of the $_POST values were messed up, e.g. $_POST $name should be $_POST["name"]. [*]I think it's always a good idea to separate variables from normal text by concatenating strings, e.g. I've changed "From: $_POST[$name] < $email >" to "From: " . $_POST["name"] . "<" . $_POST["email"] . ">". This just keeps your variables separate, so they can't get confused with the normal text. I've also made a couple of other very minor changes just to make the PHP a little more compact. <?php date_default_timezone_set('America/Edmonton'); $yourEmail = "shekinteriors@yahoo.ca"; //The Email Address Form Results Will Be Sent To. Change to your email. $subject = "Online Job Requests"; //This will be displayed in your Email Subject line. Edit as needed. $body = "Name: " . $_POST["name"] . "\n"; $body .= "Email Address: " . $_POST["email"] . "\n"; $body .= "Phone: " . $_POST["phone"] . "\n"; $body .= "Job Type: " . $_POST["job_type"] . "\n"; $body .= "Job Description: " . implode(", ", $_POST["job_description"]) . "\n"; mail($yourEmail, $subject, $body, "From: " . $_POST["name"] . "<" . $_POST["email"] . ">"); $thankyousubject = "Request Submitted Successfully \n on \n " . date("n/j/Y, \a\\t g:i a T"); //This will be displayed after a submission. Edit to suit your needs. The \n represent page breaks. $thankyoumsg = "Thank you " . $_POST["name"] . " we have recieved your information. We will contact you soon."; //This will be displayed after a submission. Edit to suit your needs. ?> <html> <body style="background-color:#2c2c2c;color:#FFFFFF"> <center> <b><?php echo $thankyousubject; ?></b> <br /><br /> <?php echo $thankyoumsg; ?> <br /><br /><br /><br /> <a href="http://www.shekinteriors.com" target="_top"> <img src="http://www.shekinteriors.com/formbanner.gif" width="600" height="100" alt="Return to Shek Interiors Ltd" border="0"> </a> </center> </body> </html> Give that a go and let me know if you encounter any further problems.
  14. Doh! It's perfectly flexible. I've used this method in my own CMS for years without any problems : ) Really? Using RegEx to try and ascertain the correct fields to pull values from assumes that when there are changes to be made later (by the same or different person) that the person knows the logic for ascertaining those fields. It could happen that they want to add a field for the user to enter the number of years that they have conducted those job descriptions. That field might be created with the name "job_description_years" - which would introduce a bug. Of course, I am manufacturing a scenario that would break that code and lead to additional time needed to debug. But, the point is that it is not an efficient method and introduces much more complexity than simply making the fields an array and using a single implode() function in the processing page. OK, that is a potential problem with my quickly written example (I didn't bother including my usual regex to only match numbers after the initial "job_description_"). On it's own that doesn't make this method inflexible, but I get your point, i.e. it's better to code things properly, especially if the code could be edited by someone else in the future.
  15. Doh! It's perfectly flexible. I've used this method in my own CMS for years without any problems : )
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.