+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 20
Like Tree2Likes

Thread: Help with script.

  1. #1
    stuart1010 is offline x10Hosting Member stuart1010 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    32

    Help with script.

    Hello I have recived a script from a friend of mine to set up for him and was wondering how to get it working on his site.
    The script he has is for a PTC (Pay to click) site.

    The readme file includes
    - create the table with the database.txt dump info
    - modify the config.php and /admin/config.php files
    - Upload all the files
    - Configure Paypal email and sitename from administration
    - Default account for admin section is
    user: admin
    pass: ******


    The config files say.
    <?php
    // Database configuration
    $bd_host = "localhost";
    $bd_usuario = "username";
    $bd_password = "pass";
    $bd_base = "database";
    $url = "http://www.yoursitehere.com";
    $con = mysql_connect($bd_host, $bd_usuario, $bd_password); mysql_select_db($bd_base, $con);
    ?>


    If any one could help me and tell me how to create this and get it working the help would be appreciated.

    THank you.

  2. #2
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Help with script.

    Using CPanel go to MySQL Database Wizard.

    Create database using whatever name you want. It will be named like username_dbname where username is your CPanel login and dbname is what you typed in the box. Next, create a user with whatever name you want. Again, it will be like username_user. Set the password. Give the user all privileges on the next section.

    Then, add the information you just created to the php file.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  3. #3
    stuart1010 is offline x10Hosting Member stuart1010 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    32

    Re: Help with script.

    For the database you can't use under scores and what box are you talking about exactly.

  4. #4
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Help with script.

    the underscores are automatic. For example, if you type in: database, your database name is username_database where "username" is your cpanel user name. The box is the one that says "new database" Make sure you use the MySQL wizard and not MySQL databases tool. They have the same icon.
    karimirt47 likes this.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  5. #5
    stuart1010 is offline x10Hosting Member stuart1010 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    32

    Re: Help with script.

    sorry never mind about that last bit
    but what do i do after i create the database where do i put the information from the php file
    Last edited by stuart1010; 06-09-2009 at 07:23 PM.

  6. #6
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Help with script.

    edit the php file like this:
    Code:
    <?php
    // Database configuration
    $bd_host = "localhost"; // leave this the same
    $bd_usuario = "username"; // change this to the database name, example: username_user
    $bd_password = "pass"; // password for username_user
    $bd_base = "database"; // database you created, example: username_database
    $url = "http://www.yoursitehere.com"; // this is the url of your site, example: http://site.x10hosting.com
    $con = mysql_connect($bd_host, $bd_usuario, $bd_password);
    mysql_select_db($bd_base, $con);
    ?>
    Last edited by garrettroyce; 06-09-2009 at 07:23 PM.
    dinomirt96 likes this.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  7. #7
    stuart1010 is offline x10Hosting Member stuart1010 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    32

    Re: Help with script.

    where do i upload what do i upload all of the files to public_html
    is it ok if .php files are in here

  8. #8
    batman1's Avatar
    batman1 is offline x10Hosting Member batman1 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Jamaica
    Posts
    92

    Re: Help with script.

    upload all the files but the config file.

    Login you server control panel.

    Use the database panel to Create a MYSQL:

    1. database - example "mysite_accounts"
    2. username - example "mysite_john"
    3. password - example "VcggTf23"

    add the user to the database

    edit the config files info

    $bd_host = "localhost";
    $bd_usuario = "mysite_john";
    $bd_password = "VcggTf23";
    $bd_base = "mysite_accounts";

    save and upload the config file. Done
    Last edited by batman1; 06-09-2009 at 07:39 PM. Reason: making easier to understand

  9. #9
    stuart1010 is offline x10Hosting Member stuart1010 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    32

    Re: Help with script.

    thank you both for the help.
    now i have a new problem if you look at my site it is all full of errors like this Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/stuart10/public_html/index.php on line 12

    do i need to change all the php files to work with the database ?

  10. #10
    gomarc's Avatar
    gomarc is offline x10 Elder gomarc is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    USA
    Posts
    511

    Re: Help with script.

    Quote Originally Posted by stuart1010 View Post
    ...

    The readme file includes
    - create the table with the database.txt dump info
    After creating the database / user /pass and giving privileges, did you create the table with the database.txt dump?

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. [OFF] selling some hot script 500 credits each
    By neteater in forum The Marketplace
    Replies: 8
    Last Post: 03-24-2009, 09:08 PM
  2. CRON job : script timeout ?
    By webtomata in forum Free Hosting
    Replies: 4
    Last Post: 09-12-2008, 04:23 PM
  3. Access to 300+ PHP scripts (2500 credits)
    By jonathanyaniv in forum The Marketplace
    Replies: 11
    Last Post: 06-03-2008, 10:58 PM
  4. Replies: 8
    Last Post: 12-03-2007, 04:12 PM
  5. Server UP time Script
    By dharmil in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 04-03-2006, 04:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers