Jump to content


  • Posts

  • Joined

  • Last visited

wilsonf1's Achievements


Member (2/7)



  1. Hi there I have created a php website based on a classic ASP site that is still live. I have ported over a lot of content (the content I really care about and is still useful) There are however a fair few pages on the ASP site that I don't want to import - it's not worth the time converting it all. I don't want to generate 100's of 404's when I flick to the PHP server. They'll also be loads of images from Google images I won't be copying across. Is there anything I can do on a more global site level to 301 any 404's to the home page, or similar? Perhaps using the htacess file? Not sure how to tackle this. I know Google Webmaster Tools is going to think a load of my content is broken until it de-indexes the irrelevant stuff....
  2. You da man! Thanks. Very simple, I just didn't have my thinking cap on that one
  3. Ok so I have 8 database fields for 8 numbers. I also have 8 tags in my HTML for those numbers. I was going to use a FOR loop to loop through the tags, and replace each with the correpsonding db field, but I couldn't get it to work so now have 8 lines like so: $this->Notes1HTML = str_replace("<Number1>", $this->formatPhoneNumber($this->directoryDataDB->Number1), $this->Notes1HTML); $this->Notes1HTML = str_replace("<Number2>", $this->formatPhoneNumber($this->directoryDataDB->Number2), $this->Notes1HTML); $this->Notes1HTML = str_replace("<Number3>", $this->formatPhoneNumber($this->directoryDataDB->Number3), $this->Notes1HTML); $this->Notes1HTML = str_replace("<Number4>", $this->formatPhoneNumber($this->directoryDataDB->Number4), $this->Notes1HTML); $this->Notes1HTML = str_replace("<Number5>", $this->formatPhoneNumber($this->directoryDataDB->Number5), $this->Notes1HTML); $this->Notes1HTML = str_replace("<Number6>", $this->formatPhoneNumber($this->directoryDataDB->Number6), $this->Notes1HTML); $this->Notes1HTML = str_replace("<Number7>", $this->formatPhoneNumber($this->directoryDataDB->Number7), $this->Notes1HTML); $this->Notes1HTML = str_replace("<Number8>", $this->formatPhoneNumber($this->directoryDataDB->Number8), $this->Notes1HTML); Say I was looping round with $i being my counter, I could use: "<Number" . $i ".>" But I couldn't replace it with $this->directoryDataDB->Number . $i could I? Is there anyway round it or shall I stick with my 8 liner
  4. Do you have an example of them being "global" ? I think what you are suggesting is right - I just haven't done it before so could do with an example of setting them up, and usage. Cheers
  5. I've kind taught myself PHP whilst looking online for examples. I use classes, I just wonder if I'm setting up my classes the right way. Do you have to explicity give a class access to another class in the way I've done below?: $db = new dbConnectionMSSQL();$systemLog = new systemLog();$clubTickets = new clubTickets();$Customers = new Customers();$Events = new Events();$TicketOrders = new TicketOrders();$PlacesOfInterest = new PlacesOfInterest();$Tonight = new Tonight(); $clubTickets->db = $db;$clubTickets->Customers = $Customers;$clubTickets->Events = $Events;$clubTickets->PlacesOfInterest = $PlacesOfInterest;$clubTickets->TicketOrders = $TicketOrders;$clubTickets->Tonight = $Tonight; That's what I've been doing up until now. Is there a more efficient way to do it? Every time I create a new class, I need to copy the bold coce above for that class. Or is that just life in PHP?
  6. mysql_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known Anyone have an ideas about this error? I have a website getting a fair amount of traffic but I get a few error emails every now and then with that in it. When I click the link to the page that generated the error, it loads fine - so it seems a random one? When I google the error I just find plenty of websites that are generating that error, not discussing it lol James
  7. Hi there I have mod_rewrite installed on my apache server, I've successfully got some rewrite rules working but one is just not working! I have a search box that produces a url like this: /search/query-here I have a page called search.php which accepts query strings like q=query-here Here is my rewrite rule that works on my site locally: www-mysite.com:8888 RewriteRule ^search/(.*)$ search\.php?q=$1 Although my search.php is being hit/loaded, no query string is being passed to my live version. When I echo $_SERVER['SCRIPT_FILENAME']. "?".$_SERVER["QUERY_STRING"]; out I get: LOCAL: /search.php?q=aa LIVE: /search.php? Any ideas what I can do?
  8. SOLVED!!!! This is the solution: <VirtualHost *:8888>DocumentRoot "C:/wamp/www"ServerName localhost</VirtualHost><VirtualHost *:8888>DocumentRoot "C:/wamp/www/mydomain/"ServerName www-mydomain-co-uk</VirtualHost> Thanks justsomeguy for looking
  9. Makes sense. It's as soon as I put in this row all localhost:888/ directories stop working, I just cannot see why: DocumentRoot "C:/wamp/www/mydomain/" Infact, when I now hit: http://localhost:8888/ - I get the same page as www-mydomain-com Now does THAT make sense?
  10. Is it to do with the * on the first line? <VirtualHost *:8888> Does that mean pick up any request going through :8888? My current code is: <VirtualHost *:8888>DocumentRoot C:/wamp/www/mydomain/ServerName www-mydomain-co-uk</VirtualHost> And further down DocumentRoot "c:/wamp/www/"
  11. Problem is, it's cutting out my other sites like: http://localhost:8888/other-website/ They all have 404's now?!
  12. Holy *** its working! <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Allow from all</Directory> This said DENY so I changed it!
  13. Couple of questions: Why is there an * on the first line? Should it be www-mydomain-co-uk to stop it affecting other requests? Should DocumentRoot be fully qualified or does it not matter? <VirtualHost *:8888>DocumentRoot C:/wamp/www/mydomainServerName www-mydomain-co-uk</VirtualHost>
  14. zero! is there a specific user permissions should be set for for Apache? IIS used to have a specific user didn't it where you play with the permissions, I forget the name now
  15. I have right clicked the www folder and mydomain folder and gone to security, all 4 users have READ rights, that's ok isn't it?
  • Create New...