Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > mySQL & PHP

Notices

mySQL & PHP Discussions, information and help with mySQL and PHP.

Reply
 
LinkBack Thread Tools
  #1  
Old 09-24-2006, 08:23 PM
Sergeant
 
Join Date: Sep 2006
Location: Colchester, Essex
Posts: 25
Default PHP variable length table

Hi I have created a redirect php page that I use under my links.
The link goes to the php, records the click in a text file and redirects to the actual website.

I have then created a page to view the text file. PHP produces a table containing the information.

I then want other items on my page such as "top of page" etc.
I have put the table php in a html box. If I put my other items on the BV page as normal they appear under the table. So I put them in the HTML box as well.

The drawback is you can not see them and it makes the layout tricky.




THE RESULTS





Q) Is there a better way of doing this to help with the layout?
__________________

Regards
Richard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 09-24-2006, 08:46 PM
Andy128's Avatar
Major General
 
Join Date: Dec 2005
Location: Michigan
Posts: 2,282
Default Re: PHP variable length table

Do you want it so that every one can see it once the page is clicked on? You could have the info put into a CSV file with link that would open it once clicked. The advantage is that your page layout remains static with respect to size and location of viewable items. It would also make it easier to edit and seperate headers by week, month, day etc....


Just a thought.

Andy
__________________
My diamond in the rough - www.123gpp.com

* Click here for some BV tutorials (Php mailto Form, I-Frames, Picture display and much, much more!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 09-24-2006, 08:55 PM
Sergeant
 
Join Date: Sep 2006
Location: Colchester, Essex
Posts: 25
Default Re: PHP variable length table

OK thick moment: CSV File??

I only mean easy to view during the design stage in BlueVoda. (For me)

The published page is not for general viewing. (It will not be linked)
Instead the affiliate will have a link e.g www.no925.info/viewlog.php?id=1234

The script in the php loads the text file into an array and only displays the entries with the correct id.

This is only a simple design as I'm not up on SQL yet.
__________________

Regards
Richard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old 09-24-2006, 09:14 PM
Andy128's Avatar
Major General
 
Join Date: Dec 2005
Location: Michigan
Posts: 2,282
Default Re: PHP variable length table

Me too (not being into mysql). A CSV file is easy to estabish to collect info from a form or php script and store. It stores it in an Excel type format.

I am at work right now. When I get home after 7 pm I will post back and give the full directions with an example.

Andy
__________________
My diamond in the rough - www.123gpp.com

* Click here for some BV tutorials (Php mailto Form, I-Frames, Picture display and much, much more!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old 09-24-2006, 09:21 PM
Sergeant
 
Join Date: Sep 2006
Location: Colchester, Essex
Posts: 25
Default Re: PHP variable length table

Many thanks.
__________________

Regards
Richard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old 09-24-2006, 09:25 PM
Andy128's Avatar
Major General
 
Join Date: Dec 2005
Location: Michigan
Posts: 2,282
Default Re: PHP variable length table

One question- I take it that the link is actually a mini-form? If I assume incorrectly, could you explain the process by which the link goes to a php file and the "click" is recorded.

Thanks-

Andy
__________________
My diamond in the rough - www.123gpp.com

* Click here for some BV tutorials (Php mailto Form, I-Frames, Picture display and much, much more!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old 09-25-2006, 10:38 PM
Sergeant
 
Join Date: Sep 2006
Location: Colchester, Essex
Posts: 25
Default Re: PHP variable length table

First of all apologies for the delay in replying. I had set instant email alert but got nothing.

The link is just a normal link. <a href="www.mysite.com/go.php.......">

for GO.PHP I just opened a blank page in BV opened page HMTL and in the start I inserted the php code below. So there is no form hidden or visible.

The user is unaware of anything.

I add a couple of parameters to the link namely the affiliate 'id' and the 'site' url I want to go to.

So the link will read: www.mysite.com/go.php?id=123&site=www.yoursite.com

The script will add a log entry like this:
123,88.123.12.164,Sun 24-Sep-06 07:24:22,http://www.yoursite.com,http://www.m...om/mypage.html

and go to: www.yoursite.com


Clever or what! For my first bit of php I'm impressed. (unfortunately I found the clever part of it on another forum)

<?php #Script to log links to other sites
date_default_timezone_set('Europe/London');
$user = $_SERVER['REMOTE_ADDR'];
$code = $_GET['id'];
$site = 'http://www.' . $_GET['site'];
$log = fopen("links.log", "a");
fputs($log,$code . ',' . $user . date(',D d-M-y H:i:s,') . $site . ',' . $_SERVER['HTTP_REFERER'] . "\r\n");
fclose($log);
header ('Location: ' . $site);
exit();
?>

Any way this is all working fine. I even have a: viewlog.php?id=123 so the affiliate can see who has visited him from my site. This is where the thread started.

As you see the log is just a comma delimited simple file and with php I put it in a table.

I then want to add items to the BV page at design stage but because I do not know how long the table will be you have to put all the other items in the HMTL box.

Hope that clears things up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old 09-27-2006, 12:44 AM
Andy128's Avatar
Major General
 
Join Date: Dec 2005
Location: Michigan
Posts: 2,282
Default Re: PHP variable length table

One solution (easier that what I was proposing earlier) would be to create an I-Frame it the middle of the page. The log would present inside the I-Frame and you could then put items on the web-page where you wish as they would be uneffected buy the lenght of the table as it is in a scrollable I-Frame.

I believe this would be your best bet. I like the log table format you set up.

Andy
__________________
My diamond in the rough - www.123gpp.com

* Click here for some BV tutorials (Php mailto Form, I-Frames, Picture display and much, much more!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old 09-27-2006, 12:56 AM
Sergeant
 
Join Date: Sep 2006
Location: Colchester, Essex
Posts: 25
Default Re: PHP variable length table

BRILLIANT !!!

How simple is that?!!?

Sometimes the answer is so obvious you wonder why you never thought of it. Well done sir.

I guess thread is CLOSED

Many Thanks
Richard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old 09-27-2006, 01:57 AM
Sergeant
 
Join Date: Sep 2006
Location: Colchester, Essex
Posts: 25
Default Re: PHP variable length table

Well I said it was simple.
All done and published in 35 minutes.

I just thought I would show the results in case any one was interested at a later stage.
--------------------------------------


I can now see the footer layout at design stage.




And it looks good when published. I can now have a really long table but keep the page short and easy to view.


__________________

Regards
Richard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old 09-27-2006, 02:06 AM
Andy128's Avatar
Major General
 
Join Date: Dec 2005
Location: Michigan
Posts: 2,282
Default Re: PHP variable length table

Very nice Richard- glad it all worked out.

Andy
__________________
My diamond in the rough - www.123gpp.com

* Click here for some BV tutorials (Php mailto Form, I-Frames, Picture display and much, much more!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 01:48 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2005-2009 VodaHost Web Hosting Your Perfect Web Host - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176