Web Design and Development Forums

Problem attaching PHP to webpages

This is a discussion on "Problem attaching PHP to webpages" within the PHP Forum section. This forum, and the thread "Problem attaching PHP to webpages are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > PHP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 18th, 2008, 18:41   #1 (permalink)
New Member
 
Join Date: Apr 2008
Location: India
Age: 16
Posts: 2
Problem attaching PHP to webpages

Hello Guys,

I am new here and desperately in need of some guidance. I am a beginner in web development. I wanted to design a dynamic website so I asked someone to do all the php coding for me and send me those files and teach me how to use them. He took the money and send me the files but is not giving support. Now I need someone who can tell me how to do the basic php coding work.

He made all the files which just have to be included in my webpages. He asked me to use the following code to attach those files - <? include 'filename.php'; ?>

To test it, I made a webpage and used a login.php which he made for me. I added the following code in the body of the page <? include 'login.php'; ?> but when it try to open that page on the internet, i get an error which says i have an error in the main data.php file

These are the only lines which data.php contains. Can you please tell me what to do?

------------------------------------------------------------------------------------

line 1 <?php

line 14 $hostname_conn_abrv = "localhost"; ////database hostname, usually always localhost
line 16 $database_conn_abrv = "salmansk_system"; ////database name
line 17 $username_conn_abrv = "salmansk_user"; /// database username
line 18 $password_conn_abrv = "user"; //// database
line 19 $conn_abrv = mysql_pconnect($hostname_conn_abrv, $username_conn_abrv, $password_conn_abrv) or trigger_error (mysql_error(),E_USER_ERROR);
line 20
line 21 ?>

------------------------------------------------------------------------------------

When I asked him, he just said edit the data.php file. Now I dont know what I have to edit in those lines.
Can you please guide me what to do? The link to that page is http://www.bourneaviation.com/tying.php
thumbliner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 18th, 2008, 18:50   #2 (permalink)
 
Join Date: Jun 2007
Location: uk
Posts: 459
Re: Problem attaching PHP to webpages

Hi
Firstly do you have a database set up on your host (I assume you are checking this online).

lines 14,16,17 and 18 are asking for your details for your online database

Line 14 at the moment is set for localhost, a server on your pc. do you have any server running on your pc.
dab42pat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 18th, 2008, 18:51   #3 (permalink)
Lead Administrator
 
saltedm8's Avatar
 
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,061
Blog Entries: 1
Send a message via MSN to saltedm8
Re: Problem attaching PHP to webpages

you need to find out your database access, user pass etc info, so you can connect to the database,

then you will need to input that information into the data.php file. i am sure your host can help you with this as i am sure you would not want to advertise your connection details
__________________
recipebite.co.uk - its a working progress...
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 19th, 2008, 08:19   #4 (permalink)
Junior Member
 
Join Date: Jul 2007
Location: Arkansas, USA
Age: 21
Posts: 44
Blog Entries: 1
Send a message via AIM to nashultz07 Send a message via MSN to nashultz07
Re: Problem attaching PHP to webpages

The red part is what they are talking about being edited:

Quote:
Originally Posted by thumbliner View Post
------------------------------------------------------------------------------------

line 1 <?php

line 14 $hostname_conn_abrv = "localhost"; ////database hostname, usually always localhost
line 16 $database_conn_abrv = "salmansk_system"; ////database name
line 17 $username_conn_abrv = "salmansk_user"; /// database username
line 18 $password_conn_abrv = "user"; //// database
line 19 $conn_abrv = mysql_pconnect($hostname_conn_abrv, $username_conn_abrv, $password_conn_abrv) or trigger_error (mysql_error(),E_USER_ERROR);
line 20
line 21 ?>

------------------------------------------------------------------------------------
If you are still needing help, just let us know!

Thank you,
Nathon Shultz
__________________
nashultz07 CSS Trickery: CSS Tips and Tricks
nashultz07 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 20th, 2008, 14:13   #5 (permalink)
New Member
 
Join Date: Apr 2008
Location: India
Age: 16
Posts: 2
Re: Problem attaching PHP to webpages

Quote:
Originally Posted by dab42pat View Post
Hi
Firstly do you have a database set up on your host (I assume you are checking this online).

lines 14,16,17 and 18 are asking for your details for your online database

Line 14 at the moment is set for localhost, a server on your pc. do you have any server running on your pc.
I do have a database setup. I dont know what a server is on my pc. I think i dont have any running on my pc but all that i know is that i use webhostingpad
thumbliner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 20th, 2008, 15:04   #6 (permalink)
Nerdy Moderator
 
CloudedVision's Avatar
 
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 517
Blog Entries: 4
Re: Problem attaching PHP to webpages

If you do have a database set up, do you know the username, password, and the database name? If not, you should be able to find them in your hosting control panel.

Once you have that, you can edit the file. Line 14 should stay the same. Line 15 is the username, and line 16 is the password. Line 17 is the database name.

Once you've gotten all the changes, upload it to the server and you should be set.
__________________
Take it easy

Other Road Design

WebForumz Moderator: HTML | Javascript | PHP
CloudedVision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 20th, 2008, 15:23   #7 (permalink)
Up'n'Coming Member
 
Join Date: Mar 2008
Location: Chester, UK
Age: 17
Posts: 87
Re: Problem attaching PHP to webpages

They're over selling a bit too much

Well go into your control panel, and go to phpMyAdmin and along the left panel you should see the databases that currently exist, make sure your database is there.

If so... on the main page you should see something like this

Quote:
  • Server version: 5.0.51a
  • Protocol version: 10
  • Server: localhost via TCP/IP
  • User: xxx@localhost
That's your username, and hostname...

Now From the menu under 'create new database'

Select the option 'privelages' and it will show you all the usernames with access to that database, and what they can/can't do.

You might need to change your global privelages to 'all privelages' (or to the correct privelages for what you need) and make sure theres a password.

So now you should know your host, username, password and don't forget to check the database exists and not it's name ( i think it's all case sensetive bit i'm not sure, avoid using uppercase to be safe).

And then enter the relevant names into your php code.

Even webhosts generally use 'localhost' (very few don't), some may have an i.p address or another name for it.

Hopefully that should help, if not just post

Last edited by Bocaj; Apr 20th, 2008 at 15:26.
Bocaj is offline  
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

Thread Tools
Rate This Thread
Rate This Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with thumbnails of webpages for my site 0413 New to Web Design 7 Sep 20th, 2007 08:51
Dynamic webpages Schillaci New to Web Design 1 Jul 10th, 2007 10:18
Attaching styles/classes to Javascript. Help! super8kid CSS Forum 1 Sep 14th, 2006 14:53
refreshing webpages! zillah_dee HTML Forum 2 Jun 8th, 2006 18:48
Uploading a Cv and attaching to an email Gurpreet82 ASP Forum 4 Mar 3rd, 2006 21:34



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 11:02.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


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