Jump to content

conan318

Members
  • Posts

    195
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

conan318's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. the problem is with the feed function. the error from the console is SyntaxError: missing ) after argument list [break On This Error] feed(Singleton Visitor Information Centre) is the problem with the white spaces in the feed argument? marker.openInfoWindowHtml(style + '<a href='+ web.nodeValue +' >'+ name.nodeValue +'<\/a> <br> <a href="javascript:feed('+name.nodeValue+')"> Leave Feedback<\/a><br><hr><a href="http://www.cvisinko.cessnock-ict"><img src="images/conan2.png" style="position: absolute;margin-top: -2px; margin-left: -15px;"></a><p style="margin-left:70px;"><br> </p>');
  2. cheers jquey has solved my issue
  3. i have never used jquery b4.. do I need to download a library to use it?
  4. the div fades in and out once but if i press the button again it wont fade div a second time... <script type="text/javascript"> var fadeEffect=function(){ return{ init:function(id, flag, target){ this.elem = document.getElementById(id); clearInterval(this.elem.si); this.target = target ? target : flag ? 100 : 0; this.flag = flag || -1; this.alpha = this.elem.style.opacity ? parseFloat(this.elem.style.opacity) * 100 : 0; this.si = setInterval(function(){fadeEffect.tween()}, 50); }, tween:function(){ if(this.alpha == this.target){ clearInterval(this.si); }else{ var value = Math.round(this.alpha + ((this.target - this.alpha) * .01)) + (1 * this.flag); this.elem.style.opacity = value / 100; this.elem.style.filter = 'alpha(opacity=' + value + ')'; this.alpha = value } } } }(); </script>
  5. try this 200kb upload limit. just adjust the upload limit to suite your needs. $errorIndex = $_FILES['myfile']['size']; if ($errorIndex <= 200000){ echo 'no errors.'; } elseif ($errorIndex != 0){ die("No file was selected."); }else{ die("upload file is to large."); }
  6. basicly i have a timer counting down when timer reaches 0 i need to call a function to update my database. is it possible to call a function if $difference < 0. Parse error: syntax error, unexpected ';' $timer_html = '<span style="position:absolute;top:110px;right:0px;padding:2px;">Time Left %s</span>'; printf($timer_html, ($difference < 0 ? win(); : ( floor($difference / 3600) . ':' . floor(($difference % 3600) / 60) . ':' . ($difference % 60))));
  7. i am trying to disable the scroll bar on the body of my page if responseText!=null <script language="javascript" type="text/javascript"> <!-- //Browser Support Code function rej5(id){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('leftproject'); ajaxDisplay.innerHTML = ajaxRequest.responseText; if(ajaxRequest.responseText!=null){ document.getElementById('body').style='overflow:hidden' } } } var queryString = "&id=" + id ; ajaxRequest.open("GET", "ajax-example.php?order=22" + queryString, true); ajaxRequest.send(null); } //--> </script>
  8. never mind forgot to upload the updated upload.php file to the server
  9. I am writing a file upload form the file uploads works fine. however i also need to a jobnumber which is in a hidden field which i cant seem to send the value along with it any help would be great thanks. form.php <script language="javascript" type="text/javascript"> function init() { document.getElementById('uploadedfile').onsubmit=function() { document.getElementById('uploadedfile').target = 'upload_target'; //'upload_target' is the name of the iframe document.getElementById('jobnumber').value.target = 'upload_target'; } } window.onload=init; </script> <form id="uploadedfile" method="post" enctype="multipart/form-data" action="upload.php"> <input type="hidden" name='jobnumber' value="<?php echo uniqid() ?>" /> <input name="uploadedfile" id="uploadedfile" size="27" type="file" /><br /> <input type="submit" name="action" value="Upload" /><br /> <iframe id="upload_target" name="upload_target" src="" ></iframe> </form> upload.php $id=$_POST['jobnumber']; if ($_FILES['uploadedfile']['size']!= 0) $ext_a = explode(".", $_FILES['uploadedfile']['name']); $ext = $ext_a[1]; if ( ($ext!=="zip" && $ext!=="ZIP" && $ext!=="zip" && $ext!=="ZIP" )){ echo "Error IMAGES MUST BE EITHER PNG, GIF OR JPG "; echo "<a href='gal.php'>Go back</a>"; die; }else{ /* hashes the file name with the date and time to genrate a uniue file name*/ $img=md5($_FILES['uploadedfile']['name'] . date("m.d.y H:m:s")) . "." . $ext; $target_path = "../testup/"; $target_path = $target_path .basename($img); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". $img; echo"<br>"; echo $id; }else{ echo "Sorry your password does not match"; }} ?>
  10. just did a var_dumb of the $openssl_cmd string '(c:\wamp\bin\apache\Apache2.2.21\bin\openssl.exe mime -sign -signer c:\wamp\www\freelance-pacific\pubcert.pem -inkey c:\wamp\www\freelance-pacific\prvkey.pem -outform der -nodetach -binary <<_EOF_ cmd=_xclick business=payments@freelance-pacific.com cert_id=TY3BA373455JS6 lc=AU custom=158 invoice=freelance-pacific currency_code=AUD no_shipping=1 item_name=freelance-pacific item_number=1 amount=104.99 bn=StellarWebSolutions.PHP_EWP2 _EOF_ ) | c'... (length=650) var_dump on $output array empty var_dum on $error int 1
  11. sorry left some of the code out. exec($openssl_cmd, $output, $error); if (!$error) { return implode("\n",$output); } else { return "ERROR: encryption failed"; }
  12. Hi i am running a wamp server on windows 7 i am trying to php exec command to run a command but the output returns 1 does this mean the cmd failed to execute ? $openssl_cmd = "($OPENSSL mime -sign -signer $MY_CERT_FILE -inkey $MY_KEY_FILE ". "-outform der -nodetach -binary <<_EOF_\n$data\n_EOF_\n) | " . "$OPENSSL smime"." -encrypt -des3 -binary -outform pem $PAYPAL_CERT_FILE";
  13. Hi i have php script which i have been running on on my web server which is dreamhost which is working fine... but here's the twist i have just set-up a xampp server apache 2.2 on my windows 7 machine my website is running fine expect for the openssl encrypt script which is filing to encrypt here's a sample of my code. $MY_KEY_FILE = "c:\\xampp\\apache\\bin\\my-prvkey.pem"; # public certificate file to use $MY_CERT_FILE = "c:\\xampp\\apache\\bin\\my-pubcert.pem"; # Paypal's public certificate $PAYPAL_CERT_FILE = "c:\\xampp\\apache\\bin\\paypal_cert_pem.txt"; # path to the openssl binary $OPENSSL = "c:\\xampp\\apache\\bin\\openssl.exe"; $form = array('cmd' => '_xclick', 'business' => 'removed business name for security ', 'cert_id' => 'removed cert id for security', 'lc' => 'AU', 'custom' => ''.$id.'', 'invoice' => removed business name for security', 'currency_code' => 'AUD', 'no_shipping' => '1', 'item_name' => 'removed business name for security', 'item_number' => '1', 'amount' => $total ); $encrypted = paypal_encrypt($form); function paypal_encrypt($hash) { //Sample PayPal Button Encryption: Copyright 2006-2010 StellarWebSolutions.com //Not for resale - license agreement at //http://www.stellarwebsolutions.com/en/eula.php global $MY_KEY_FILE; global $MY_CERT_FILE; global $PAYPAL_CERT_FILE; global $OPENSSL; if (!file_exists($MY_KEY_FILE)) { echo "ERROR: MY_KEY_FILE $MY_KEY_FILE not found\n"; } if (!file_exists($MY_CERT_FILE)) { echo "ERROR: MY_CERT_FILE $MY_CERT_FILE not found\n"; } if (!file_exists($PAYPAL_CERT_FILE)) { echo "ERROR: PAYPAL_CERT_FILE $PAYPAL_CERT_FILE not found\n"; } //Assign Build Notation for PayPal Support $hash['bn']= 'StellarWebSolutions.PHP_EWP2'; $data = ""; foreach ($hash as $key => $value) { if ($value != "") { //echo "Adding to blob: $key=$value\n"; $data .= "$key=$value\n"; } } // here's where i believe the problem is when creating and signing the my_cert_file i had to specify where the openssl.cnf file was do i need to do same here.. -config c:\\xampp\\apache\\bin\\openssl.cnf $openssl_cmd = "($OPENSSL smime -sign -signer $MY_CERT_FILE -inkey $MY_KEY_FILE " . "-outform der -nodetach -binary <<_EOF_\n$data\n_EOF_\n) | " . "$OPENSSL smime -encrypt -des3 -binary -outform pem $PAYPAL_CERT_FILE"; exec($openssl_cmd, $output, $error); if (!$error) { return implode("\n",$output); } else { return "ERROR: encryption failed"; } echo $output; };
  14. is my go at using ajax so bare with me as get my head around it. ok im new to world of ajax. iam trying to make a small one on one help chat. if 2 users are in the chat anyone after that gets put into a queue. when the admin end the chat i have function which removes the other user from the chat and from queue table in my mysql database. that part works fine. i have a second function running on a javascript timer which updates queue. so then i am trying to redirect the user that is next in line depending on the response. if response text == 1 redirect that user into the chat room. ajax <script language="javascript" type="text/javascript"> function updateq(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajax'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } if(ajaxDisplay.innerHTML == "1"){ window.location.replace="chat.php"; exit; } } var queryString = "?update=queue"; ajaxRequest.open("GET", "ajax-chat.php" + queryString , true); ajaxRequest.send(null); } //--> </script> ajax-chat.php if ($update=="queue"){ $result = mysql_query("SELECT * FROM q"); $num_rows = mysql_num_rows($result); if ($num_rows >2){ echo "Welcome ".$_SESSION['myusername']." there are ".$num_rows." people ahead of you in the queue"; }else{ echo "1"; } } let me know if you need more info
  15. <script language="javascript" type="text/javascript"> function updateq(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajax'); ajaxDisplay.innerHTML = ajaxRequest.responseText; if ajaxRequest.responseText == '1'{ window.location = 'chat.php' } } } var queryString = "?update=queue"; ajaxRequest.open("GET", "ajax-chat.php" + queryString , true); ajaxRequest.send(null); } //--> </script>
×
×
  • 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.