Jump to content

Need help with $_GET


Guest newb001

Recommended Posts

Guest newb001

Can someone tell me how to make the $_get Variable can post publicly so i dont have to edit html to update my news? I am a beginner of the php code and html in general! please i need help! Thank you in advance.

Link to comment
Share on other sites

well if you update your news your going to have to edit the file... or a file.$test = $_GET['text']this will get blah from example.com?text=blah and put it into variable $test.Then you can print $test like: print $test;Then to link to the page you have to link to example.com?text=blahIf you change the content, you will have to change the link.

Link to comment
Share on other sites

Well, you may be able to do something similar to this if you only need to add small blurbs to your website:page.php?addnewsitem=true&title=thetitle&text=ashortblurboftextthatyoucanactuallytypeinabrowserwindow&auth=somevariableThen you could have a php function that looks something like this:

function checkForUpdates(){$add = $_GET['addnewsitem'];$title = $_GET['title'];$text = $_GET['text'];$auth = $_GET['auth'];if(strcmp($add, 'true') === 0 && isProperAuth($auth))  //If the proper authentication is used...{//add the text to the file that contains all the news}else{//display the news}}function isProperAuth($authentication){/*Check to see if the proper authentication was provided. Since the get values are stored in the browser history, you should use a variable that changes over time (that you can keep track of). Like, the hour and minute of your server plus 13 minutes in a weird format, for example. That way it won't be decoded unless someone is looking for it fairly hard, lol.*/}

However, i should stress that this method is not very secure...it wouldn't take much for someone to crack it even without your browser's history at their disposal. Just a warning.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...