Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. No, that is not the case. A redirect is done for a reason. Header codes are used to distinguish the type of redirect. A 301 status means that the URL has moved permanantly i.e redirect http://www.xyz.com/oldpage.html to http://www.xyz.com/newpage.html A search engine will thank you for this information. What a search engine does not like is duplicate pages. So, if one page on your website is accessible via 2 urls i.e example.com/project-details.php?p=demo example.com/demo You will end up with a penalty and your pages will end up in the Google sandbox. Therefore you should use your .htaccess file to 301 redirect your urls. Do not worry what the links are in Googles' result pages. As long as they properly redirect, this will get updated over time.
  2. Google is following your redirects. If example.com/project-details.php?p=demo is a valid page it will get indexed. If not it should be redirected to example.com/demo using a 301 header.
  3. I thought it would be crap but it was surprisingly enjoyable
  4. Nobody will give you a FREE street search from postcode data as in the UK this data is owned by the Royal Mail. The government did pass legislation that the data should be made open source but as of now I still don't think it is. You will have to check on the Royal Mail website. Postcode data is constantly being updated so it is not cheap to maintain. If you want proper website integration then I suggest http://www.postcodeanywhere.co.uk The other option is to use Google's AJAX search APIs and link in with the maps API. However entering a postcode within Google maps does not always return a street name.
  5. The best superhero movie of recent was Kick Ass. The twist that they weren't real superheros with any special powers was an original idea for the genre. Like MrAdam I think the whole genre is stale with Batman, Superman, Ironman, and every other type of man just being a whole 90 minutes of CGI and predictable story lines.
  6. PHP is not just for creating dynamic websites. It can also be used for command line purposes, such as sending a newsletter to x number of subscribers. Resizing x number of images in a directory. Basically the things that are done behind the scene & not in a web browser. Also APIS or web services are written in PHP. Lets say I have an API on my server that users can access were they provide POST data and it will return train timetables in XML format. The API is written in PHP but it can be used no matter what the programming language is that is calling it. PHP can also be used to create desktop GUI applications, although I do not have much experience using the toolkits.
  7. First result on Google http://yensdesign.com/2008/11/how-to-create-a-stylish-loading-bar-as-gmail-in-javascript/
  8. If you are putting HTML into XML you should enclose it within CDATA. This will tell the parser not to try and parse it as the HTML contains elements that are seen as XML such as < > or invalid characters such as &. http://www.w3schools.com/xml/xml_cdata.asp There is no need to try and convert any entities if you do this.
  9. Correct, unless you redirect the user off your website after sending the data to the 3rd party. cURL is use to make HTTP GET or POST requests, not for user redirection. You would use PHP headers to do this. Not really. If the target URL is not https then this is not your concern.
  10. For dedicated servers I would like to add OVH http://www.ovh.co.uk/products/dedicated_offers.xml We have about 5 of these servers running CentOS.
  11. Display the xml on screen and exit prior to parsing. Then we can look at the formatting.
  12. Simple. Process the form data on your own server and once validated send it over to the 3rd party script using cURL. i.e 1. User lands on https://www.foobar.com/signup.php 2. User completes form and clicks submit 3. Form data is sent to https://www.foobar.com/signup.php 4. Form data is validated 5. If form data validates send POST request to http://www.3rdparty.com/xyz.php containing form data using cURL SSL encrypts data sent from the client web browser to the server receiving the request. Sending data via a request from server A to server B does not use SSL.
  13. Badly formed XML. XML is strict unlike HTML. Any syntax error within a XML document will cause any parser to have a fit.
  14. errr... You should start with a book on PHP & MySQL. If you are a total newbie to PHP then you will struggle understanding any post here. This site is about offering help if you are struggling making code work that you have already written, not doing the work for you from scratch. Some Pointers (look for tutorials, books, ect) - Using PHP to query, insert, update a MySQL database - Using PHP for authentication i.e logging into a website (session management) Make a start yourself and then ask questions when you get into trouble.
  15. Amen. And the damn thing ends up being unusable and barely readable by even yourself. One of the worst ones I had was implementing VAT (tax) rules into an eccomerce app. The client had so many different rules for adding tax to prices, i.e products belong to different tax groups, if you buy a product from tax group A and 2 products from tax group B then tax is calculated using formula X, but if you buy 1 product from tax group B then tax is calculated using formula Y, and then if a customer has completed an exempt form no tax is added unless they are purchasing a product from group C. It was one hell of a job to implement and make it so that the client could add tax groups and rules that apply. I just dread looking at it if something goes wrong.
  16. For sending bulk email I mostly use Swiftmailer. http://swiftmailer.org/ I use a server running WHM & Exim that Swiftmailer can connect to over SMTP from the webserver (actioned by the administrator using the website CMS) and que up email. You can use any SMTP server to send email through (as long as it allows this), however beware of limitations such as the number of emails you can send in one batch (applies to free email servers like Hotmail, GMail, etc). For large email lists you should avoid using php's native mail() function via a loop.
  17. As Javascript is client side it is not going to be able to read the contents of a folder on your server. PHP can do this easily as it is server side. As the above post mentions, you should break the 2 steps up. Firstly, learn how to read files in a directory using php. There are plenty of examples here: http://uk2.php.net/readdir Then look at a JS slideshow. I would probably use a JQuery plugin. All you would need to do would be to loop over a bit of HTML. Here are a ton to choose from. They should be real easy to implement. http://www.webanddesigners.com/15-jquery-slideshow-and-plugins
  18. http://www.phpfreaks.com/forums/index.php/topic,277416.0.html
  19. Because it stops people just pressing the spacebar 6 times to use as a password. Thats why I said try to adopt a strict password policy. Make users enter at least 1 or 2 numbers with their password such as 'foo5bar98'
  20. As I have stated $_SERVER['REMOTE_ADDR'] could be anything even if it is the same user as they could be using a different proxy for each request. This is called a brute force attack. Your implementation isn't solid but may deter some. What you should focus on is forcing your users to have strong passwords. I would use an email address as the username. In the registration process this address should be validated. I would make sure that you have a standard for passwords i.e 6 - 10 characters containing at least 1 number, no spaces, etc
  21. <?php $string = ' <li class="g c35"> <h3 class="r"> <a href="http://www.massagestockholm.net/" class="l"><em>Massage Stockholm</em></a> </h3> <div class="s"> <em>Massage Stockholm</em> - Hitta och boka alla typer av massage i Stockholm. Enbart Bokadirekt-anslutna mass�rer. Thaimassage, Taktilmassage, Shiatsumassage <b>...</b><br> <span class="f"><cite>www.<b>massagestockholm</b>.net/</cite> - <span class="gl"><a href="http://webcache.googleusercontent.com/search?q=cache:YROKHhfXogcJ:www.massagestockholm.net/+massage+stockholm&cd=8&hl=sv&ct=clnk&gl=se&ie=UTF-8">Cachad</a></span></span> </div> </li> <li class="g c35"> <h3 class="r"> <a href="http://www.massagestockholm.net/Bookings/Default.aspx?sru=42" class="l">MASSAGEN vid Centralbadet i Stockholm - <em>Massage Stockholm</em></a> </h3> <div class="s"> <em>Massage</em> i <em>Stockholm</em> City bredvid Centralbadet Drottninggatan, boka <em>massage</em> <b>...</b><br> <span class="f"><cite>www.<b>massagestockholm</b>.net/Bookings/Default.aspx?sru...</cite> - <span class="gl"><a href="http://webcache.googleusercontent.com/search?q=cache:R8fK37N8IxAJ:www.massagestockholm.net/Bookings/Default.aspx%3Fsru%3D42+massage+stockholm&cd=9&hl=sv&ct=clnk&gl=se&ie=UTF-8">Cachad</a></span></span> </div> </li> <li class="g" id="mbb10"> <h3 class="r"> <a href="http://www.massagestockholm.net/Bookings/Default.aspx?sru=551" class="l">Kroppia - <em>Massage Stockholm</em></a> </h3> <div class="s"> <em>Massage Stockholm</em>? Rehabilitering Stockholm? Vid St Eriksplan. V�lkommen <b>...</b><br> <span class="f"><cite>www.<b>massagestockholm</b>.net/Bookings/Default.aspx?sru...</cite> - <span class="gl"><a href="http://webcache.googleusercontent.com/search?q=cache:a0T8UoaQt3IJ:www.massagestockholm.net/Bookings/Default.aspx%3Fsru%3D551+massage+stockholm&cd=10&hl=sv&ct=clnk&gl=se&ie=UTF-8">Cachad</a></span></span> </div> <div class="mbl bl"> <span class="ch c36" id="mbl10" onclick="google.x(this)"></span> <div class="mbi"> <span class="ch c36" id="mbl10" onclick="google.x(this)"></span> </div><span class="ch c36" id="mbl10" onclick="google.x(this)"><a href="#" onclick="return false" class="mblink">Visa fler resultat fr�n massagestockholm.net</a></span> </div> <div id="mbf10"></div> </li> <li class="g"> <h3 class="r"> <a href="http://www.sthlmphysique.se/" class="l"><em>Massage</em> i <em>Stockholm</em>, Vasastan - Sthlm Physique - �ven presentkort</a> </h3> <div class="s"> STHLM Physique - Erbjuder <em>massage</em> mitt i Vasastan, <em>Stockholm</em>, med certifierade terapeuter. Best�ll <em>massage</em> presentkort direkt p� hemsidan. V�lkommen!<br> <span class="f"><cite>www.sthlmphysique.se/</cite> - <span class="gl"><a href="http://webcache.googleusercontent.com/search?q=cache:1E4rvRvU_t4J:www.sthlmphysique.se/+massage+stockholm&cd=11&hl=sv&ct=clnk&gl=se&ie=UTF-8">Cachad</a> - <a href="/search?hl=sv&ie=UTF-8&q=related:www.sthlmphysique.se/+massage+stockholm&tbo=1&sa=X&ei=eiq8TOvVDIKfOtHplIcN&ved=0CEsQHzAK">Liknande</a></span></span> </div> </li> <li class="g"> adam </li> <li>abscfgef</li> <li>soh3278462378</li> <li> <a href="test.php">test</a> </li> <li> </li>'; preg_match_all("(<li class=\"g(.*)</li>)siU", $string, $matches); $result = $matches[0]; $parts = array(); foreach($result as $li) { if(!strstr($li, 'id="')) { $parts[] = $li; } } foreach($parts as $li) { print $li; } ?>
  22. Don't really understand your thinking here. If you say you are putting a limit on the casual user who is not likely to want to do anything damaging, but ignoring the people who actually use things like proxy lists for various reasons such as data mining, spamming, breaking forms etc you are not protecting anything. People do this for a reason, they are not wasting their time. They will not be using proxies to visit your website as a user would.
  23. You are looking from the wrong angle. What you need to look at is what data do you want to extract, not what you want to get rid of. Can you give a more detailed explanation. I cannot tell from your OP what you want from the source.
  24. So how much did your setup cost?
  25. I suppose so. If that is an issue you are having I would probably use a CAPTCHA on the login form. Pain in the arse but even if you use a database what do you record against that particular user who is trying to login to identify them, a primary key, an IP address. You are still going to have issues because someone could use an unlimited number of proxies so the database will fill up quickly and the number of attempts will always be 1.
×
×
  • 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.