Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6843995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:19:18+00:00 2026-05-27T00:19:18+00:00

I am trying to make HTML code inside my PHP file and return from

  • 0

I am trying to make HTML code inside my PHP file and return from my PHP Code.

<?php
require 'class.document.php';
error_reporting(0);

$usrdir=$_SESSION['username'];
$directory = "C:/xampp/htdocs/researchPortal/document_repository/".$usrdir."/";
$documents = glob("C:/xampp/htdocs/researchPortal/document_repository/student/{*.doc,*.docx,*.png}", GLOB_BRACE);
$docArray = array();


foreach($documents as $doc) {
    $document = new Document(time(),basename($doc),substr($doc, -3),substr((filesize($doc)/1024),0,6)." KB",date("F d Y H:i:s.",filectime($doc)),date("F d Y H:i:s.",filemtime($doc)));
    array_push($docArray,$document);
}


$html=  '<table class="data display datatable" id="example">
<thead>
<tr>
<th style="width:20px;">#</th>
<th>Document Name</th>
<th style="width:50px;">Type</th>
<th>Size</th>
<th>Date Created</th>
<th>Date Modified</th>
<th style="width:80px;">Action</th>
</tr>
</thead>
<tbody>';

$c=0;
foreach($docArray as $file) {

    if ($c%2) {
        $style='even';
    } else {
        $style='odd';
    }

    $con .=             '<tr class="'.$style.' gradeX">
<form id="view-doc" method="post" action="../classes/openDoc.php">
<input type="hidden" id="id" value="'.$c.'"/>
<input type="hidden" id="filename" value="'.$file->filename.'"/>
<input type="hidden" id="filetype" value="'.$file->filetype.'"/>
<td>'.$c.'</td>
<td>'.$file->filename.'</td>
<td>'.$file->filetype.'</td>
<td>'.$file->filesize.'</td>
<td>'.$file->datecreated.'</td>
<td>'.$file->datemodified.'</td>
<td><input type="submit" class="s-button btn_normal" id="submit" value="View" /></td>
</form>
</tr>';
    $c+=1;
}



echo $html.$con.'</tbody></table>';

?>

The form however is not being posted. What am I doing wrong?

Edit: openDoc.php

<?php

define("ZOHO_API_KEY", "");
$url = 'http://export.writer.zoho.com/remotedoc.im?apikey='.ZOHO_API_KEY.'&output=url';

$id=$_SESSION['id'];
$filename=$_SESSION['filename'];
$filetype=$_SESSION['filetype'];
$usrdir=$_SESSION['username'];


        $fields = array("
        'content' => '@/home/a5526551/public_html/document_repository/".$usrdir."/".$filename.",
        'apikey' => '',
        'output' => 'editor',
        'id' => ".$id.",
        'filename' => ".$filename.",
        'format' => ".$filetype.",
        'saveurl' => 'researchportal.host56.com/save.php',
        'mode' => 'normaledit'
          ");
        //echo getcwd();
        //echo curl('https://exportwriter.zoho.com/remotedoc.im',$fields);

        echo $fields["filename"];
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:19:19+00:00Added an answer on May 27, 2026 at 12:19 am

    How is it not being posted? Doesn’t the button work or can’t you find it on the server-end? Also you should set some names for you fields to be able to recognize the data, ie:

    <input type="text" name="test" value="hello" />
    

    To find it you would do:

    <?php if($_POST['test']) echo $_POST['test']; ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make changes inside an A tag with .html() and later make
i was trying to make my code in html and for some reasong when
I'm trying to make some text bold using HTML, but I'm struggling to get
I am trying to make a dropdown menu with pure html and css, but
I have been trying to make the sub-menu horizontal. In my HTML it looks
I'm trying to make a meta-language for writing markup code (such as xml and
I am trying to make a list in HTML with only a vertical scrollbar.
trying to make one horizontal box.. inside that update limits. if u see the
I have been trying to use Jeditable to make my html table editable. However
I am trying to make a bookmarklet that opens a popup window. Inside this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.