Jump to content

new_php85

Members
  • Posts

    56
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

new_php85's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi everyone.... I have some issue... There is document which is VBA word 2010. When someone open / click the document, some information (ip address, computer detail. hash code etc..) should be consume by php. I have no idea how php can help. anyone have idea. thanks in advance... Here is some code for VBA Dim appWord As New appWord Private Sub Document_Open() Set appWord.appWord = Word.Application Set appWord.appWord = Word.Application Call FirstTime Call Show Call Test("1") Call DisableCopy Call PrepareHistory Call TrySendPastData End Sub Private Sub Document_Close() Call Test("2") Call Hide ActiveDocument.Save End Sub Private Sub Register_Event_Handler() Set appWord.appWord = Word.Application End Sub Private Sub Test(activity As String) On Error GoTo SkipTest Dim result As String Dim myURL As String, postData As String Dim winHttpReq As Object Dim sHostName As String Dim sUserName As String Dim ldap As String Dim md5 As String Dim p As String Dim rw As String rw = "" 'Cw.GetBssid sHostName = Environ$("userdomain") sUserName = SafeString(Application.UserName & "|" & Environ$("username")) Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1") ldap = Inpho.GetLDAPUserName() & "|" & Inpho.GetLocalDomainUserName() md5 = Evaluate(Inpho.GetCleanName() & ldap & sHostName & sUserName) myURL = "http://localhost/test2.php" postData = "key=" & ActiveDocument.Variables("documentid") & "&a=" & activity & "&info=" & SafeString(Inpho.GetCleanName()) & "&d=" & sHostName & "&u=" & sUserName & "&i=" & SafeString(md5) & "&p=" & SafeString(Inpho.GetSerial()) & "&w=" & SafeString(rw) winHttpReq.SetTimeouts 2000, 2000, 2000, 2000 winHttpReq.Open "POST", myURL, False winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded" winHttpReq.Send (postData) If winHttpReq.Status = "404" Then Call HisStory(md5, activity) Exit Sub End If SkipTest: Call AddToDataId(postData) Call HisStory(md5, activity) End Sub
  2. Hye experts! Good day to you. I have refer to many references but still got same error. one of my reference is http://www.phpfreaks.com/forums/index.php?topic=180250.msg803886#msg803886 here is my code <?php session_start(); include 'includes/db_connect.php'; include 'phpmailer/class.phpmailer.php'; include 'phpmailer/class.smtp.php'; $title="Application for Venue Change"; $subject=$title; $name=$_REQUEST["name"]; $to="xxxx@xxxxx.edu.my";//my office email $content="This is to inform you that ".$name." has send Application for Venue Change."; $content=$content."\n\nSTUDENT INFORMATION :-"; $content=$content."\n\nName : ".$name; $content=$content."\nStudent No.: ".$_REQUEST["student_no"]; $content=$content."\nClass : ".$_REQUEST["classes"]; $content=$content."\n\nPlease go to http://xxx.xx.xxx.xx/AVC_VT/default.php for necessary action."; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "smtp.gmail.com"; $mail->AddAddress($to); $mail->From = $_REQUEST["name"]; $mail->FromName =$name; $mail->Subject =$subject; $mail->Body = $content; $mail->WordWrap = 1000; if(!$mail->Send()){echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit;} else{echo "<script language='JavaScript'> alert('success.');</script>";} ?> Based on information above which is Language folder, I also include them into my server. (Download php mailer and put them into server) I only change class.phpmailer.php and class.smtp.php to configure my : 1. host 2. port 3. username 4. password my path for php mailer is AVC_VT/phpmailer did i miss something. thank you
  3. HI guys i got. its because of permission. i just right click the folder at ftp and give full permission on that.. that to all of u..really appreciate
  4. ya...not success it came out with this "File failed to upload". why ya??
  5. here is my path for upload folder var/www/crm_VT/upload that why i put double slashes. $result=move_uploaded_file($_FILES["file"]["tmp_name"], "upload//" . $_FILES["file"]["name"]); however i, change also my code into these $result=move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); and $result=move_uploaded_file($_FILES["file"]["tmp_name"], "upload" . $_FILES["file"]["name"]); and $result=move_uploaded_file($_FILES["file"]["tmp_name"], $_FILES["file"]["name"]); all not works. but success at localhost
  6. Its from JS function here the code <script language="javascript"> function addEdit() { var file=document.form1.file.value; var remarks=document.form1.remarks.value; var do_done=""; if(file=="" || remarks=="") { alert("Please fill in all field remarked (*)."); do_done='N'; } else { var x=document.getElementById("form1"); x.action="attachment.php?xtvt=addEdit"; x.target="_self"; x.submit(); } } </script> All sql are works except this part $result=move_uploaded_file($_FILES["file"]["tmp_name"], "upload//" . $_FILES["file"]["name"]); if (!$result) { echo "Error uploading file"; }
  7. Here is my form <form name="form1" id="form1" action="" method="post" enctype="multipart/form-data"> <table width="625" border="0"> <tr> <td width="78">Select File <span class="style1">*</span></td> <td width="5">:</td> <td width="539"><input type="file" name="file" id="file"/></td> </tr> <tr> <td>Remarks <span class="style1">*</span></td> <td>:</td> <td><pre><textarea name="remarks" id="remarks" cols="45" rows="3"></textarea></pre></td> </tr> <tr> <td> </td> <td> </td> <td><input type="reset" id="bttnReset" name="bttnReset" value="Reset" onclick="Reset()"/> <input type="button" id="bttnAdd" name="bttnAdd" value="Add" onclick="addEdit()"/></td> </tr> </table> </form>
  8. What do you means by that? Actually I don't know how to check either that folder give me full access or not because it located at linux server. i don't have any experience on that. please advice. and
  9. Sorry, missed out to explain. there are no file uploaded into folder upload.
  10. Hi Guys I don't why it happen. probably i missed out something. Here is my code. <?php if($_REQUEST["xtvt"]=="addEdit") { $sql02="INSERT INTO attachment (remarks, attached_by, attached_date) VALUES('".$_REQUEST["remarks"]."', '".$_SESSION["SESSION_ID"]."', now())"; $res02=mysql_query($sql02); //--------- attach file ---------------------------- $name = $_FILES["file"]["name"]; if ($name != "") { $selectDB="SELECT max(id) AS id FROM attachment"; $qryDB= @$res1=mysql_query($selectDB); $fetchDB=mysql_fetch_array($qryDB); $maxid=$fetchDB[0]; $result=move_uploaded_file($_FILES["file"]["tmp_name"], "upload//" . $_FILES["file"]["name"]); if (!$result) { echo "Error uploading file"; } $update_faultLog = "UPDATE attachment SET attachment='$name' WHERE id='$maxid'"; $res1=mysql_query($update_faultLog); } } ?> <table width="625" border="0"> <tr> <td width="78">Select File <span class="style1">*</span></td> <td width="5">:</td> <td width="539"><input type="file" name="file" id="file"/></td> </tr> <tr> <td>Remarks <span class="style1">*</span></td> <td>:</td> <td><pre><textarea name="remarks" id="remarks" cols="45" rows="3"></textarea></pre></td> </tr> <tr> <td> </td> <td> </td> <td><input type="reset" id="bttnReset" name="bttnReset" value="Reset" onclick="Reset()"/> <input type="button" id="bttnAdd" name="bttnAdd" value="Add" onclick="addEdit()"/></td> </tr> </table> Its work at localhost but not when i put at server... please help me... Thank You
  11. Actually once i go direct to the page I set $_SESSSION["SESSION_CURSOR"]=""; when page start works on JS which is at onblur="checkAvaib()" i update $_SESSSION["SESSION_CURSOR"]=1; on html its look like :- <input type="text" name="location" id="location" maxlength="10" value="<?php echo $_REQUEST["location"];?>" tabindex="<?php if($_SESSSION["SESSION_CURSOR"]==1){echo "14";} else {echo "false";}?>"/> <input type="text" name="user_id" id="user_id" maxlength="10" value="<?php echo $_REQUEST["user_id"];?>" onblur="checkAvaib()" tabindex="15"/> <input type="text" name="name" id="name" value="<?php echo $_REQUEST["name"];?>" tabindex="16"/> Before this, after page refresh, the tab going to the location but now its going to the name. This not a really good solution. its better do in Ajax. for me its takes time to change the whole code into ajax but i i'll change it next time.
  12. Actually its more on cursor position. but usually when i works on data entry i use TAB at keyboard to move the cursor. thats y i call tab position. Sorry if this post confusing u. actually i got one solution. but i thinks is not a good solution. By using $_SESSION the cursor position remain to the next field/tab. If i hv better solution, please be free to share. thank you...
  13. Hi guys.. sorry if I wrong placed the topic. I'm not sure is it under HTML or JS. I have problem with my tab position after refresh my page. Here is JS function checkAvaib() { var x=document.getElementById("form"); x.action="student_new.php"; x.target="_self"; x.submit(); } Here is HTML <input type="text" name="user_id" id="user_id" maxlength="10" value="<?php echo $_REQUEST["user_id"];?>" onblur="checkAvaib()" tabindex="15"/> <input type="text" name="name" id="name" value="<?php echo $_REQUEST["name"];?>" tabindex="16"/> When I start enter at user_id field and then tab to the next field(name). It will refresh the page and tab position going to the first tab. Is it possible to point the tab to the next tab after refresh? Thanks in advance.
  14. i got the problem it suppose like this if($_REQUEST["rFormat"]=="2") { header("Content-Type: application/x-msexcel"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Disposition: attachment; filename=email_sms_export.xls");// i missed out this link } now its works on IE/FF/Google Chrome
×
×
  • 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.