Jump to content

$username

Members
  • Posts

    159
  • Joined

  • Last visited

    Never

Everything posted by $username

  1. I ran into an issue running cmds through shell_exec. When you trigger a shell_exec it will open the exe as the Apache service user. By default Apache installs as a local system account. So if you need to connect to a remote server to run a cmd it will hang in the task manager. example shell_exec("psexec \\\\remoteComputer -i -d -s dnscmd /zoneadd domain.com /primary") When a cmd needs to access other servers you will need to make the Apache service run as a user that has access to other remote servers. http://httpd.apache.org/docs/2.2/platform/windows.html See the section about running Apache as a service This may not work for all cases but it seems to work for my issues when running cmds that needed more privileges -Brett
  2. Found it!! $str = '312.test.com'; echo substr_count($str, "."); This will return the number of times it is in the string,.
  3. If I am am now looking to count the number of '.' and if there is only 1 I would bypass the $trimed = substr($strg, strpos($strg,'.')+1); How can I count the '.' in a string? Thanks, Currently looking in php docs.
  4. Damn that is awesome... I would have never got that +1 Thanks!
  5. Hello All, So I am stuck and not sure what function would work best for my case. I have this value $strg = "test.example.com"; I want to remove the 'test.' from the string so that it is just 'example.com' I started to look at ltrim function. But I am not sure how I would read it from left to right till it got to the first '.'. $trimmed = ltrim("test.example.com", " '"*".'); If you have any help or a better way please let me know.. Thanks
  6. Hey Guys, I am a little lost at this. I want to check to make sure the @ symbol is in the string. Here is what I have } else if($submit && empty($ContactEmail) && strspn('@', $ContactEmail)) { echo "<h4>You need to enter Email</h4> <br /> <a href=\"javascript:history.go(-1)\" onMouseOver=\"self.status=document.referrer;return true\">BACK</a> "; This does nothing. It just goes to the next string. Is there a better way to check for a character Thanks,
  7. Thanks F1Fan that is what I was looking for. Brett
  8. onClick is java. Try doing a search on this to see if it could help you. Brett
  9. Hello All, I am trying to find out how to display text from MySQL that was entered by using a textbox HTML So when I do a echo echo from a database field that had text entered from a text field it does not add the spaces and return lines. But when I echo it in to a html text box it does display the return characters. Does this makes sence and is there a way to make this work? Thanks Brett
  10. I want the value of $MsgBody = to echo "<table>"; while($row589 = mysql_fetch_array($sql589)) { echo "<tr>"; echo "<td>".$row589['PaymentInvoiceID']."</td>"; echo "<td>".$row589['PaymentDueDate']."</td>"; echo "<td>".$row589['PaymentPaid']."</td>"; echo "<td>".$row589['PaymentAccountID']."</td>"; echo "</tr>"; } echo "</table>";
  11. Hello All, I am setting up some email sending with PHP pulling info from MySQL. I have one question on how to make the message body. Here is the code I have. What is the key to getting the PHP loop to be equal to a value. $ToMail = 'bjanzen@nextechworks.com'; $MsgSubject = "Daily Invoices Due"; $MsgBody = ( echo "<table>"; while($row589 = mysql_fetch_array($sql589)) { echo "<tr>"; echo "<td>".$row589['PaymentInvoiceID']."</td>"; echo "<td>".$row589['PaymentDueDate']."</td>"; echo "<td>".$row589['PaymentPaid']."</td>"; echo "<td>".$row589['PaymentAccountID']."</td>"; echo "</tr>"; } echo "</table>" );
  12. New Code But new error <?php include 'dbconnect.php'; $sql = "SELECT * FROM DBM350_FGFAXOUT WHERE MSN = '22'"; $result = maxdb_query($link, $sql) or die(maxdb_error()); list($DIST_FILE) = maxdb_fetch_array($result); header("Content-Disposition: attachment; filename=test"); header("Content-length: 55"); header("Content-type: tif"); Echo "$DIST_FILE"; ?> <br /> <b>Warning</b>: maxdb_fetch_array() [<a href='function.maxdb-fetch-array'>function.maxdb-fetch-array</a>]: Column/Parameter 111 truncated. in <b>C:\Inetpub\wwwroot\work\dl.php</b> on line <b>7</b><br />
  13. Hello All, I am working on a extracting info from maxdb. Right now I would like to test this to see if I can build something to view info in this database. There is this field called "DIST_FILE" This a long byte column in maxdb. To my knowledge this is in b64 encoding. //select the info $sql = maxdb_query("SELECT DIST_FILE FROM DBM350_FGFAXOUT WHERE MSN = '22'"); $file = maxdb_fetch_assoc($sql); //decode the field $filedl = base64_decode($file); //Set header for download header("Content-Disposition: attachment; filename=test"); echo "$filedl"; Does this look even close to something to download the data? Thank you, Brett
  14. So after hours have gone by I have found out that there is something with PHP and not calling the page directly. In my index.php file I have a line of code looks like this $DownloadAttachment = $_GET['dlattachment']; if ($DownloadAttachment == 1) { include_once 'downloadattachments.php'; }else{ echo ""; } So the URL that downloads the code is index.php?dlattachment=1&attlink=account&typeid=2008071433605000000&attachid=7 So when I made the URL work like this downloadattachments.php?dlattachment=1&attlink=account&typeid=2008071433605000000&attachid=7 It downloads the file just fine. I think that is crazy but it worked. I dont know if this is a bug or not. I am more so thinking that its my sloppy code. Thanks for your input. I am currently reading about base64 code. Thank you, Brett
  15. Hello All, I have been working on uploading files to MySQL and than retrieving them. They upload fine. But when I go to download them it seems to add extra info to the file. The code seems to be the first 31 lines of my index page. The code below is what I use to gather the BLOB from MySQL. Is there something wrong with this? Any help would greatly be appreciated. include 'dbopen.php'; include 'dbconnect.php'; if(isset($_GET['attachid'])) { $AttachID = $_GET['attachid']; $query611 = "SELECT AttachName, AttachType, AttachSize, AttachContent FROM attachments WHERE AttachID = '$AttachID'"; $result611 = mysql_query($query611) or die(mysql_error()); list($AttachName, $AttachType, $AttachSize, $AttachContent) = mysql_fetch_array($result611); header("Content-Disposition: attachment; filename=$AttachName"); header("Content-length: $AttachSize"); header("Content-type: $AttachType"); echo "$AttachContent";
  16. One thing that you could look for would be a javascript that can save it and launch a app such as notepad. But thats all I got for you. Brett
  17. Might want to try something like this $sql = "insert into clients (clientid) values ('$client_id'')"; make sure the field is listed than the value Brett
  18. I do not know a way with out user interaction such as a download link. Brett
  19. Well you got my attention. So so I understand the story You scan one bar code. That populates a form on a web page. From there you want it to go to the next field. The only thing I could say would be to look for java script that after to field is filled to go to next. might want to check this out too.... http://www.w3schools.com/JS/tryit.asp?filename=tryjs_autonext Brett
  20. What I do to make things fast for programing is add the states to a table in mysql. Like this StateFullName |StateAb | StateID ALABAMA |AL | 1 From there I just do a query on the tables and pull back what is needed. <tr> <td><strong>State:</strong></td> <td> <select name=\"AccountState\" size=\"1\">"; $sql149 = "SELECT StateFullName, StateAb FROM states"; if ($result149 = mysql_query($sql149)) { while ($row149 = mysql_fetch_assoc($result149)) { $selected = ($row149['StateAb']==$Wisconsin)?" selected=\"selected\"":""; echo "<option value=\"{$row149['StateAb']}\"{$selected}>{$row149['StateFullName']}</option>"; } } echo " </select> </div></td> </tr>
  21. Ok well due to me not knowing what I am looking for yet I cannot provide to much code. But I think what I am looking for is something like this. function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } Example Addinfo page Please select the category When you click it takes you to selection page where you have the links that you want to add to addinfo page but how do I get the selection info passed back to addinfo field? Thank you, Brett
  22. Hello All, I am working on getting a form field filled by using a popup for the selection. I am looking for code examples that work for opening a page than once an item is selected it will fill a field on a form. so far I have the window to open but I do not understand how to get the info in to the form. Its like how pop up calenders work. But with SQL data. Hope this is understandable. Brett
×
×
  • 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.