close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Finally switching from Classic ASP to PHP...help with the real basics needed!

Thread began 9/26/2013 10:06 am by Nathon Jones Web Design | Last modified 9/26/2013 1:29 pm by Jason Byrnes | 5174 views | 5 replies |

Nathon Jones Web Design

Finally switching from Classic ASP to PHP...help with the real basics needed!

Ok, after much deliberation and the realisation that, whilst it works fine just now, Classic ASP just isn't the future I have decided to try PHP as this seems the most logical language to proceed onto. Btw, I'd take any advice on this because I was gutted when I found out Classic ASP was on the way out - so soon after I felt like I was finally getting the hang of it as well! :o( I'm also quite fond of ASP and Windows hosting but that may well just be bad habits!

I've managed to source some PHP basics and, thankfully, Dreamweaver is obviously good at building the code so I can do that and then take a peak but there are one or two things I always hand coded in Classic ASP like....

<%IF Request.QueryString("querystringname") = 1 Then%>
HTML code here
<%End IF%>

How do I do the above in PHP? Also, can anyone help point me in the right direction for converting to PHP from Classic ASP?
Much appreciated.
NJ

Sign in to reply to this post

Jason ByrnesWebAssist

Changing to PHP is definitely recommended, Microsoft abandoned classic ASP in about 2000 in favor of .NET with VB.Net and C#. Theres no telling how much longer classic ASP will be still be supported on Windows Web Servers.

your if statement in php would be:

php:
<?php if((isset($_GET['querystringname']))?$_GET['querystringname']:"" == "1" ?>

HTML code here
<?php ?>




there really isn't a one to one conversion between PHP and ASP, PHP is more of a pure object oriented language than ASP is, ASP is more of a scripting language.

Sign in to reply to this post

Nathon Jones Web Design

PHP newbie alert!

Thanks for the advice Jason. My concern with switching to PHP is that it, too, will, eventually, be withdrawn. I know there are no guarantees, but what are your predictions for the future with regard to programming languages?

With regard to the code example you've given, when I drop that into my page it doesn't load. :o(
Unlike Classic ASP, PHP doesn't appear to deliver an error message. :o(
http://www.jmckeown.co.uk/quotation-electrical-work.php

Here's what I'm using:

<?php if((isset($_GET['formerror']))?$_GET['formerror']:"" == "1" { ?>
<div id="errorbox">
<strong>FORM ERROR</strong><br />
There was an error with the data you have attempted to submit. Please ensure that you complete all of the form fields below and also that you do not enter incorrect information or special characters, for example entering a telephone number in the name field will cause this error to occur.<br /><br />If you have double checked your details and you are still receiving this error please call 01671 4043755.
</div>
<?php } ?>

Thank you.
NJ

Sign in to reply to this post

Jason ByrnesWebAssist

I dont see php going anywhere, In 2000 when SP waas discontinued, PHP was at version 3, they are now at version 5 and are continuing to release updates regularly.


the if statement i gave was missing a closing parenthesis, it should be:

php:
<?php if((isset($_GET['formerror']))?$_GET['formerror']:"" == "1") { ?>




by default PHP does not have error reporting turned on.

either edit the php.ini file to set error reporting or you can add the following code at line 1 of your page to turn it on:

php:
<?php error_reporting(E_ALL); ini_set('display_errors','on'); ?>
Sign in to reply to this post

Nathon Jones Web Design

Ta.

Thanks Jason. I'm not sure new versions of PHP are any indication of its likelihood to survive. Classic ASP works/worked fine and I really don't understand why you'd scrap something that works. Call me cynical but I do feel that some new technologies are created just to keep people in a job.

Talking long term though...is WebAssists intention to continue developing extensions for PHP or do you cover, or intend to cover in the future, any other technologies?

Thanks for the parenthesis update and also the info about error reporting.
Much appreciated.
NJ

Sign in to reply to this post

Jason ByrnesWebAssist

Whether or not classic ASP works is not the debate.

Microsoft abandoned it in 2000 in favor of .NET. They have made it increasingly difficult to enable in the OS's they have released since then.

I see no evidence of PHP being abandoned, it is an open source solution that has a very strong following and development community.

Of course, I cant speak for PHP in the long term, but i can say that the days for ASP are numbered.

Our plans are to continue development for PHP. We do not have plans to adopt other languages at this time

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...