473,498 Members | 310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Various questions about interacting PHP and ASP

Hey all,

So far my reading is proving to be very interesting and good. This
book is very helpful, and I'm generally left with quite a few questions
about how I'm going to do stuff with my current setup. Basically
speaking, all my stuff is currently in PHP. I need the ability for
being able to interact with PHP quite a bit. My largest question right
now, is say that I want to provide some information from my PHP form to
the asp one for other processing. There were two options I suppose for
this:

1. Using vars in the URL (Sorry, I can't think of the term now, for
the life of me - post or request var handling...) such as
http://www.foo.com/?var1=value1&var2=value2....

2. Using hidden input fields in the PHP, and using javascript links to
"submit" the form to the ASP page.

I'm not in the book where to deal with form information really
effectively, but according to my reading at various sites, there's an
option called Request.Form where one can set the variables. From what
I also understand so far, using the VIEWSTATE variable is possible to
keep that data for future postbacks as well. So I suppose my questions
are best asked:

1. Which is the best method above for passing variables to the ASP
form. Can #1 be done at all? Is there another option that's better?
These will be on separate servers obviously, on paid hosting so sharing
data may be near impossible except at a database level (I'm not 100%
sure on that at this point)

2. If I wanted to keep that information, say their login information
to the site, I'm used to using session variables. instead of that, is
the viewstate the better option? How do I assign values to that (I
haven't seen that in the book yet)

3. I'm also thinking of enabling more logging across my entire site,
which will be using PHP and ASP both (I plan on a subdomain being
windows, while the main being PHP). Since the two can't share
information, and calling to the database every page load or problem can
slow down the system for not only me but others, is there a decent way
to talk to each other? I was thinking of the PHP handling all the
error logging in an SQLite file, and running a PHP file that can accept
variables for the error type, and message (using rawurlencode), which
then the PHP file would insert the needed data. Is there a way in ASP
to just call a specific URL, not to direct to it, or show it in any
way, but just to open it, and close it again? I know in PHP, I can just
use fopen to a url, then close again...but ASP I don't know very well.

Thanks for any help on this. Any suggestions on helping me learn better
would be nice too if you don't mind :) I have a long ways to go in
this language, but am kinda thinking about what I'd like to do
eventually. Once I get about half way through this book, I hope to
finally start to build some decent ASP pages. Kinda taking that part
slow, but trying to absorb so much fairly fast which may be a mistake,
I'm not sure at this point. I'm pretty happy with the language so far,
it's pretty nice.

-David

Aug 9 '06 #1
1 1497
1 -
Both #1 and #2 will work. You can post/get to and from any scripting
language to any other. The only problem with both #1 and #2 is if you need
to pass any secure information, it'll be plainly visible. Also, don't trust
the input..a user can easily change those values...so just because userId=3
doesn't mean it's actually user 3!!!

2 -
The viewstate is serialized information, I doubt you can write into it with
PHP..though someone might have already written the logic for it. In the
end, it's just another hidden form field name __viewstate, but as I said,
it's highly serialized so....

3 -
It sounds like more trouble than it's worth...I'll assume there's a good and
actual requirement to be running the two frameworks, else just use one.
Anyways, that point asside, using hte database to talk to each other isn't a
horrible ideal. Yes, it will put some extra processing, but don't knock it
until you try it..for what you are trying to do, it might be the most
scalable and best solution all round. The .NET framework has amazing socket
capabilities, including the WebRequest class which let's you easily hit
another web-page from code on the server side. My guess is this is what
you'd need:
http://msdn2.microsoft.com/en-us/lib...ebrequest.aspx

Karl
--
http://www.openmymind.net/
http://www.codebetter.com/
<David Tholewrote in message
news:20******************@News.GigaNews.Com...
Hey all,

So far my reading is proving to be very interesting and good. This book
is very helpful, and I'm generally left with quite a few questions about
how I'm going to do stuff with my current setup. Basically speaking, all
my stuff is currently in PHP. I need the ability for being able to
interact with PHP quite a bit. My largest question right now, is say that
I want to provide some information from my PHP form to the asp one for
other processing. There were two options I suppose for this:

1. Using vars in the URL (Sorry, I can't think of the term now, for the
life of me - post or request var handling...) such as
http://www.foo.com/?var1=value1&var2=value2....

2. Using hidden input fields in the PHP, and using javascript links to
"submit" the form to the ASP page.

I'm not in the book where to deal with form information really
effectively, but according to my reading at various sites, there's an
option called Request.Form where one can set the variables. From what I
also understand so far, using the VIEWSTATE variable is possible to keep
that data for future postbacks as well. So I suppose my questions are
best asked:

1. Which is the best method above for passing variables to the ASP form.
Can #1 be done at all? Is there another option that's better? These will
be on separate servers obviously, on paid hosting so sharing data may be
near impossible except at a database level (I'm not 100% sure on that at
this point)

2. If I wanted to keep that information, say their login information to
the site, I'm used to using session variables. instead of that, is the
viewstate the better option? How do I assign values to that (I haven't
seen that in the book yet)

3. I'm also thinking of enabling more logging across my entire site,
which will be using PHP and ASP both (I plan on a subdomain being windows,
while the main being PHP). Since the two can't share information, and
calling to the database every page load or problem can slow down the
system for not only me but others, is there a decent way to talk to each
other? I was thinking of the PHP handling all the error logging in an
SQLite file, and running a PHP file that can accept variables for the
error type, and message (using rawurlencode), which then the PHP file
would insert the needed data. Is there a way in ASP to just call a
specific URL, not to direct to it, or show it in any way, but just to open
it, and close it again? I know in PHP, I can just use fopen to a url, then
close again...but ASP I don't know very well.

Thanks for any help on this. Any suggestions on helping me learn better
would be nice too if you don't mind :) I have a long ways to go in this
language, but am kinda thinking about what I'd like to do eventually.
Once I get about half way through this book, I hope to finally start to
build some decent ASP pages. Kinda taking that part slow, but trying to
absorb so much fairly fast which may be a mistake, I'm not sure at this
point. I'm pretty happy with the language so far, it's pretty nice.

-David

Aug 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2928
by: Garmt de Vries | last post by:
For a long time, I've used CSS to style my webpages, but only for media "screen" and "print". Now I've started looking into styling them for other media like "projection" and "handheld". I'd be...
1
1488
by: ls | last post by:
Hi, The following URL a has a video entitled "Interacting With Web Sites in Code." The video explains exactly what I am trying to do which is to directly communicate with a website and...
2
4977
by: wireless200 | last post by:
I've got a table with some datetime fields in it. One field (call it field 1) is of the form mm/dd/yyyy and the other two (fields 2 and 3) are in the form of hh:mm:ss:xx where xx is hundreths of...
8
2665
by: Chun Wang | last post by:
1. When writing genric classes or methods, can I use specifc type (instead of generic type) as type parameter? For example: pulic class MyStack<T, int> { ..... }
1
1791
by: jason | last post by:
Hello everyone, I have some general questions about the DataTable object, and how it works. Moderately new to C#, I have plenty of texts describing the language, but not so much to reference...
0
1235
by: Jobs | last post by:
What are the standard ways of parsing XML document? XML parser sits in between the XML document and the application who wants to use the XML document. Parser exposes set of well defined...
3
4017
by: Eps | last post by:
Hi, I am writing an mp3 player using wpf, I have three user controls (media library, media controls and a playlist). Obviously I need these to interact with each other, I assume the best way to...
5
1288
by: learnPHP | last post by:
Hi, - I have 3 HTML files with javascript and PHP codes in each and each containing 8 questions for the user. - I want to convert these 3 files into 1 file say test. - That is when i first see...
5
2104
by: Michael Bray | last post by:
#1 ---- Why does VS2008 "forget" how to open EDMX files?? After opening and closing the file a few times, double clicking on the EDMX file just ends up expanding/collapsing the contents (the...
0
7124
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.