Klam Posted December 1, 2006 Share Posted December 1, 2006 Example like creating this topic and then the server will generate the php file and the link and it will be shown into the list topic and then someone will click this topic to view itAll I know use php code to create a php file into the server and place it into the server folder. When I try to type the address with the name of the file and the web browser say it is not found. What code or method that I am missing Quote Link to comment https://forums.phpfreaks.com/topic/29057-how-to-make-a-script-to-upload-the-webpage-onto-the-server/ Share on other sites More sharing options...
Fallen_angel Posted December 1, 2006 Share Posted December 1, 2006 I am not quite sure what you are trying to ask but I will try and explain the process of what happens when a post is made which should help you a little better , first thing to do I guess is to strip away all the crap from teh url and break down what it means When a post is made on a forum or anything like this it creates and entry in a database , that entry is referanced by a specific field which is completely customisable by you , In the case of me replying to you there is first the php page that everythign gets it's info from ( index.php ) , the next part is telling you what action your doing , in this case it's "action=post " which tells index.php to pull any required info from it to be able to do this , next it goes to the database and finds your topic "116927 " and pulls down all the information from the needed fields ( such as your post info , the data created , number of replies ect ect ) what the file searches for and what those items mean in the url , are all defined in index.php or an include page within index.php using the $get functionIn summary , When a post is made there is no php file created , it is all index.php doing the work , each url is created from the code in index.php , and the information pulled from the database by index.php ( or any other file ) So effectivly one row in the database , is a thread ( same goes for posts or anythign else) Now sorry to keep it short and breif however I don't want to waste your time reading it if this isn't the info you need . I am hapy to explain it a bit further if it is , Quote Link to comment https://forums.phpfreaks.com/topic/29057-how-to-make-a-script-to-upload-the-webpage-onto-the-server/#findComment-133130 Share on other sites More sharing options...
Klam Posted December 1, 2006 Author Share Posted December 1, 2006 I think I get it, so that mean bascially there are like 3 files index.php to see rows of topics, 1 php for posting threats in the topic and 1 php for viewing the threads in the topic Quote Link to comment https://forums.phpfreaks.com/topic/29057-how-to-make-a-script-to-upload-the-webpage-onto-the-server/#findComment-133255 Share on other sites More sharing options...
Fallen_angel Posted December 1, 2006 Share Posted December 1, 2006 Yeah thats the idea , the basic thing to remember is that your php files will request the same info each time , however the variables you pass in the url will decide what is displayed to you ,eg the php for http://www.phpfreaks.com/forums/index.php?action=post;topic=116927 & http://www.phpfreaks.com/forums/index.php?action=post;topic=116 are the exact same , the only difference is that the url is telling the script to access topic_id *** which would be a field in the database , you pull the relivant info by doign somethign like he following example url :Example Url : http://www.anypage.com/index.php?id=***( the ** can be any anythign to match entries in a database alpha or numeric 'numberic is advised') [code]$id = $_GET['id']; <-- tells it to get the id variable from the urlmysql_connect("SERVERNAME", "USERNAME", "USERPASSWORD")or die(mysql_error());mysql_select_db("DATABASENAME") or die(mysql_error());$data=mysql_query(" SELECT * FROM TABLENAME where FIELDNAME='$id' ")or die(mysql_error());$info= mysql_fetch_array($data) ;[/code]What the above code does is that it looks in the url to see what id equals , lets say for examples sake it's 88 so our full url is http://www.anypage.com/index.php?id=88. Then we have the relivant info inorder to connect to the database needed. from there It takes the value of $ID (number 88 ) and it searches for that number inside of the field that you have specified (where it says FIELDNAME)This row is then pulled from the database , and you are able to pull out information from each field with the following format [code]. $info['field1'] .. $info['field2'] .. $info['field3'] .[/code]ect ect ...Obiously you are goign to want to be carefull in deciding what fields to make value's in the url so make sure your searching for something that is going to not have any duplicates ( such as topic id ) Hope that gives you a bit more understanding , and glad I was on the right track with what you wanted Quote Link to comment https://forums.phpfreaks.com/topic/29057-how-to-make-a-script-to-upload-the-webpage-onto-the-server/#findComment-133271 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.