Jump to content

What to do next?


MoMoMajor

Recommended Posts

Hi everyone,

 

Ok so I am working on a small social network of sorts and I am having a little trouble linking a page to mysql.

 

So far I have a registration form that stores info in a database, creates a directory (www.mywebsite/usersdirectory) and copies a generic index.php into the aforementioned directory.

 

I am having trouble connecting the saved information in mysql to the page that was generated. I don't know how to go about linking the information from my mysql table (page_id, page_description, page_title) to the actual blank page that was generated.

 

I would greatly appreciate any help.

Link to comment
Share on other sites

ok new question: how do i edit a php file from a php file?

 

i would like to hardcode the index.php file before/after it is copied with the data from mysql

 

That doesn't really make sense.  The PHP script is not equivalent to the ultimate html that is returned.  Writing a .php file would not be of any advantage.

Link to comment
Share on other sites

Ok, I think I understand what you are meant -- you're wanting to do a config file.  See Thorpe's answer.  Keep in mind that most sites will have permissions that won't allow you to write out files, so most scripts do permissions checks and indicate if this is an issue, and then provide the information so it can be hand editted if desired.

Link to comment
Share on other sites

ok new question: how do i edit a php file from a php file?

 

i would like to hardcode the index.php file before/after it is copied with the data from mysql

 

That doesn't really make sense.  The PHP script is not equivalent to the ultimate html that is returned.  Writing a .php file would not be of any advantage.

 

 

yep you're right, no idea what i was thinking. I have no idea what to do from here. information is in mysql and I have a blank page generated with no way of connecting the two. there is obviously a way to do this since many sites work this way I just don't know what it is yet.

Link to comment
Share on other sites

Ok I am still having trouble. I think my original question was a bit vague so I will put it to you like this:

 

Say myspace was running on php/mysql. How do they go about taking the information from their mysql database and applying it to the user profile page. What lets the database and/or the index.php file know what what information from the mysql tables go where.

 

 

Link to comment
Share on other sites

They wouldn't have a different index page for each user fullstop. All user profile pages would be the same script, they just get different information from the database based on what users profile is called.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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