Click to See Complete Forum and Search --> : Converting from ASP to PHP - Help...


cdp103188
10-12-2007, 11:07 AM
OK, so I am a novice webmaster and I have two websites built for the business I work for. I originally coded the website using ASP but now our internet leads have increased so much that we are having to hire more salesmen and managing all of the leads is getting difficult.

I want to be able to utilize the MySQL database and as far as I know the only way to do that is using PHP instead of ASP. This conversion may prove to be difficult for a couple of reasons.

My first big problem is that I cannot figure out how to replicate the email that my form sends in ASP using PHP instead.

My second problem is testing my new PHP pages. I called GoDaddy (my website host) and their customer service said I cannot run both ASP and PHP pages on my server at the same time. This is a huge problem because I cannot just go offline for a day or two right now, this is a hunting club and fall is the biggest hunting season. My original plan was to be able to test my PHP pages without taking my ASP pages offline. Does anyone know how I might do this?

I thank you in advance for all the help.

-Cameron

patudzu
10-12-2007, 12:33 PM
Instead of re-writing the all thing in PHP why don't you use ASP and MySql through odbc?

http://codersboard.com/viewtopic.php?p=17

The major problem you can have through transition small configuraitions like mail system, also database transfer, some sql details and not much more.

It's an hard choice but I think it is easier to just make a new odbc connection instead of changing the complete ASP code. Just a guess :)

cdp103188
10-12-2007, 12:47 PM
well that would have been the logical thing to do, I did not even know that was possible and now I have 90% of my website re-coded (ASP files backed up of course). The only thing I have left to do is recode the form-email sections of my website, test my pages and work out the kinks.

I am not completely upset that I spent all that time converting either, I took java programming in high school, so this php stuff comes pretty easily to me and I like some of it's options better. ASP is extremely annoying to code for me and I am kicking myself for not coding in PHP to begin with.

patudzu
10-12-2007, 01:13 PM
Ahahahahah you're very funny.

Well...
You just have to find a hosting that can host both at the same time (I use one at Portugal http://www.tuganet.pt but you should find an internacional one like enom.com (http://enom.com)

You can also buy another hosting plan and make a night migration :)

cdp103188
10-12-2007, 01:17 PM
I see. Well in that case the only thing I am having problems with is the email section of my websites. The tutorial on w3schools does not give very much detail on composing an email with PHP, is there a good tutorial you know of for such a thing?

Here is how I have it set up in ASP:

Set Mail = Server.CreateObject("CDONTS.NewMail")

Mail.From = "info@north-american-hunter.com"

Mail.To = "DTra785007@aol.com"

Mail.Cc = "mark@huntingsportsplus.com"

Mail.Bcc = "cameron@huntingsportsplus.com, postmaster@huntingsportsplus.com"

Mail.Subject = lname & ", " & fname & " - AWA Member Prospect - " & email

Mail.Body = "--------------------------------------------------------" & vbcrlf & "The Following Contact is Interested in a HSP Membership." & vbcrlf & "--------------------------------------------------------" & vbcrlf & vbcrlf & "First Name: " & fname & vbcrlf & vbcrlf & "Last Name: " & lname & vbcrlf & vbcrlf & "Email:" & email & vbcrlf & vbcrlf & "Age:" & age & vbcrlf & vbcrlf & "Address: " & adrs1 & vbcrlf & "Address2: " & adrs2 & vbcrlf & "City: " & city & vbcrlf & "State: " & hstate & vbcrlf & "Zip: " & zip & vbcrlf & vbcrlf & "Home Phone: " & hphone & vbcrlf & "Work Phone: " & wphone & vbcrlf & "Cell Phone: " & cphone & vbcrlf & "Call in the: " & calltime & vbcrlf & vbcrlf & "Needs Plans For: " & nexthunt & vbcrlf & vbcrlf & "Budget: " & budget & vbcrlf & vbcrlf & "Would Like to Hunt: " & state & vbcrlf & vbcrlf & "Weapon Preference: " & weap & vbcrlf & vbcrlf & "Game Preference: " & game & vbcrlf & vbcrlf & "Comments: " & comm & vbcrlf & vbcrlf & "Date Submitted: " & date()

Mail.BodyFormat = 1

Mail.MailFormat = 1

Mail.Send

Response.Redirect("thanks.asp?fname=" & fname & "&lname=" & lname)

I would like to replicate that exact email using PHP instead of ASP. Is that possible?

patudzu
10-12-2007, 04:32 PM
Try first if you can send a simple mail:

Here you have it
send php mail tutorial (http://www.daniweb.com/forums/post188143.html)