473,403 Members | 2,354 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,403 software developers and data experts.

PHP code when a link is clicked a new page opens up w/o user interference?

I am fairly new at web developement so try to stay with me. I am looking for a php code that will open up and save a new webpage from one of the templates that I have on my server when a hyperlink is clicked. For example, if I click on a hyperlink that says "post", a new page opens up getting the template from my server and saving it on my server as "post 1". If the "post" button is clicked again, then the same thing happens but this time it saves it as "post 2". Let me know if this is understandable. And if you have any questions please let me know. I am desperate for help. I want to create this site so that my students can post their comments online where I can view them from my house.

Thank you
Nov 30 '10 #1
1 1219
dlite922
1,584 Expert 1GB
First of all you should do this with a database and post the comments to a table.

If you are using a file? why not use one file and just append each comment to the end of the same file so that your file will contain all comments in ascending order.

If you absolutely do need separate files for each comment,why go through the trouble of calculating the next number when you can just save the file name as a timestamp and a random number.

Lastly, we do not just "code" for you. You need to begin writing the code and ask us specific questions about the code. Otherwise we can only give you general direction (most of the time, unless someone's got some free time and is feeling Generous) like this:

1. Create a new file
2. Write the comment that was posted to it.

The PHP manual (http://www.php.net/manual/en/) is a great start!


Dan
Dec 2 '10 #2

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

Similar topics

9
by: connoisseur.infotech | last post by:
We have a website we need to open popup under following conditions 1) When user close the browser either via X button or alt + f4, file -> Close 2) when he changes URL and goes to some other site....
4
by: Wayne Wengert | last post by:
How can I have the focus on a specific textbox when a page opens? In the old ASP pages I could use an onload directive in the <Body> element but that does not work on my aspx pages? Wayne
2
by: Norseman | last post by:
I need to check that certain data fields has been saved to a SQL server when a user leaves a web page (one way or another i.e. by clicking the X (close) button or the Back-button or...). I don't...
4
by: Joshua Kendall | last post by:
I have a login open a form. Now how do I close the login when the other form opens? Thanks for the help. Joshua Kendall.
1
by: Congero | last post by:
I have a user control embedded in a page. When the user clicks a link button on the user control, I would like to execute a method on the page and pass it two parameters. How can I accomplish...
4
by: Eric | last post by:
I got a particular problem in visual studio 2005 There's a user control on page and I want to meka a cast like this MyPage mp=(MyPage)this.Page; Error is : cannot cast from...
3
by: ajaspersonal | last post by:
"i want to change font_style (hyper link<a href...>text</a>) normal to italics.when load a page" this is my problem but that label included in one 'USERCONTROL' This user controls may...
7
by: Ben Amada | last post by:
Hi ... I have an HTML page containing a bunch of <alinks. Some of the links redirect the visitor to a page at a different website in a new browser window (target=_blank) and other links are...
3
by: Max2006 | last post by:
Hi, I have a search result GridView bound to an ObjectDataSource. Once I open the asp.net page, the ObjectDataSource automatically refreshes the GridView which is the default behavior. I am...
2
tjc0ol
by: tjc0ol | last post by:
Hi guys, I have here a javascript code that is capable of changing one background image when link is clicked, it goes: <script type="text/javascript" language="javascript"> var bgImg = new...
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: 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
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
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.