Announcement

Collapse
No announcement yet.

PHP variable length table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    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
    PHP- is a blast!

    Comment


    • #3
      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

      Comment


      • #4
        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
        PHP- is a blast!

        Comment


        • #5
          Re: PHP variable length table

          Many thanks.

          Regards
          Richard

          Comment


          • #6
            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
            PHP- is a blast!

            Comment


            • #7
              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.

              Regards
              Richard

              Comment


              • #8
                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
                PHP- is a blast!

                Comment


                • #9
                  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

                  Regards
                  Richard

                  Comment


                  • #10
                    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

                    Comment


                    • #11
                      Re: PHP variable length table

                      Very nice Richard- glad it all worked out.

                      Andy
                      PHP- is a blast!

                      Comment

                      Working...
                      X