Jump to content

wilsonf1

Members
  • Posts

    149
  • 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. hmmm im not too sure which direction to go, W3 never really elaborates does it???
  7. its fixed!!!i cant believe it the data type was set to numbers, when i created the table i was just tabbing through creating the columns i never choose numbers!!thanks to all, you know i'll be back haha
  8. This is pretty urgent as im counting down to a global event on sunday, yet my javascript reacts to a pc clock and not a time zone, so whe nthe event happens in the UK, the countdown timer will be all over the place round the world - is there anyway i can apply GMT or something to this script so everyone see;s the same values? /*Author: Robert Hashemian[url="http://www.hashemian.com/"]http://www.hashemian.com/[/url]You can use this code in any manner so long as the author'sname, Web address and this disclaimer is kept intact.********************************************************Usage Sample:<script language="JavaScript">TargetDate = "12/31/2020 5:00 AM";BackColor = "palegreen";ForeColor = "navy";CountActive = true;DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";FinishMessage = "It is finally here!";</script><script language="JavaScript" src="http://www.hashemian.com/js/countdown.js"></script>*/function calcage(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (s.length < 2) s = "0" + s; return "<b>" + s + "</b>";}function CountBack(secs) { if (secs < 0) { document.getElementById("cntdwn").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60)); document.getElementById("cntdwn").innerHTML = DisplayStr; if (CountActive) setTimeout("CountBack(" + (secs-1) + ")", 990);}function putspan(backcolor, forecolor) { document.write("<span id='cntdwn' style='background-color:" + backcolor + "; color:" + forecolor + "'></span>");}if (typeof(BackColor)=="undefined") BackColor = "white";if (typeof(ForeColor)=="undefined") ForeColor= "black";if (typeof(TargetDate)=="undefined") TargetDate = "12/31/2020 5:00 AM";if (typeof(DisplayFormat)=="undefined") DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";if (typeof(CountActive)=="undefined") CountActive = true;if (typeof(FinishMessage)=="undefined") FinishMessage = "";putspan(BackColor, ForeColor);var dthen = new Date(TargetDate);var dnow = new Date();ddiff = new Date(dthen-dnow);gsecs = Math.floor(ddiff.valueOf()/1000);CountBack(gsecs);
  9. thanks, but unfortunately whatever i put in the second value doesnt work, text, dates, numbers........ same old errorinsertSQL = "INSERT INTO emails (email,date_added) VALUES ('" & emailadd & "','hello')"
  10. i tried the square brackets and a new column name, the result:INSERT INTO emails (email,date_added) VALUES ('admin@enterf2.co.uk','13/03/2007')Microsoft JET Database Engine error '80040e07'Data type mismatch in criteria expression./mclaren-teamcasts-email2.asp, line 28
  11. this may help, i unleashed the response.write - whats up with this!!:INSERT INTO emails (email,date) VALUES ('admin@enterf2.co.uk','13/03/2007')Microsoft JET Database Engine error '80040e14'Syntax error in INSERT INTO statement./mclaren-teamcasts-email2.asp, line 28
  12. hi i want to use a form for people to submit their email addresses from my site - id also like the date of the submission redorded tooi can get it working when there is just one column named 'email' (and ofcourse id for key) and the address adds fine, when i try to add a second value it doesnthere is my working lines (with a database that just has email column):insertSQL = "INSERT INTO emails (email) VALUES ('" & emailadd & "'')"'response.Write(insertSQL)databaseConnection.Execute insertSQL, adLockPessimisticthis doesnt work (extra date column added) - with the errors being:Syntax error in INSERT INTO statement. ln 28.26 insertSQL = "INSERT INTO emails (email,date) VALUES ('" & emailadd & "','10')"27 'response.Write(insertSQL)28 databaseConnection.Execute insertSQL, adLockPessimisticive tried fiddling with that second value, im using 10 just as a simple example before trying to add the date variable, with quotes, without quotes, it just complains?????????
×
×
  • Create New...