473,387 Members | 1,416 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1495
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.