mikemrm
03-15-2009, 10:58 PM
Ok well im kind of new to php and im not sure how to do this.
On many forum sites they have a section where you can edit settings, well im trying to do that. here is a little of what i want to do
i want to have this on a webpage
<form.......
title: <input name="title"......
text: <input name="text"......
<input type="submit".......
</form>
on one page
and in a php file it will have stuff like
<?php
$title = "The Title";
$text = "The text goes here";
?>
and if you change the settings in the page with the form it will change the text in between the "" after $title and so on
Can anyone help me fix this?
Killermud
03-16-2009, 12:27 AM
Well, in the way your asking, you would have to define in your <form> tag what the method is, so thats either 'post' or 'get' difference between the 2 is that 'get' puts all the info in the address bar whereas 'post' does not, i would recommend using 'post'.
So change your tag to <form method="post" action="www.example.com">
In your php have :
<?
if(isset($_POST['submitbutton']){
$title=$_POST['title'];
$text=$_POST['text'];
}
?>
that should do what you ask for.
But i would advise doing it via a database means, as php alone cannot remember setting made, if you want to learn how to use MYSQL (database system) then contact me.
mikemrm
03-16-2009, 06:45 AM
Ok ive tried the post thing but ill try it again and i want it to save to a file named like settings.php or whatever so that it will change for everyone who visits it
Ok and how would we be in contact?
Ive been trying to setup a mysql database for a couple of weeks now and have had no success if you could help me that would be awsome
With this form on my forumshttp://24.175.221.10/pics/conf.jpg
i can change these
http://24.175.221.10/pics/ba.jpg
Killermud
03-16-2009, 06:59 PM
Well for the php issue, if you could show all the HTML with names included that would be helpful so i can give the correct php code.
For MYSQL if you intending to host a database read this :
http://otfans.net/showthread.php?t=128041 (http://otfans.net/showthread.php?t=128041)
This is rather complex and time consuming, i would recommend finding a free web hosting service, theres plenty out there or if you are going for something more proffesional buy a web hosting service.
mikemrm
03-16-2009, 07:29 PM
ok thanks im going to check out that website and i already have a website that im hosting stuff on but i can only have 300 gb of transfer a month and my clan requires more than that so ive re-routed everything to my own local servers you can check it out www.dzt.mikemrm.com
So im really trying to get everything running on my own servers.
thanks again
mikemrm
03-17-2009, 06:07 AM
ok well i tried the xampp thing and i get this error
http://24.175.221.10/pics/error.jpg