473,473 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

help sending a html page through a socket ?

80 New Member
hi i am just wondering how would you send a website through a socket as i am trying to make my own web server.

do you just open up the file, read the file and write out to the socket ?

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.       op[enfile = open(home/username/www/index.html, "r");
  4.  
  5.  
  6.  
  7.       n = read(openfile,buffer,256);
  8.  
  9.  
  10.  
  11.       n = write(newsock_filedesc,openfile, 256) ;
  12.  
Mar 14 '11 #1
1 2488
Banfa
9,065 Recognized Expert Moderator Expert
If it is a plain html file then yes.

For a php file or asp or any other server side scripting then obviously you would need to run the page through the scripting language parser first and send the output of that.
Mar 14 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
1
by: TMN | last post by:
We have an ASP-based call center application that our call center operators use to track calls and forward job assignments. This app replaces a VB6-based client-server app used previously. In the...
4
by: Justin | last post by:
I have a fairly large piece of html, about 50 lines that I would like to send via an ASP.NET page I was wondering what would be the best and cleanest way to do this? Is there a way I can put the...
82
by: Eric Lindsay | last post by:
I have been trying to get a better understanding of simple HTML, but I am finding conflicting information is very common. Not only that, even in what seemed elementary and without any possibility...
2
by: fmakopo | last post by:
I am trying to save html page using C# because i want to save the page on the server not on the client side. I can do that using Javascript the problem that i am having i want to save the page on...
33
by: STILL LEARNING | last post by:
I'm not sure if this can even be done, but what prompts the question is my desire to be able to create an "Uber Link" script/code of some sort, such that even if the html page contains nothing but...
1
by: Shashank | last post by:
Hi all, I am a new member of this community. I am making a http request to a html file placed on a Apache server. On this page there is an embeded perl statement which requires reading ...
2
by: Aneesh Pulukkul[MCSD.Net] | last post by:
Hi, I have a HTML page and associated images. I need to send the HTML as email -the email should also display the images at respective places. So am sending the content of HTML file as...
4
by: Mark | last post by:
Hi Gurus, I am pretty new in ASP.net, so please help me solve a problem. We have many HTML pages which we do not want to change. What we want is on a button press it should goto a ASP page with...
1
by: talhakarkun | last post by:
hi all i have one html page which includes following input control from user: senderEmailId: Subject: body: receiverEmailId: submit button:
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
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.