Now before I start I must exclaim two things.
- I am a dyslexic. I will do my best to keep my spelling and grammar neat but you will more then likely notice plenty of mistakes. Sorry.
- I am as green as can be with PHP, or with most code languages that is… (Green meaning new) I have gotten some grounds with C and C++. But as for HTML and CSS (which I don’t consider real code languages) I’m fairly good with them, and am decent with java too. but any “programing” language, I really have yet to get my grounds with them.
So I’ll explain my situation. Just before summers end I made a basic game website. Fairly basic layout and currently not allot of games but it gets the job done, and I get some money from the adds I post on it. It gets quite a bit of traffic from all the students at my school visiting it, sometimes as many as 300 views a day. But there is something I had an idea for but have yet, failed to do because of my failure to understand how to get PHP in the middle of HTML. (Meaning in the middle of HTML code, not in the middle of an HTML file.) Now I should explain what I’m talking about first. There was one website that I use to regular when I was in elementary school, that has since then shut down… One of the reasons I always remembered it was because of one particular feature. Beneath every one of the games it had a “Panic” button. What it did was that when clicked, it would open up to Google in a separate tab. In reality it wouldn’t help much. Because if a teacher just saw you sitting on Google it wouldn’t make them much happier then if you were playing a game… So about a year ago I thought about the idea of making a website where any user could just simple “re-program” the panic button. My idea for the set up is that on the main menu you are faced with a bar where you can enter the URL of a website, the website your supposed to be on. So lets say I’m supposed to be on “science.com” (its a random example) I would enter the URL in the bar on the main menu, then if I click the “Panic” button under any of the games on my website, it will take me in a separate tab to that website that I entered on the main menu. Now I know that in reality this isn’t much better then the other option… More then likely it wouldn’t be used that much but doing little things like this is really the only way I will ever learn PHP. I learn by practice which is where I’m running into the trouble… Because I cant seem to figure out how to do this. So now that I have explained myself I should ask the final questions.
- Will cookies carry over from one page on my website to another? Or am I better of going with sessions?
- Can the main page remain a HTML document or dose it have to he a PHP file for what I’m doing?
- Once I get down taking the users input in a cookie/session, how do I input that data into a link? (Like, how would I get it into this <a href=”users url goes here”> Would that work?
Any other questions I come up with I will be shur to add onto this. Thank you greatly to anyone who can help me out with this. Also I apologize for not displaying any of the code I was working with, I figured it was too broken too be displayed and I was too embarrassed to display it.