Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by merylvingien

  1. Thanks for the replies, but i have fixed the getimage.php file and it works ok now. For anyone else that might run into this, the fix was change header("Content-Type: image/jpeg"); echo $row['image']; to $info = getimagesize($image); header('Content-Type: '.$info['mime']); echo file_get_contents($image); fastsol: Most of the original images are fairly big. Why resize a massive image that might be being downloaded on a phone via a mobile connection? Much better and quicker to serve a smaller, correct size image in the first place. Just my opinion. Anyway, thanks for the replies.
  2. Hi Folks, having a bit of an issue here that i cannot get my head around for some reason. I am working on a site that is a rebuild of an ancient site (its been around since the late 90's) Anyway, all old pages have been put into a database along with the old img tags. These images are randomly place throughout the text in the pages. Each page is called from one php file. EG: www.mysite.com/post.php?pagename=example The new site is mobile compatible so images need to be displayed as such. I always offer up larger images for desktop devices and smaller ones for mobile. EG: <?php if($ismobile) { $imgpre= "mobimages"; } else { $imgpre= "images"; } ?> <img src="<?php echo $imgpre; ?>/someimage.png" alt="" <?php if($ismobile) {echo 'width="250" height="167"';} else {echo 'width="500" height="333"';} ?>> At the moment, all the images are stored in the database as normal image tags and i have tried altering them with str_replace or preg_replace but that int going anywhere. So i have tried this <img src="getimage.php?imageid=1" width="500" height="677" alt=""> getimage.php is this: <?php $imageid = $_GET['imageid']; $sql = mysqli_query($con, "SELECT image FROM images WHERE id=$imageid"); $row = mysqli_fetch_row($sql); mysqli_close($con); header("Content-Type: image/jpeg"); echo $row['image']; ?> However, this is not working either. Anyone have any ideas, or suggestions? Its not a problem to alter the img tags in the database or have them stored seperate along with each page text. At the moment I am at a loss.
  3. Its possible that twitter didnt respond i suppose. I will look into the url and see if i can find a suitable solution. Thanks for the reply
  4. Hi Folks, i have added a twitter function to one of the pages on my site, thought it was working ok, but getting a few error messages in the logs. The function i am using is this: function getTwitterStatus($userid){ $url = "http://twitter.com/statuses/user_timeline/$userid.xml?count=5"; $file_headers = get_headers($url); if($file_headers[0] == 'HTTP/1.0 400 Bad Request') { echo "Sorry we cannot retrieve these tweets"; } else { $xml = simplexml_load_file($url); foreach($xml->status as $status){ $text = $status->text; $text = preg_replace( "/((http|ftp)+(s)?:\/\/[^<>\s]+)/i", "<a href=\"\\0\" target=\"_blank\">\\0</a>",$text); $text = preg_replace('/(^|\s)@(\w+)/', '\1@<a href="http://www.twitter.com/#!/\2">\2</a>', $text); $text = preg_replace('/(^|\s)#(\w+)/', '\1#<a href="http://search.twitter.com/search?q=%23\2">\2</a>', $text); echo "<div class=\"tweet\">$text</div>"; } } } The errors are intermittent, but show up like this: PHP Warning: simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: http://twitter.com/statuses/user_timeline/edited-username.xml?count=5:1: parser error : Start tag expected, '<' not found in /home/site/public_html/phppage.php on line 14 Line 14 is: $xml = simplexml_load_file($url); Any ideas?
  5. Ive used ipn for selling products. It makes no difference what your selling as you code the ipn return page to what you need. So for example, if someone buys an item from your site, it is good to send them an email so they know you got the order. This will reassure the buyer (it does me when i buy stuff online) In your specific case you are also going to want to update your database and alter the count of the specific item stock. Based on this, you know what variables you need to capture. Buyers email address, payment completed, quantity buyer purchased, price they paid (need to do a check on this) and whatever else you can think of. You can download the ipn example from paypal and just alter it to suit your needs.
  6. If your just using paypal to sell, you need to check that they have actually made payment and not canceled before updating your tables. Easiest way to do this is paypal ipn. Lots of info available on the net on this.
  7. Something wrong with this site, anti virus software is blocking the page
  8. Sorry i dont get this, someone (maybe not the account holder) tries to log in and is unsuccessful, so you lock that account. What if it wasnt the actual person whoes account it is that was trying the log in, the original account holder is now locked out for 30 mins through no fault of thier own. Better to have a seperate table, that logs unsuccessful tries, if someone is unsuccessful 3 times then ban thier ip for 30 mins.
  9. Firefox here, not really sure what the site is about. As for design, i like it, its clean and easy to navigate which is pretty much what people want nowadays. The only issue that i can find on first looks is the link to "issues" takes me to a different site, which is a bit confusing, but as i said i dont really understand what the site is about in the first place.
  10. No need to call me an idiot, i was trying to help with some useful input, next time i wont bother.
  11. <?php session_start(); if (isset($_POST['login'])) { if (empty($_POST['email']) || empty($_POST['password'])) { $errors[] = "Please fill out all fields."; } $email = $_POST['email']; $password = $_POST['password']; $level = 'level'; $check = mysql_query("SELECT * FROM users WHERE email='".$email."' AND password='".$password."'"); if (mysql_num_rows($check)>=1) { $errors[] = "Wrong Details. Try Again."; } $check = mysql_query("SELECT * FROM users WHERE level='".$level."'"); if (mysql_num_rows($check)>=1) { if ($level == '0') { $errors[] = "Account has not been activated."; }} if (empty($errors)) { echo "You have logged in!"; } else { foreach($errors as $nErrors){ echo $nErrors . "<br>"; } } } ?> That bit, put above the rest for starters. Whats $level? and how do you check if someone loggin in has a "level" of ? At the moment, your code sets $level to "level" $level = 'level';
  12. I am using firefox, its the two smaller ones which arent quite aligned at the bottom. Its not much but noticable. Edit: Your not number 3 on google for "free php chat" when i do a search. Unless phpopenchat.org is yours and you registered it from germany lol
  13. Dont wish to piss on your fire, but this about honest opinions... If i were you, from what i have seen i would drop seo altogether and concentrate on your strong points. If i were looking for seo services i wouldnt go with you having looked at your page. Not due to any seo you might have done, but due to design. In my humble opinion, the page looks broken, the "onsite seo"box doesnt quite line up with the "off site seo" box at the bottom. Why does the "complete seo" box sort of overlap the others and is longer and is, well a mess? No need to throw your higher priced service in my face, i get it already. Regards to actual seo, i dont think you are ready to charge folk money for this. I would be very suprised if your site ranks in the first 500 pages on google or any other search engine for the search term "SEO" or "search engine optimisation" in the forseeable future.
  14. Hi Folks, anyone know if there is a set length for a standard USA phone number? Having already googled this, i cant seem to find any info that is definitive. I know that most uk numbers are 6 digits not including the area code, but i was wondering if the US is the same or different.
  15. This is one of the best sites i have seen presented here. Its nicely displayed (clean) and the functionality is great. I think the drag and drop thing is done using jquery
  16. The reason why i need to have just one zipcode is because folk will be purchasing a subscription to each zipcode. Each subscriber can have x amount of zipcodes so will not want to purchase the same ones twice. It also makes it much easier to manage thier accounts. Well for me it does anyway. As far as the site goes, it makes little odds if the towns with duplicate zipcodes are placed into another column which can then be displayed as and when is needed. The site at the moment runs a database with postcodes rather than zipcodes, the main town is listed and other less important areas are listed as secondary areas. I hope this helps explain why i need just one zipcode per row and no duplicates.
  17. i need the zipcode to be unique as the rest of the site depends on this. sorry i should have made this clearer. I have started to try and code this, but it aint working yet
  18. Hi Folks, i am a bit stuck on how to proceed with the following and could use some input. I have a table with a whole bunch of zipcodes and places. A lot of the zipcodes are repeated and i would like to merge them e.g. 7 | 07677 | WOODCLIFF LAKE | New Jersey | 41.02 | -74 8 | 07677 | WESTWOOD | New Jersey | 41.02 | -74 9 | 07677 | WOODCLIFF LK | New Jersey | 41.02 | -74 What i would like to do is merge these into one line then delete the obsolete ones e.g. 7 | 07677 | WOODCLIFF LAKE | WESTWOOD, WOODCLIFF LK | New Jersey | 41.02 | -74 Obviously not all the zipcodes are duplicated, and with 70 odd thousand lines its a bit daunting to go through them manually. Any pointers would be useful.
  19. Your using short tags too, try changing <? to <?php
  20. Even easier is to make a table, friends, with userid, then friend id as a text field. Deliminate them however you like, space or ; etc Explode that field out when you need to find who is thier friends.
  21. Your function is named: generateHash The error message is saying undefined function generatehash() Notice the capital H
  22. Sorry my mistake, it works just fine, thank you very much.
  23. Thanks for the reply, that echos out the select list fine, but just sticks selected="selected" to 0 regardless of what the actual value of $religious is. Must be close though.
  • 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.