Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

logic in php as opposed to asp a few questions 2

Status
Not open for further replies.

btween

Programmer
Aug 7, 2003
338
US
i am completely new to php, i usually work in asp so these may seem like silly questions but they can clarify some things for me.

Can you use vbscript or some other scripting language or do you have to use php's built in logic?

Is there such a thing as a session variable in php or how can you hold information in the browser's memboy about a user session without using cookies?

thanks for your help
 
Can you use vbscript or some other scripting language or do you have to use php's built in logic?

I'm almost certain that I don't understand this question. If you are programming in a language named "foo", aren't you going to use the logic of the language "foo"?


Is there such a thing as a session variable in php or how can you hold information in the browser's memboy about a user session without using cookies?

Yes, PHP supports session variables. See the PHP online manual section on "Session Handling". For the answer to the second part of this question, look for a section of the page titled "Passing the session ID" at the link above.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
1. PHP is server side. You can create client side code, but it is the client that will (or not!) run that code. PHP is out of the game. Once the output is sent to the browser it's over.

2. PHP has built in session handling. You can write your own database driven session handler also.
 
I have several pages that have a combination of php with javascrips and vbscript and one page with php/javascript/vbscript all working together to get the job done quickly and easily. so the answer to your question is yes, you can mix them. of course php is server side only so i have used javascript and vscript for things like form validation at entry time rather than at processing. I find it saves a shed load of programming.
 
Thanks,

I already have experience with vbscript, hence I think it would be easier for me to use.

I'm sure that if I work with php for a while I will start understanding the logic but in the meanwhile...

thank you
 
Both VBScript and PHP are structured procedural languages. Other than differences in punctuation and the associated necessity in VBScript for "endif" and "endwhile", the differences between the cores of the two languages (which I assume is what you mean by "logic") are minor.

The vocabularies, however, of the two languages are very different. VBScript is an aggressively (and to my point of view, needlessly) object-oriented language. PHP is a language that supports object-oriented programming.




Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I don't know if I fully understand your question but if you are coming from ASP environment I suppose you are used to mixing VBScript, Javascript and maybe even other languages. ASP is a framework while PHP is a language. PHP is like VBScript or Javascript and not like ASP. Javascript and VBScript can be server side or client side. When they are used client side, they can be outputted by PHP in the same way as regular HTML code. If you want to use their language constructs in your server side programming in PHP environment, you cannot. So you will have to learn the language to program in PHP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top