Jump to content

John T

Members
  • Posts

    22
  • Joined

  • Last visited

Posts posted by John T

  1. OK all jobs done! I opened my sql file in Notepad++ and renamed it to suit the new database provided by my new host, edited some lines to also match and, hey presto it worked. I was expecting "could not connect to database" but no.

     

    A couple of things did not pull over but too few to worry about.

     

    Thanks guys for the advice.

  2. Thanks for the replies.

     

    I have a download of both my databases also a complete site download and will have a look later today (Wife says I have jobs to do today)

     

    Thanks again I will report back.

  3. Thanks for the quick reply.

    I did not think it would be simple!

    Could you please tell me which scripts I need to modify as I am a complete numpty with regard to this?

     

    Thanks.

  4. Hi, I am changing my ISP and need to  import my databases.

    Do I I have to create a new datarbase or can I  change my database name to import?

    My new host has a different database prefix ie: -web147xxxxxxxx

    My old one was arewene1_wor1.

     

    Many thanks.

     

     

  5. Phew! I looked at the docs that came with wamp, apache and php as I could not find in this site. lots of reading got so confused! had a look in the files and then php admin threw up lots of errors. Could not see any data bases nothing at all! Went to bed. Opened wamp today and php admin was working again. Re installed php 5.3.0. and re ran test.php and lo and behold up came all the info regarding installed php files.

    YES, YES, YES calling php now works using

    <div id="nav">

    <?php require 'withmenu.php'; ?>

    </div>

    I think when I first installed Wamp Server I was overwhelmed with the set up procedure and 'cut corners' also not knowing what should load or not did not help.  I know it is free but some screen shots would have helped.

    A big thanks for all your help and happy Easter.

    Regards,

    John.

  6. haha I find golf even more frustrating :D.  fact is you are using neither of the two files you listed.  the only file you will be using is php.ini if you don't have a fille called that, either in your %windir% or in the php core folder, then you will need to rename one of the two files that listed to be php.ini - I would suggest the development one, as that will have the error reporting turned on.

     

    Look up the guides here at freaks and go through the guide for installing a WAMP server for your php version to double check that all the other settings are as they should be.

    Phew!!! Read the info that comes with wamp etc. got lost! could not find the docs on the forum. So I started looking in the files in Apache. I thought I had broken Myphp admin, loads of errors, could not see any data base. Turned it off and went to bed.

    Looked again today and php admin was working again. So I have re loaded PHP 5.3.0 and re ran test.php, Lo and behold all the php info came up.

    Now back to the original problem. At least it has saved me going to the sport shop for golf clubs lol.

  7. haha I find golf even more frustrating :D.  fact is you are using neither of the two files you listed.  the only file you will be using is php.ini if you don't have a fille called that, either in your %windir% or in the php core folder, then you will need to rename one of the two files that listed to be php.ini - I would suggest the development one, as that will have the error reporting turned on.

     

    Look up the guides here at freaks and go through the guide for installing a WAMP server for your php version to double check that all the other settings are as they should be.

    Yes thanks again, I will have a look at the guide. I have a couple of screen shots from my wamp.

     

    [attachment deleted by admin]

  8. No, you should have had a long set of tables giving all the settings that are stored in PHP.ini

     

    Either php is not enabled on the server that you are using for this project, or (mainly with IIS and fast cgi) the directory that you using is not set to allow scripting and execution.

    Big mistake! just been reading info on php on my wampserver. Did not know there were two different php.ini files. One for production (reconmended) and another for developement. I have no idea which one I am using or how to check what is being run on it.

    The thing that gets me is I am using on the same server a commercial genealogy program that only uses php and, that works fine.

    Perhaps I should take up golf instead! lol

  9. No, it should be on a totally new page - all by it's self.  call it something like 'test_info.php' then point your browser at 'http://domain/directory/test_info.php' (that is assuming you didn't save the file in the web rout, if you did ignore the /directory part).

     

    Try that and let us know how you get on.

    Well I got that wrong! I have now called test.php in my browser and the page returned <?php

    phpinfo();

    ?>  Is that what should have been shown?

    Thanks again.

     

     

  10. <?php

    phpinfo();

    ?>

    Returns a blank page

     

    That's a problem.  You should get all your PHP settings listed on the page.

     

    Also, you shouldn't use () with require - it's not a function.

    Thanks for the reply. I assume that

    <?php

    phpinfo();

    ?>

    is at the top of my page as that is where I tried it. Even on known working php pages it still shows no php, the page opens in my browser as if it were an html page

    I have taken out the () but made no difference. I have been reading more tutorials and have read that CSS and PHP menus should not be called from the same file so, I have also tried that.

    Calling style sheets then calling what is now called menu.php in my page results in the styles working but still no menu. More reading to do I think!

  11. Hi I am developing on wampserver a site that will have approx 50  pages in html. For ease of site admin I would like all maintenance in one place. So I have created “withmenu.php”, which has my style sheet .css,  and a jqueryslidemenu and some html for the slide menu. I also have a footer.php. The problem is perhaps very basic but I have been unable to get either of them called to pages. I have looked in tutorials but am still stumped.

    I have tried <?php include(“withmenu.php”);?> and <?php include(“footer.php”);?> I have also tried  using <?php require?>  Also with single quote marks ' but nothing happens. I have tried at the top of the page before doc type, also without any html on the page, I have tried naming all pages with .php Any ideas of what I am doing wrong or not doing please.

    This is what I have on  my page at the last attempt.

     

    <? require('withmenu.php');?>

    <div id="content">

    <h2>the page header</h2>

    <p>

    some text. 

    </p>

    </div>

    Thanks for reading this. Any help would be good.

     

  12. Hi Veteah and thanks for pointing me in the right direction

    All is now sorted with this, the echo statement only needed a page link.

    For those interested in the result the code is below.

     

    $assignedtree = $_SESSION['assignedtree'];

    $currentuser = $_SESSION['currentuser'];

    <?php    if ($assignedtree == 'tree1') {

    echo '<a href=\'page1.php\'>Page Title</a>';

    }

    elseif ($assignedtree == 'tree_2')

    {

    echo '<a href=\'page2.php\'>another page title</a>';

    }

    else

    {

        echo 'You don\'t have a user account Please register';

     

    }

    ?>

  13. Hi Veteah,

    I tried the echo statement first to see the result and it was as expected, showed who was logged in and their tree.

    Then I tried the include statement and got parse errors.

    The below is the start of my page up to your code. It shows different things I have tried and the parse errors.

    Thanks,

    John

     

    <?php

     

    include( "../begin.php"); 

    if( !$cms['support'] )

    $cms['tngpath'] = "../";

    include($cms['tngpath'] ."genlib.php");

    include($cms['tngpath'] ."getlang.php");

    include($cms['tngpath'] ."$mylanguage/text.php");

    include ($cms['tngpath'] ."checklogin.php");

    include($cms['tngpath'] . "log.php" );

    tng_db_connect($database_host,$database_name,$database_username,$database_password) or exit;

    $logstring = "<a href=\"extrapgs/welcome.php\"welcome</a>";

    writelog($logstring);

    preparebookmark($logstring);

    // ****************************** NEW CODE FROM Veteah ********************

    $assignedtree = $_SESSION['assignedtree'];

    $currentuser = $_SESSION['currentuser'];

     

    if($assignedtree == 'tree1')

    {

    echo $currentuser  . ' is looking at tree 1'; // echo is showing who is signed in and which tree is being looked at.

    // include ($cms['tngpath'] . 'cuttingshome.php'};  // If I add  ($cms['tngpath'] results in parse error line 22 (this line)

    // include  . ('cuttingshome.php'};                  // if I use single quotes results in parse error line 23 (this line)

    // include  . ("cuttingshome.php"};                  // if I use double quotes results in parse error line 24 (this line)

     

    }

    elseif($assignedtree == 'tree_2')

    {

      echo $currentuser  . ' is looking at tree 2';      // echo is showing who is signed in and which tree is being looked at.

    }

    else

    {

      echo $currentuser . ' did not match either tree';  // This also works

    }

    /*In that case, all you have to do is add

     

    include('file_path');

    ... where the echo is. */

    //  ************************* END OF NEW CODE FROM Veteah ******************************

  14. Hi, I am creating a genealogy website using The Next Generation Software. Access to the site will  require the users to log in, they will also be assigned a tree. It will have two family history trees. At the moment it is on a local wamp server.

    My question is: I have two custompages, page1.php and page2.php.

    I only want users assigned to tree1 to be able to see page1.php and users assigned to tree2 only to be able to see page2.php.

    I think I need an if else statement on each of the two pages or, they could be directed there from a welcome.php page. but as I have no knowledge of php I am clueless as to how or what to put in the if else statement and where it should go.

    I have googled php syntax and seen lots of code but they all seem to use “echo” but I do not need print anything just, go to  certain pages.

    I have seen the following in various pages of code used in the program if it helps-

    include($cms['tngpath'] ."checklogin.php");

    $assignedtree = $_SESSION['assignedtree'];

    $currentuser = $_SESSION['currentuser'];

    Any help would be appreciated many thanks for reading this.

    Regards,

    John.

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