Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by wilsonf1

  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?
  16. In fact! Just realised that adding this to httdp.conf: <VirtualHost *:8888>DocumentRoot /www/mydomainServerName www-mydomain-co-uk</VirtualHost> Even breaks: http://localhost:8888/mydomain/ which the same 403 Forbidden error - is that normal?!?!?!
  17. Hi, I have WAMP installed as well as IIS. IIS is on port 80, Apache runs on port 8888 via WAMP I want to be able to hit: http://www-mydomain-co-uk:8888 and for it to bring up: http://localhost :8888/mydomain/index.php So far I have taken these steps: httpd.conf: <VirtualHost *:8888>DocumentRoot /www/mydomainServerName www-mydomain-co-uk# Other directives here</VirtualHost> and hosts file: www-mydomain-co-uk When I hit http://www-mydomain-co-uk:8888 I get: Forbidden You don't have permission to access / on this server. So I'm on the right lines but what the ###### is up?
  18. ]Found a new solution, didn't realise there was such things as href="tel:" links! Works perfectly fine on mobile versions and the javascript works at the same time
  19. Hmm no i cant, its the default htc one. I can obviously check the mobile version in a pc browser though. When i click the number i see in the status bar the call to google analytics - so my function is all goodIts just seems to interefer with the default behavior of clicking a number on a mobile
  20. HeyI have a mobile version of my website and on one page I display a telephone number. When people click this number on their mobile phone device, it loads the number into the "make call" application. Pretty simple thing built into most mobile devices.I thought of adding an onclick event to the number to track this in google analytics - but when ever I try either onclick, or a jquery bind/click, it does track, but the number doesn't load in the call application on mobiles any more.It's like the javascript is overriding the default event - which is obviously no good!I've tried things like return TrackFunction() and tried return false and true but to no availCan anyone suggest something else to try to stop the 2 things from conflicting?Cheers
  21. Or.... Can I just adding a query string value onto the rewrite I already have?So something like:RewriteRule ^([^/\.]+).htm?mobile=true$ page.php?for=$1&mobile=true [L](only that doesnt work!!)
  22. Hi!I have a rewrite rule that picks up a .htm page and puts the file name onto a querystring on a php page:RewriteRule ^([^/\.]+).htm$ page.php?for=$1 [L]Am I able to setup a new rule that looks for a set query string on the .htm file and rewrites to a different php file.So amazon.htm currently rewrites to page.php?for=amazonI want:amazon.htm?flag=true to write to newpage.php?for=amazon
  23. BUMP!Is there no way I can put the whole incoming url in lower case, then my current lower case direct rules will be valid, no?
  • Create New...