Jump to content

merylvingien

Members
  • Posts

    267
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

merylvingien's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  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.
×
×
  • 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.