SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 17th, 2003, 03:47 PM
OoTOAoO OoTOAoO is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 OoTOAoO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to OoTOAoO
inserting information from another file as HTML

In php you would use the command:
PHP Code:
<?php
        $lines 
file ('links.txt');
        foreach (
$lines as $line_num => $line) {
            echo (
$line);
        }
    
?>

and this would allow me to insert the links.txt file in my current html file. Any suggestions on how to do this in ASP? Also any suggestions on how I could get this:
PHP Code:
<?php
       
/* Connecting, selecting database */
        
$link mysql_connect("192.168.0.1""root""")
            or die(
"Could not connect : " mysql_error());
        print 
"Warcraft 3: Frozen Throne Levels Loaded Successfully<br><br>";
        
mysql_select_db("amx") or die("Could not select database");

        
/* Performing SQL query */
        
$query "SELECT * FROM war3users";
        
$result mysql_query($query) or die("Query failed : " mysql_error());

        
/* Printing results in HTML */
        
print "<table>\n";
        while (
$line mysql_fetch_array($resultMYSQL_ASSOC)) {
           print 
"\t<tr>\n";
           foreach (
$line as $col_value) {
               print 
"\t\t<td>$col_value</td>\n";
           }
           print 
"\t</tr>\n";
        }
        print 
"</table>\n";

        
/* Free resultset */
        
mysql_free_result($result);

        
/* Closing connection */
        
mysql_close($link);
    
?>

to work with asp? I installed Windows 2003 and to my knowledge it is not possible to get php to work yet.. and i need a solution.. so i'm turning to you guys.

Thanks,
Josh

Reply With Quote
  #2  
Old September 17th, 2003, 04:01 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
IIS is a webserver, PHP is application, you won't have any prohibitions to using PHP on IIS.

yes, i can rewrite all this code in asp, do you need that still when you can just run php?

Reply With Quote
  #3  
Old September 17th, 2003, 04:16 PM
OoTOAoO OoTOAoO is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 OoTOAoO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to OoTOAoO
Yes could you please? Or at least the first, the mysql isn't as important...

Reply With Quote
  #4  
Old September 17th, 2003, 04:53 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
Dim fso, ts, s
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("c:\testfile.txt", ForReading)
s = ts.Readall
Response.Write "File contents = '" & s & "'"
ts.Close


you can go line by line if you want, that's just .readline instead of .readall... pretty simple

You can use FSO to do other things too like write but just look stuff up on google if you have anyquestions on using it.

Reply With Quote
  #5  
Old September 17th, 2003, 04:55 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
database (i'm sure you can pick up on what's goin here, you'll obviously need to customize what you need to print in the loop and the sqlselect line):


dim strSQL, rs
Set con = server.createobject ("ADODB.Connection")
con.Open "odbc","login","password"
strSQL = "select * from actors"
set rs = con.Execute (strSQL)

while not rs.EOF
response.write RS("actor")
rs.MoveNext
Wend
rs.Close
con.close

Reply With Quote
  #6  
Old September 17th, 2003, 08:11 PM
OoTOAoO OoTOAoO is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 OoTOAoO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to OoTOAoO
Something I just noticed.. I don't know if I should post here or not, but I am. I just installed windows 2003 standard. I then installed IIS 6.0 and ASP .NET. I then went to web services (under IIS manager) and allowed asp pages... but now i cannot load them. URL I get a 500 internal error... anyone familiar with this?

Reply With Quote
  #7  
Old September 17th, 2003, 08:25 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
PHP Code:
 Microsoft VBScript runtime error '800a0035' 

File not found 

/test.aspline 8 


that's your real error. Go to tool->internet options->advanced tab, and disable "how friendly error messages".

Reply With Quote
  #8  
Old September 17th, 2003, 09:56 PM
OoTOAoO OoTOAoO is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 OoTOAoO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to OoTOAoO
Try to go there again.. it doesn't work for me.. it worked for like a split second...

Reply With Quote
  #9  
Old September 17th, 2003, 10:54 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
Microsoft VBScript runtime error '800a0035'

File not found

/test.asp, line 8


same thing, are you including a file or something and it's not there?

well in anycase, that's all i do is change the browser settings and i can see the error messages....

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > inserting information from another file as HTML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway