Jump to content

jad3z

New Members
  • Posts

    6
  • Joined

  • Last visited

jad3z's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I want to rewrite this url site.come/info.php?country=america&state=colorado&city=denver To site.com/info/america/colorado/denver .htaccess RewriteEngine On RewriteBase / RewriteRule ^info/(.*)/(.*)/(.*)/$ info.php?country=$1&state=$2&city=$3 [L] RewriteRule ^info/(.*)/(.*)/$ info.php?country=$1&state=$2 [L] RewriteRule ^info/(.*)/$ info.php?country=$1 [L] info.php <?php // City info if (isset($_GET["country"], $_GET["state"], $_GET["city"])){ include('tabel.city.php'); // State info } elseif (isset($_GET["country"], $state["provincie"])){ include('tabel.state.php'); //Country info } elseif (isset($_GET["country"])){ include('table.country.php'); // Landing Page } else { include('tabel.general.php'); } ?> I think there is something wrong, but I tried so much options for the last 6 days T.T I hope you guys can help me out, thanks in advance!
  2. Can you give me a example please?
  3. Hey guys!! I need some help I have a project of mine in java that needs mySQL integration. I haven't worked with mysql before, so I need some simple queries 1. Return a list of tables 2. Add a table with x number of columns 3. Add x value to x column in x table 3. Remove x value from x column in x table 4. Edit x value from x column in x table Thanks for reading my my topic! Regards, Joey
  4. Thanks for the response Gyer! Do you got any examples? Or tutorial/links ? THanks in advanced
  5. Hello guys! Thanks for reading my topic! I am kinda new to PHP and i try to get all these forms in 1 page Can you guys help me with that? start.php <?php $file = 'user01.ini'; if($_SERVER['REQUEST_METHOD'] == 'POST') { $data = ''; foreach($_POST AS $name=>$value) { $data .= $name . '=' . $value .PHP_EOL; } file_put_contents($file, $data, LOCK_EX); if(file_exists($file)) { echo 'Saved in <a href="' . $file . '">' . $file . '</a>'; } else { echo 'Failed'; } } if(file_exists($file)) { $ini = parse_ini_file($file); } ?> <form method="POST"> <label>IP</label> <input type="numbers" name="ip" value="<?php echo (isset($ini['ip']) ? $ini['ip'] : '127.0.0.1'); ?>" /><br /> <label>Users</label> <input type="number" name="users" value="<?php echo (isset($ini['users']) ? $ini['users'] : '10'); ?>" /><br /> <label>Website</label> <input type="text" name="website" value="<?php echo (isset($ini['website']) ? $ini['website'] : 'http://'); ?>" /><br /> <button>Start</button> </form> add.php <?php $file = fopen("user01.ini","r"); if(!file) { echo("ERROR:cant open file"); } else { $buff = fread ($file,filesize("user01.ini")); print $buff; } $file = 'user01.ini'; if($_SERVER['REQUEST_METHOD'] == 'POST') { $data = ''; foreach($_POST AS $name=>$value) { $data .= $name . '=' . $value .PHP_EOL; } file_put_contents($file, $data, LOCK_EX); if(file_exists($file)) { echo 'Saved in <a href="' . $file . '">' . $file . '</a>'; } else { echo 'Failed'; } } if(file_exists($file)) { $ini = parse_ini_file($file); } ?> <form method="POST"> <label>Add Users</label> <input type="number" name="addusers" value="<?php echo (isset($ini['addusers']) ? $ini['addusers'] : '10'); ?>" /><br /> <button>Add</button> <button>Stop</button> </form> stop.php <?php $file = 'user01.ini'; if($_SERVER['REQUEST_METHOD'] == 'POST') { $data = ''; foreach($_POST AS $name=>$value) { $data .= $name . '=' . $value .PHP_EOL; } file_put_contents($file, $data, LOCK_EX); if(file_exists($file)) { echo 'Saved in <a href="' . $file . '">' . $file . '</a>'; } else { echo 'Failed'; } } if(file_exists($file)) { $ini = parse_ini_file($file); } ?> <form method="POST"> <label>Server has stopped</label><br> <label>IP</label> <input type="numbers" name="ip" value="<?php echo (isset($ini['ip']) ? $ini['ip'] : '127.0.0.1'); ?>" /><br /> <label>Users/label> <input type="number" name="users" value="<?php echo (isset($ini['users']) ? $ini['users'] : '10'); ?>" /><br /> <label>Website</label> <input type="text" name="website" value="<?php echo (isset($ini['website']) ? $ini['website'] : 'http://'); ?>" /><br /> <button>Start</button> </form> Is it possible to code this on one page? Maby with echo function ? start.php start > add.php (index.php?p=add) add.php add > add.php (index.php?p=add) stop > stop.php (index.php?p=stop) stop.php start > start.php (index.php?p=start) Thanks in advanced guys! Im new to php and i think this forum is the place to be!
×
×
  • 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.