Write in file.html using a PHP form

Results 1 to 2 of 2
  1. #1
    Head Developer LogiN is offline
    True MemberRank
    Mar 2012 Join Date

    smile Write in file.html using a PHP form

    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:

    <title>HERE_TITLE FROM INPUT</title>
    This is my code work:
    <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' />&nbsp;<br/><br/>
    		 <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>
    		 <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 class="form-group">
    			<div class="col-sm-offset-2 col-sm-10">
    			  <button type="submit" class="btn btn-sm btn-success">Send</button>
    		  	<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;"> 
    					// Get Path dir
    					define('_PATH', dirname(__FILE__));
    					//Unzip File
    						//Filename ZIP
    						$filename = 'file.zip';
    						$zip = new ZipArchive;
    						$res = $zip->open($filename);
    						if ($res === TRUE) {
    							// Unzip on Path
    							$path = _PATH."/file/";
    							// Unzipfile
    							echo 'Success';
    						} else {
    							echo 'Failed!';
    		<?php ?>

    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?
    Interactive Development
    Server Solutions Online
    SROTeam ® 2012

  2. #2
    Programmer TimeBomb is offline
    May 2008 Join Date
    United StatesLocation

    Re: Write in file.html using a PHP form

    Can you elaborate on what exactly is and isn't working the way you expect right now?
    Last edited by TimeBomb; 29-05-17 at 12:57 AM.