Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. Will look later. You should be able to extend the regex to capture the entire image tag with all attributes. The example was just to start you off. A useful tool is regex buddy http://www.regexbuddy.com/ Get a copy of this.
  2. Sessions may be hard to grasp at first for a noob. Read this, hopefully it will give you a better understanding of how php uses sessions. http://php.about.com/od/advancedphp/ss/php_sessions.htm
  3. Here you go. Use this as a starter $url = "http://www.test.com/"; $html = '<img src="http://www.test.com/images/x.jpg"><br /><img src="images/y.jpg"><br /><img src="images/abc.jpg">'; $result = preg_replace('%<img src="([^http://])([a-zA-Z0-9\\./-_ ]+)"%', '<img src="'.$url.'$1$2', $html); print "Original html:<br />"; print "<xmp>".$html."</xmp>"; print "New html:<br />"; print "<xmp>".$result."</xmp>";
  4. Ah so you are not extracting the images paths. You are storing the entire page html and want to replace the src attribute within the html.
  5. like a php condom
  6. Dont understand If you have the url that you are scraping image paths from then why can this not be prepended to the src attribute if it doesn't already exist? That is what you are trying to do from your initial post.
  7. Google is a good start http://www.php-learn-it.com/tutorials/starting_with_php_and_ajax.html
  8. Check the permissions, ownership of the directory
  9. yes you will - do not use it put L'enveloppé.html into a google search and you will see the urls used for this keyword
  10. Objects can be stored in sessions also $_SESSION['drink']->getName();
  11. Personally I wouldn't do it like that. If all the image sources are from the same url i.e. http://www.xyz.com/images then I would just add it on later. Extract all the paths from the img src, then check if the url is included i.e. $url = "http://www.xyz.com/"; $src = "images/x.jpg"; // if the src is not absolute prepend with the url if(!strstr($src, $url)) { // will give me http://www.xyz.com/images/x.jpg $src = $url.$src; }
  12. You may want to put some of the code into functions to avoid duplication. i.e. function payment($value) { // code here // return value return $x; } // sandra payment $sandra = payment($math1); // tomas payment $tomas = payment($math2); You get the idea
  13. set this to no $limit_ext = "yes"; $limit_ext = "no";
  14. $ses_basket_name[0] = $basket; $_SESSION['ses_basket_name'] = $ses_basket_name; Anything that has been registered as a global variable with session_register(); you will have to track down
  15. session_register() is depreciated. Data added to a session should be assigned like: $_SESSION['name'] = $x; So in your case session_register("ses_basket_items"); $_SESSION['ses_basket_items'] However you may be able to work around this by enabling global variables but this is not recomended. To do this add the following to an .htaccess file php_flag register globals on
  16. You could but you could end up getting banned if you make lots of requests. Search for an API
  17. I explained briefly in previous posts to your questions As I said you use the cars primary key ID Lets do a database: cars ===== carId make model name images ===== imageId carId filename Put the carId in a hidden field in the upload form You dont have 10 fields in the cars table. You store images in the images table and use the carId as the join. I can store any number of images I want. No, when the image is uploaded and resized store the image in a thumbs/ directory with the same filename as the biggest image.
  18. I like gold, gold stars are always nice
  19. OK when a user clicks on a car you will have the id of the car in the url car.php?carId=123 Get all images from the database from carId 123 and display them on the page. You can use a bit of javascript to do a popup link. You could pass the filename within the link so on the popup page all you need is print "<img src='images/".$_GET['filename']."'>";
  20. Store the filenames in a db table after upload against the id of the car images ===== id carId filename so your cms link could be /car-images.php?carId=123
  21. As all your other pages are called from the $_GET['page'] variable you could use this as a condition. Not had a look at the code but guess I dont need to. Easy if(!strlen($_GET['page'])) { include('ads.php'); }
  22. Security terms - doesn't make a difference where the validation takes place. It all depends on the structure of your code. You may have objects taking care of validation. The validation code may be in an included file used on various pages. If its a simple form. I would place the validation code right at the top of the page. This makes it easier to display the errors on the same page and also redirect the user after the form has been submitted if required.
  23. Are you on a shared server? Read the following: http://www.sixapart.com/movabletype/kb/dynamic/open_basedir_re.html
  24. I wouldnt have guessed it was cold to hot at first glance, just is 5 different colours
×
×
  • 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.