Jump to content

defiant1970

Members
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

About defiant1970

  • Rank
    Newbie

Previous Fields

  • Languages
    html, php, mysql, mssql, css, asp.net,

Contact Methods

  • Website URL
    http://www.hrconsultingonlinehosting.com
  • ICQ
    0
  1. I have a web form using a data grid with checkboxs to select different data enterys. I have used this same peice of code on another page and it works great but when I use it on the newer page the check all boxs doesn't auto post back right (none of the boxs are checked) and the selected data entery is not changed. Maybe some out there has ran into this and can give me some advice.Sub UpdatePaid(ByVal o As Object, ByVal e As EventArgs) Dim i As Integer For i = 0 To MyList.Items.Count - 1 Dim Add As CheckBox = CType(MyList.Items(i).FindControl("Add"), CheckBox) If Add.Checked = True Then Dim ListingID As Label = CType(MyList.Items(i).FindControl("callID"), Label) Try If Add.Checked = True Then UpdatePayment(CInt(ListingID.Text)) End If Catch MyError.Text = "There has been a problem with one or more of your inputs." End Try End If Next End Sub Protected Sub chkCheckAll_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim chkCheckAll As CheckBox = CType(sender, CheckBox) For RowCount As Integer = 0 To MyList.Items.Count - 1 CType(MyList.Items(RowCount).Cells(0).FindControl("Add"), CheckBox).Checked = chkCheckAll.Checked Next End Sub<asp:DataGrid id="MyList" BorderColor="black" GridLines="Vertical" cellpadding="4" cellspacing="0" ShowFooter="true" AutoGenerateColumns="false" runat="server"> <FooterStyle font-size="Smaller" BackColor="#A3EB85" forecolor="Black"></FooterStyle> <HeaderStyle font-size="Smaller" BackColor="#A3EB85" forecolor="Black"></HeaderStyle> <ItemStyle font-size="Smaller" BackColor="White" forecolor="Black"></ItemStyle> <Columns> <asp:TemplateColumn headertext="ID"> <ItemTemplate> <asp:Label id="callID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "callID") %>' /> </ItemTemplate> </asp:TemplateColumn> <asp:BoundColumn HeaderText="First Name" DataField="callerFName" /> <asp:BoundColumn HeaderText="Last Name" DataField="callerLName" /> <asp:BoundColumn HeaderText="Company" DataField="callerCompany" /> <asp:HyperLinkColumn HeaderText="Invoice" text="Invoice" DataNavigateUrlField="callID" DataNavigateUrlFormatString="Invoice_Print.aspx?callID={0}" /> <asp:TemplateColumn HeaderText="Add"> <HeaderTemplate> <asp:CheckBox AutoPostBack = "true" ID = "chkCheckAll" runat = "server" OnCheckedChanged = "chkCheckAll_CheckedChanged"/> </HeaderTemplate> <ItemTemplate> <center> <asp:CheckBox id="Add" runat="server" /> </center> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid>
  2. Thnak you I tried the if then and it didn't work. I tried to convert the path to make it look like it was the base path to the script but that coused a different problem so I know it would not work.
  3. I am new at using php with managing file systems so here goes. I have been tring to create a application that a user logs in and they have access to there files only. Now creating the customer account and asigning a folder is done and working fine. I the problem I am having is using a file management system that will let the user navagate there particular directory. I have set it up that they can create folders in there directory and upload files. The Folder navagation is got me in a bind. I have looked at different folder navagation applictions but nothing realy fits the bill. I have l worked with phpfe and microFileBrowser and just cannot figure out how to limit the access of the file tree to there fileExampleuser file /farm/$userID/ //userID is the folder name for the user which is based on the $_SESSION_ID I need that to be the place where the file exploring stops they cannot have access to /farm or /this is the code the filmanger I have altereed for microFileManager. Like I said I am new with file management in php but the database portion of the application works just like I want it to. This page does open up to theright folder but the users still can navigate up to the /farm/ and / where they cannot <?php//*****************************************************************************//// MICRO FILE BROWSER - Version: 1.0//// You may use this code or any modified version of it on your website.//// NO WARRANTY// This code is provided "as is" without warranty of any kind, either// expressed or implied, including, but not limited to, the implied warranties// of merchantability and fitness for a particular purpose. You expressly// acknowledge and agree that use of this code is at your own risk.////*****************************************************************************//lookup users for the security system and to provide the userIDrequire_once('auth.php');require "Config.php";// like i said, we must never forget to start the sessionsession_start();$userID = $_SESSION['SESS_MEMBER_ID'];$pwdb = mysql_connect($dbhost,$dbuser,$dbpass) or die("Unable to connect to $db"); mysql_select_db($db) or die("Unable to select $db"); $result = mysql_query("select name from acct where id='$userID'"); while($row = mysql_fetch_array($result)) { foreach ($row as $value) { } }function showContent($path){ if ($handle = opendir($path)) { $up = substr($path, 0, (strrpos(dirname($path."/."),"/"))); echo "<tr><td colspan='2'><img src='style/up2.gif' width='16' height='16' alt='up'/> <a href='".$_SERVER['PHP_SELF']."?path=$up'>Up one level</a></td></tr>"; while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $fName = $file; $file = $path.'/'.$file; if(is_file($file)) { echo "<tr><td><img src='style/file2.gif' width='16' height='16' alt='file'/> <a href='".$file."'>".$fName."</a></td>" ."<td align='right'>".date ('d-m-Y H:i:s', filemtime($file))."</td>" ."<td align='right'>".filesize($file)." bytes</td></tr>"; } elseif (is_dir($file)) { print "<tr><td colspan='2'><img src='style/dir2.gif' width='16' height='16' alt='dir'/> <a href='".$_SERVER['PHP_SELF']."?path=$file'>$fName</a></td></tr>"; } } } closedir($handle); } }$userpath = "./farm/$userID/"; // This is my modificitionif (isset($_POST['submitBtn'])){ $actpath = isset($_POST['path']) ? $_POST['path'] : '.'; } else { $actpath = isset($_GET['path']) ? $_GET['path'] : "$userpath"; //Where $userpath there was a . }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"><html><head> <title>Micro File Browser</title> <link href="style/style.css" rel="stylesheet" type="text/css" /></head><body> <div id="main"> <div class="caption">MICRO FILE BROWSER</div> <div id="icon"> </div> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="path"> <table width="100%"> <tr><td>Path: <input class="text" name="path" type="text" size="40" value="<?php echo $actpath; ?>" /></td></tr> <tr><td align="center"><br/><input class="text" type="submit" name="submitBtn" value="List content" /></td></tr> </table> </form><br/> <div class="caption">ACTUAL PATH: <?php echo $actpath ?></div> <div id="icon2"> </div> <div id="result"> <table width="100%"><?php showContent($actpath); ?> </table> </div> <div id="source">Micro File Browser 1.0</div> </div></body>
  4. defiant1970

    Mkdir

    Thank you very much that was the ticketmakeing this file system browser is a pane in the but
  5. defiant1970

    Mkdir

    thank you But there must be something Iam missing I even tried<form enctype="multipart/form-data" action="" method="post"> <input type="text" name="FileName" /> <input type="submit" value="CreateFile" /> </form> <?php $NewFolder = ($_POST["FileName"]); $target_path = "/farm/$userID/$NewFolder"; mkdir($target_path, 0755); ?>the closest I got it to work is add a folder in the admin folder which is where the script is running
  6. defiant1970

    Mkdir

    <form enctype="multipart/form-data" action="" method="post"> <input type="text" name="FileName" /> <input type="submit" value="CreateFile" /> </form> <?php $target_path = "/farm/$userID/"; $NewFolder = ($_POST["FileName"]); mkdir("$target_path" & "/" & "$NewFolder" ,0755); ?>This what I have tried now still no luck
  7. defiant1970

    Mkdir

    Thank you for your replyIf this is a mistake then what am I doing wrong???All the documention I have found it wrote the file right from the function
  8. defiant1970

    Mkdir

    Hello again I am tring to make a directory from my page and I have tried a few different ways without any luck.Here is my code I hope someone can make heads or tails out of it <form enctype="multipart/form-data" method="post"> <input type="text" name="FileName" /> <input type="submit" value="CreateFile" /> </form> <?php $target_path = "farm/$userID/"; $NewFolder = ($_POST["FileName"]); mkdir($target_path/$NewFolder ,2); ?>the $userID is the person who is login and the ID is also the name of there folder in the farm. I have a file listing app ant it works with "farm/$userID/"
  9. defiant1970

    Php And Mysql

    thank you for your responce I did find out what my problem <?php ini_set('display_errors', 1); error_reporting(E_ALL); require "Config.php"; mysql_connect($dbhost,$dbuser,$dbpass) or die("Unable to connect to $db"); mysql_select_db($db) or die("Unable to select $db"); $result = mysql_query("select * from temp"); while($row = mysql_fetch_array($result)) { foreach ($row as $key=>$value) { echo "$key = $value<br/>\n"; } } mysql_free_result($result); mysql_close(); ?>I put the echo in the wrong place I was tring to output it to a differant <?php ?> I changed to location and it worked
  10. defiant1970

    Php And Mysql

    Thank you for your responce the Config.php is capthis is the revised code for the page <?php echo "php runs first!"; ?> <?php require "Config.php"; $pwdb = mysql_connect($dbhost,$dbuser,$dbpass) or die("Unable to connect to $db"); mysql_select_db($db) or die("Unable to select $db"); $result = mysql_query("select * from site_users"); while($row = mysql_fetch_array($result)) { foreach ($row as $value) { } } ?> <?php echo "$value"; ?>I still have a blank page excet the php runs first
  11. defiant1970

    Php And Mysql

    Ok here I am again I have just put togeather my own webserver win 2003 with php and mysql and I am not getting any data showing up from my data basethis is simple data retreval that I can think of but when I load the page it is blank except "php runs first!"index.php ----------------------------<table><tr><td> <?php require "Config.php"; echo "php runs first!"; ?> <br></br> <?php$pwdb = mysql_connect($dbhost,$dbuser,$dbpass) or die("Unable to connect to $db"); mysql_select_db($db) or die("Unable to select $db"); $result = mysql_query("select * from site_users"); while($row = mysql_fetch_array($result)) { foreach ($row as $value) { } } ?> <?php echo "$value"; ?></td></tr></table>--------------------------------------------------------------------------------config.php------------------------------<?php// Config.conf// config file// Edit the information below to match your.// mySQL database$dbhost = "localhost"; // Host name$dbuser = ""; // Database username$dbpass = ""; // Database password$db = "mailist"; // Database name;$dbgtbl = "acct"; // Name of acct table// other information$sitetitle = "HR Consulting"; // Name of your web site$newpage = "html.newpage" // newpage?>------------------------------
  12. defiant1970

    Php.ini

    that was the problem thank you I have other problems with the site but that is some thing else
  13. defiant1970

    Php.ini

    the site.php was using short tags and when I switch over to long tags the the site was shut down is this setting in the php.ini?
  14. defiant1970

    Php.ini

    this site works fine on the production server just not on the my devlopment server
×
×
  • Create New...