Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Write in file.html using a PHP form

Experienced Elementalist
Joined
Mar 10, 2012
Messages
285
Reaction score
120
Hello all friends, I'm trying to make a form that is able to write to a html file created.

What I need is that through the form, I can write only in specific areas, for example:

Code:
<title>HERE_TITLE FROM INPUT</title>

This is my code work:
Code:
<div class="jumbotron">
        <h1>Script Auto</h1>
        <p class="lead">Extract File</p>
        
		<?php ?>    
		<form action="" method="post" enctype="multipart/form-data" class="form-horizontal">
		  <div class="form-group">
			<label for="inputEmail3" class="col-sm-2 control-label">Archivo ZIP</label>
			<div class="col-sm-10">
				<input type='submit' class="btn btn-sm btn-success" name='unZIP' value='Unzip file' /> <br/><br/>
			</div>
		  </div>
		
		 <div class="form-group">
			<label for="inputEmail3"  type="text" name="keyword" class="col-sm-2 control-label">Lang </label>
			<div class="col-sm-10">
				<select class="form-control">
					  <option value="de"> de</option>
					  <option value="en"> en</option>
				</select>
			</div>
		 </div>
		 
		 <div class="form-group">
			<label for="inputPassword3" class="col-sm-2 control-label">Title ( title)</label>
			<div class="col-sm-10">
			  <input type="text" class="form-control" id="inputPassword3" placeholder="NAME_HERE">
			</div>
		 </div>
		 
		  <div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
			  <button type="submit" class="btn btn-sm btn-success">Send</button>
			</div>
		  </div>
		  	<p style="border-radius: 2px !important; background-color: rgba(51, 51, 51, 0.66);" class="bg-info">
				<kbd><kbd>Console: </kbd><kbd style="font-weight: 100; color:#00ff00;"> 
				
				<?php 

					// Get Path dir
					define('_PATH', dirname(__FILE__));

					//Unzip File
					if(isset($_POST['unZIP'])){
						
						//Filename ZIP
						$filename = 'file.zip';
						$zip = new ZipArchive;
						$res = $zip->open($filename);
						if ($res === TRUE) {
							// Unzip on Path
							$path = _PATH."/file/";

							// Unzipfile
							$zip->extractTo($path);
							$zip->close();

							echo 'Success';
						} else {
							echo 'Failed!';
						}
					}

				?>...</kbd></kbd>
			</p>
		</form>
		<?php ?>
	 </div>

Look:
5pBPp3s - Write in file.html using a PHP form - RaGEZONE Forums


What it does is unzip the file file.zip and then through the form edit the .html file that was generated when it was extracted in the path: file/de/index.html

It's the only thing I do not understand in what way.
Could someone help me?
Thanks!
 

Attachments

You must be registered for see attachments list
Back
Top