Jump to content

Rawns

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

About Rawns

  • Birthday 03/01/2006

Contact Methods

  • MSN
    hillbilly_100@hotmail.com
  • Website URL
    http://www.paulrawnsley.com

Profile Information

  • Gender
    Male
  • Location
    UK

Rawns's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This code counts how many times a page has been opened. The number is saved in 'hitcounter.txt' and displays the number on a page like this: 12345678 I would like them to be displayed like this: 12,345,678 How can I do this? This is the code used: [code]<?php $count_my_page = ("hitcounter.txt"); $hits = file($count_my_page); $hits[0] ++; $fp = fopen($count_my_page , "w"); fputs($fp , "$hits[0]"); fclose($fp); echo $hits[0]; ?>[/code]
  2. Its kind-of helped. The text does link but its messed the table up big time...
  3. I've created a simple link directory on my site (http://www.paulrawnsley.com/links.php) but cant figure out ho to make the 'link' entrys display as clickable links. Can anyone help? this is the code to show the directory: [code]<?php import_request_variables('p'); $user="XXXXXXX"; $pass="XXXXXXX"; $db="linkdb"; $link=mysql_connect("sql02",$user,$pass); if (!$link) die ("Couldn't connect to MySQL server"); mysql_select_db($db,$link) or die("Couldn't connect to $db".mysql_error()); $query="SELECT * FROM linkdb ORDER BY `title` ASC"; $result=mysql_query($query,$link);                print"<table align='center' width='100%' cellpadding='2' cellspacing='2' border='0'>"; print"<tr bgcolor='#b3cac5'>"; print"<font size='3'>"; print"<th>Title</th>"; print"<th>Link</th>"; print"<th>Description</th>"; print"</font>"; print"<tr>"; while ($row=mysql_fetch_row($result)) { print"<tr>"; foreach($row as $field) print"<td>$field</td>"; print"</tr>"; } print"</table>"; ?>[/code]
  4. Im having issues with an update page. Ive got a text area that loads the contents of a file into it when the page opens so i can edit it. However, I cant seem to get the update button to work. Can someone recomend how I can code the 'update' button to update the file with the newly edited text from the textarea? THanks.
  5. Actually, I just noticed, it 'kind of works' fine. It displays only part of the file. It does not display the PHP tages or any of the print" "; tags, just the HTML. Whay is this?
  6. [!--quoteo(post=369342:date=Apr 27 2006, 09:10 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 27 2006, 09:10 PM) [snapback]369342[/snapback][/div][div class=\'quotemain\'][!--quotec--] Use file_get_contents or fopen, for example: [code]<?php $file = file_get_contents("mainnews.php"); echo '<textarea name="textarea">' . $file . '</textarea>'; ?>[/code] [/quote] Works fine! Thank you :)
  7. Ive createad a php file called index.php in a secure folder on my server. On the page is a text area called "textarea" and an update button called "update". When the page opens I want a main news file called mainnews.php to automaticly open into the text area so I can update it online. How would I go about doing this?
  8. [!--quoteo(post=369171:date=Apr 27 2006, 12:27 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 27 2006, 12:27 PM) [snapback]369171[/snapback][/div][div class=\'quotemain\'][!--quotec--] Also as its just html there is noneed to use the print statement at all just do this: [code]Blog now online! <a href="#blog">full story...</a> RSS News feed avaiable! <a href="#rss">full story...</a> Guestbook &amp; Forums go live! <a href="#forum">full story...</a> Site Launch!<a href="#launch"> full story...</a>[/code] [/quote] Sorry to seem stupid but this is new to me, I take it i include that code within the <?php ?> tags? Still does not work :(
  9. Thanks guys. Ive made the changes like you said but it still does not display on the page :(
  10. Ive noticed that if I carry on making an indivdule page for each part of my site, Ill have to change the 'Latest News' bullets on each page! I cant be arsed with this so I have had the idea to make a simple PHP file which will print HTML out allowing me to only change the one file instead of every page. Im having issues though as im not that good with PHP. in my main page where I want the code headlines to be shown, Ive added this code: [code]     <?php include ("news.php"); ?> [/code] This should point to the news.php file if i'm right. In the news file, I've got this code: [code] <?php <?php print"Blog now online! <a href="#blog">full story...</a>"; print"RSS News feed avaiable! <a href="#rss">full story...</a>"; print"Guestbook &amp; Forums go live! <a href="#forum">full story...</a>"; print"Site Launch!<a href="#launch"> full story...</a>"; ?> [/code] Ive added it to my site and uploaded it all but nothing is displayed. Have I forgot something in the news.php file? Any help would be most appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.