Jump to content

Stefany93

Members
  • Posts

    261
  • Joined

  • Last visited

Everything posted by Stefany93

  1. Personally I dislike any ready-made systems because it takes more time to tweak them than doing everything from scratch. But in your case, I'd recommend to read a book about a particular CMS and that way you will no longer have to google everything. I did that with WordPress, I read a book about it, and now I develop websites on it faster without googling every damn thing.
  2. Howdy colleagues, Please help! I am writing a WP plugin the boss of the website to be notified when an admin logs in. So far so good, but I can't make the damn code to send the email when the user logs in. If I change the add_action to "admin_notices" the email is being sent, but if I put "wp_login" it does not Please help, here is the code so far... function _emnoti_get_time_of_login(){ $time_of_login = date('l F Y'); return $time_of_login; } # Get the IP of the user that logged themselves as admin function _emnoti_get_ip(){ $sources = array( 'REMOTE_ADDR', 'HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', ); foreach ($sources as $source) { if(!empty($_SERVER[$source])){ $ip = $_SERVER[$source]; } } return $ip; } # Email all the info above to a pointed email address function emnoti_send_email($user_login, $user){ if(_emnoti_check_if_admin() === true){ // print _emnoti_get_time_of_login(); // print _emnoti_get_ip(); wp_mail("MY EMAIL!", "Test subject", 'test body'); } } add_action('wp_login', 'emnoti_send_email', 10, 2); ?>
  3. Howdy colleagues, I have noticed some programmers re-declare their variables before using them. Like so: $name = ''; $name = 'Elizabeth'; First of all, why do they do that? Variables are being re-written with each "=" anyways. Secondly, do you believe this is better than just doing: $name = 'Elizabeth'; Thank you
  4. session_set_cookie_params(0); Remove this line. Also, you can disable the sessions on window unload using JS + AJAX.
  5. Here is a screenshot of what I am talking about - http://alfa.kachi-snimka.info/vij.php?id=klz1403022333d.PNG
  6. Howdy, I am trying to create my website responsive. So far so good, but I got this weird white space on the right of my website and the user that is on a device smaller for 800px get a weird scroll bar. You can see it for yourself here, if you shrink the viewport to 800px or less - http://dyulgerova.info/mobile_dyulgerova/ Here is my responsive CSS /* For 800 pixels wide screens, MAX WIDTH. For example, tablets */ @media all and (max-width: 800px){ /* All images */ img {width:15vw;} /* The header */ #header{ background: #ff0000; width:100vw; } #section{ width:100vw; } #SkypeButton_Call_age_of_empires3_1_paraElement{ display:none; } #header_contact{ position: absolute; top: 120px; left: 394px; } #logo{ margin-top:20px; margin-left:0; } .langs{ margin-top:54px; margin-right:50px; } /* The nav bar */ #header #navigation{ width:100vw; height: 6.5vw; position:fixed; top:-15px; background: #000; height:10; } #header #navigation a{ border-left:1px solid #ff0000; } /* Below the header */ #main_div{ width:80vw; } footer{ width:80vw; } } And here is my NON-RESPONSIVE CSS * {margin: 0px; padding: 0px; } body { color: #E0E0E0; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; background: #9C1C6B; background: -webkit-radial-gradient(center top, circle, rgba(0,0,0,.2), rgba(0,0,0,.4)) fixed no-repeat, -webkit-linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background: -moz-radial-gradient(center top, circle, rgba(0,0,0,1), rgba(0,0,0,1)) fixed no-repeat, -moz-linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background: -o-radial-gradient(center top, circle, rgba(0,0,0,1), rgba(0,0,0,1)) fixed no-repeat, -o-linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background: radial-gradient(center top, circle, rgba(0,0,0,1), rgba(0,0,0,1)) fixed no-repeat, linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background-size:contain, contain; } a, a:active, a:visited, a:hover{ color: #FFE9E8; } h3 { margin-bottom:20px; } #header a, #header a:active, #header a:visited, #header a:hover{ color: #000; text-decoration:none; } #header{ width:100%; height:100%; background-color:#FFF; border-bottom:#F00 3px ridge; margin-bottom:50px; background-color:#FFF; background: -webkit-linear-gradient(#F3F3F3, #f6f5f3); background: -moz-linear-gradient(#F3F3F3, #f6f5f3); background: -o-linear-gradient(#F3F3F3, #f6f5f3); background: linear-gradient(#F3F3F3, #f6f5f3); } #logo{ margin-left:200px; } #header #section{ color:#000; margin:auto; } #header #navigation{ width:1000px; height:40px; margin:auto; clear:both; } #header #navigation li a{ color:#999; border-bottom:rgba(0,0,0,0) 3px ridge; width:90px; line-height:40px; float:left; text-align:center; font-style:bold; font-weight:bold; transition:all .3s; -webkit-transition:all .3s; } #header #navigation li a:hover{ color:#222; border-bottom:#000 3px ridge; } /* Makes a navigation item bigger when applied the class */ .long_nav{ width: 176px; } footer a, footer a:active, footer a:visited, footer a:hover{ color: #FFF; text-decoration:none; } figure{ width:200px; height:133px; padding:10px; margin:10px; color:#000; text-align:left; font-size:12px; float:left; background: -webkit-radial-gradient(center top, circle, #FFFFFF, #DFDFDF); background: -moz-radial-gradient(center top, circle, #FFFFFF, #F3F3F3); background: -o-radial-gradient(center top, circle, #FFFFFF, #F3F3F3); background: radial-gradient(center top, circle, #FFFFFF, #DFDFDF); } ul { list-style-type: none; } ol { list-style-type: none; } li { margin-top: 10px; } hgroup{ color:#FFF; padding:5px; border-left: #E47297 3px solid; } p { line-height: 180%; } fieldset { border: 0px currentColor; } img { border:0; max-width: 100%; height: auto; / width: 100%; /* Resizes automatically on any devise. */ } input { margin: 10px; padding: 10px; border-radius: 20px; border: 0px currentColor; width: 300px; height: 30px; } textarea { padding: 10px; border-radius: 10px; border: 0px currentColor; margin-top: 5px; } #main_div { background-color:rgba(0,0,0,.01); margin:auto; width:1000px; padding:10px; clear:both; background: -webkit-linear-gradient(rgba(0,0,0,.0), rgba(0,0,0,.02)); background: -moz-linear-gradient(rgba(0,0,0,.0), #f6f5f3); background: -o-linear-gradient(rgba(0,0,0,.0), #f6f5f3); background: linear-gradient(rgba(0,0,0,.0), rgba(0,0,0,.02)); } footer{ color:#CA278C; padding:10px; border-top:#FFF 2px solid; margin-top:20px; width:725px; padding:20px 23%; overflow:hidden; background-color:#000; height:100%; } footer #navigation{ clear:both; } #bgDeco1{ background-color:#000; position:absolute; bottom:30px; right:10px; width:150px; height:150px; border-radius:50% 50%; opacity:.4; transition:all 1s; -webkit-transition:all 1s; } #bgDeco2{ background-color:#000; position:absolute; bottom:145px; right:25px; width:100px; height:100px; border-radius:50% 50%; opacity:.3; transition:all 1.5s; -webkit-transition:all 1.5s; } #bgDeco3{ background-color:#000; position:absolute; bottom:210px; right:75px; width:80px; height:80px; border-radius:50% 50%; opacity:.2; transition:all 2s; -webkit-transition:all 2s; } #bgDeco4{ background-color:#000; position:absolute; bottom:250px; right:75px; width:50px; height:50px; border-radius:50% 50%; opacity:.1; transition:all 2.5s; -webkit-transition:all 2.5s; } #bgDeco5{ background-color:#000; position:absolute; bottom:250px; right:75px; width:75px; height:75px; border-radius:50% 50%; opacity:.25; transition:all 2.5s; -webkit-transition:all 2.5s; } #bgDeco6{ background-color:#000; position:absolute; bottom:250px; right:75px; width:55px; height:55px; border-radius:50% 50%; opacity:.35; transition:all 2.5s; -webkit-transition:all 2.5s; } #SkypeButton_Call_age_of_empires3_1 { float: right; } #div_main { width: 590px; } #skills { font-size: 19px; margin-top: 40px; margin-bottom: 40px; } .portfolio { padding:14px; margin:14px 0; min-height:200px; border-left:#E47297 2px solid; clear:both; cursor:pointer; transition:all .3s; -webkit-transition:all .7s; } .portfolio:hover{ background-color:rgba(255,255,255,.05); } #menu input{ width: 149px; height: 16px; } #menu input[type="submit"]{ padding-bottom: 25px; } #menu form{ height:300px; border:1px solid red; } #menu { margin: 10px; padding: 10px; width: 200px; float: left; } #menu a { font-size: 18px; font-weight: bold; margin-top: 10px; margin-right: 10px; display: block; } #calendar_div { border: 1px solid black; width: 245px; float: left; overflow:hidden; } .buttons { padding-right: 10px; float: right; } #calendar { width: 210px; float: left; overflow:hidden; } #calendar tr > th { color: rgb(0, 0, 0); padding-right: 20px; } #article { padding: 10px; width: 490px; float: left; margin-bottom:40px; border-bottom:2px solid red; } #article p { text-indent: 20px; } #article h1 { border-left:#FFF 2px solid; color:#FFF; background-color:rgba(255,255,255,.15); padding:5px; padding-left:10px; margin:10px 0; } #article h4 { margin: 10px; color: pink; } #comment_form { margin: auto; width: 500px; overflow: hidden; } .comment { background: rgb(167, 211, 241); margin: 10px auto 30px; padding: 10px; border-radius: 10px; border: 1px solid red; width: 500px; height: auto; color: rgb(0, 0, 0); overflow: hidden; } h3.commentator { text-align: left; } #links { width: 400px; margin:auto; } #links li { padding-top: 10px; } .about { width: 1000px; overflow: hidden; } .about img { margin: 10px; overflow: hidden; float: left; } .about p { padding: 10px; } #contact_picture { width:500px; float:right; } #contact_info { float: right; } .red { margin: 10px; padding: 10px; width: 500px; height: auto; overflow: hidden; float: left; } #contact_form { padding: 10px; width: 477px; overflow: hidden; } .secret { display: none; } #uploading { padding: 10px; border: 1px solid red; width: 500px; } .wrong_answer { background: red; padding: 10px; border: 1px solid green; color: white; } .correct_answer { background: green; border: 1px solid orange; } label { display: block; } #secret{ display:none; } /********************************** Blog ***********************************/ #category{ float:right; margin:10px; } /* the class for the flags */ .langs{ float:right; margin:15px; box-shadow: 6px 6px 15px #545454; -webkit-box-shadow: 6px 6px 15px #545454; /* Support for Chrome, Safari, iOS, Android */ -moz-box-shadow: 6px 6px 15px #545454; /* Support for Mozilla -13 */ } /************************************* WP Plugins **************************************/ #single_plugin{ width:590px; margin:10px; border-bottom: 1px solid orange; } And here is my HTML structure for the index.php file <?php include 'html/header.php'; ?> <!-- This ID holds the entire inner container for this page --> <div id="main_div"> <h1>Hello World!</h1> <h3>My name is Stefany and I am from Bulgaria. I am a computer programmer and I create websites and web applications.</h3> <p id="skills"> <strong>Programming languages:</strong> PHP, Perl 5, JavaScript <br /> <strong>Front - end:</strong> HTML5, XHTML, CSS <br /> <strong>Databases:</strong> MySQL, SQLite, MariaDB, MSSQL <br /> <strong>Frameworks:</strong> CodeIgniter <br /> <strong>E-commerce Platforms:</strong> osCommerce, UniqueFree <br /> <strong>Other:</strong> XML, AJAX, JSON <br /> <strong>Web Services:</strong> REST, SOAP <br /> <strong>Content Management Systems:</strong> WordPress, Joomla <br /> I can create forums, blogs, social networks, E - stores, portfolios, WordPress themes, plugin and pretty much any type of website you can think of. <br /> Please take a look at my portfolio below and if you are interested to hire me, please don't hesitate to <a href="contact">contact me!</a> </p> <h2>Portfolio</h2> <div class="portfolio"> <h3><a href="http://tarsis-bg.com/" target="_blank"> Tarsis </a></h3> <a href="http://tarsis-bg.com/" target="_blank"><img src="images/project23.png" width="200" height="133" alt="Company website for selling flats" /></a> <p> Tarsis is a company that builds and sells flats in Sunny Beach, Bulgaria and I made their website on WordPress, including a custom made plugin that was used to build a separate CMS within WP for management of the flats that are for sale. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, WordPress </p> </div> <div class="portfolio"> <h3><a href="http://ungerne.dk/" target="_blank"> Ungerne </a></h3> <a href="http://ungerne.dk/" target="_blank"><img src="images/project22.png" width="200" height="133" alt="Web-shop for selling kids' clothes" /></a> <p> Danish web-shop for selling kids' clothes, built on osCommerce. I made major core modifications, such as fixes on the coupon, mail, search, shipping, product and shopping systems. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, osCommerce </p> </div> <div class="portfolio"> <h3><a href="http://www.br-electronic.dk/" target="_blank"> Bramming Electronic </a></h3> <a href="http://www.br-electronic.dk/" target="_blank"><img src="images/project21.png" width="200" height="133" alt="Web-shop for selling electronics" /></a> <p> UniqueFree built Danish web-shop for selling electronics. Made core modifications in the shipping system. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, UniqueFree </p> </div> <div class="portfolio"> <h3><a href="http://babyfryd.dk/" target="_blank"> BabyFryd </a></h3> <a href="http://babyfryd.dk//" target="_blank"><img src="images/project20.png" width="200" height="133" alt="BabyFryd web-shop for selling kids' clothes" /></a> <p> Another Danish web-shop for selling children's clothes build on UniqueFree <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, UniqueFree </p> </div> <div class="portfolio"> <h3><a href="http://iskampak.com" target="_blank"> Iskam Pak </a></h3> <a href="http://iskampak.com/" target="_blank"><img src="images/project19.png" width="200" height="133" alt="A website about Angry Birds" /></a> <p> Dating website made entirely from scratch without any frameworks with a custom CMS build into it. <br /> It is currently a work in progress. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL </p> </div> <div class="portfolio"> <h3><a href="http://angrybirds.me/" target="_blank">Angry Birds </a></h3> <a href="http://angrybirds.me/" target="_blank"><img src="images/project18.png" width="200" height="133" alt="A website about Angry Birds" /></a> <p> A website where you can play the legendary game Angry Birds for free. <br /> I made it with WordPress by tweaking a theme and installing plugins. <br /> Technologies used: XHTML, CSS, WordPress, PHP </p> </div> <div class="portfolio"> <h3><a href="http://dyulgerova.info/nc/index.php" target="_blank"> Wallace & Hull LLP</a></h3> <a href="http://dyulgerova.info/nc/index.php" target="_blank"><img src="images/project17.png" width="200" height="133" alt="Project 12" /></a> <p> The homepage of <strong>"Wallace and Hull LLP"</strong> lawyer firm from Oregon, Washington. It's part of a WordPress theme I made. <br /> Technologies used: HTML5, CSS3, WordPress </p> </div> <div class="portfolio"> <h3><a href="http://www.automirrorsexpress.com/" target="_blank"> Auto Mirrors Express</a></h3> <a href="http://www.automirrorsexpress.com/" target="_blank"><img src="images/project15.jpg" width="200" height="133" alt="Project 12" /></a> <p> E - shop for car mirrors. Created a tag cloud, fixed many DB issues and configured the server. <br /> Technologies used: XHTML, CSS, PHP, JavaScript, Perl, osCommerce </p> </div> <div class="portfolio"> <h3><a href="http://www.autolightcenter.com/index.php" target="_blank"> Auto Lights Center</a></h3> <a href="http://www.autolightcenter.com/index.php" target="_blank"><img src="images/project14.jpg" width="200" height="133" alt="Project 12" /></a> <p> E - shop for car lights. Made some grand changes with the design, the entire back end code and the DB. Greatly increased the security. <br /> Technologies used: XHTML, CSS, PHP, JavaScript, Perl, osCommerce </p> </div> <div class="portfolio"> <h3><a href="http://radiosean.co.uk/"> Radio Sean</a></h3> <a href="http://radiosean.co.uk/"><img src="images/project13.jpg" width="200" height="133" alt="Project 12" /></a> <p> Homepage of a British radio station. I created the search engine of the website. <br /> Technologies used: XHTML, PHP </p> </div> <div class="portfolio"> <h3><a href="/portfolio/otto" target="_blank"> Otto Steininger</a></h3> <a href="http://www.ottosteininger.com/" target="_blank"><img src="images/project12.jpg" width="200" height="133" alt="Project 12" /></a> <p> Coming soon page for the website of an animator/illustrator professional. <br /> Technologies used: XHTML, CSS, Javascript </p> </div> <div class="portfolio"> <h3><a href="http://freepic.eu/" target="_blank"> FreePic</a></h3> <a href="http://freepic.eu/" target="_blank"><img src="images/project11.png" width="200" height="133" alt="Project 11" /></a> <p> Free image hosting website. I created the GIF category, the admin panel and increased the security of the website. <br /> Technologies used: XHTML, CSS, PHP, MySQL, GD </p> </div> <div class="portfolio"> <h3><a href="http://studyingthepast.com/" target="_blank"> Studying The Past</a></h3> <a href="http://studyingthepast.com/" target="_blank"><img src="images/project10.png" width="200" height="133" alt="Project 10" /></a> <p> A website about history. 100% XHTML 1.0 and CSS valid. <br /> Technologies used: XHTML, CSS, PHP, SQLite </p> </div> <!-- The "portfolio" class is a div that holds one website at a time. That's why there are so many declarations of that div --> <div class="portfolio"> <!-- The name of the website in a header element with a link to it --> <h3><a href="http://sundaygolessons.com/" target="_blank">Sunday Go Lessons</a></h3> <!-- And a picture of the website again with a link to it because it's cool to also have a screenshot beside just a super boring link, WOW --> <a href="http://sundaygolessons.com/" target="_blank"><img src="images/project9.png" width="200" height="133" alt="Project 9" /></a> <!-- And a litte explanation as to what the website is the hell about. --> <p> A webshop for selling and renting <a href="https://www.usgo.org/what-go">Go</a> related books and videos, with integrated PayPal payment system. <br /> Technologies used: XHTML, CSS, PHP, MySQL, PayPal </p> </div> <!-- End of the previous website and now it's the turn of the next. The bragging continues... --> <div class="portfolio"> <h3><a href="http://code-forums.info/" target="_blank"> PHP Forum</a></h3> <a href="http://code-forums.info/" target="_blank"><img src="images/project7.png" width="200" height="133" alt="Project 7" /></a> <p> A programming forum coded from scratch, without using any PHP frameworks or ready made stuff. <a href="http://github.com/Stefany93/PHP-Forum">Source code.</a> <br /> Technologies used: XHTML, CSS, PHP, MySQL, JavaScript </p> </div> <div class="portfolio"> <h3><a href="http://dyulgerova.info/project_blog/" target="_blank">Bulgarian newspapper</a></h3> <a href="http://dyulgerova.info/project_blog/" target="_blank"><img src="images/project6.png" width="200" height="133" alt="Project 2" /></a> <p> This project has been made half way and it is currently frozen. <br /> Technologies used: XHTML, CSS, PHP, MySQL, JavaScript </p> </div> <div class="portfolio"> <h3><a href="http://www.bettercitiesforum.com/" target="_blank"> WordPress website about improving neighbourhoods</a></h3> <a href="http://www.bettercitiesforum.com/" target="_blank"><img src="images/project5.png" width="200" height="133" alt="Project 2" /></a> <p> I installed a Simple Machines Forum and made some tweaks on the source code as well on the site. <br /> Technologies used: WordPress, PHP </p> </div> <div class="portfolio"> <h3><a href="big_images/project4.png" target="_blank">Social Network</a></h3> <a href="big_images/project4.png" target="_blank"><img src="images/project4.png" width="200" height="133" alt="Project 2" /></a> <p> Including a forum, an individual learning module and an event calendar. The social network is private for the residents anesthesiologists of the Texas Tech University <br /> and therefore not in the public domain. I created it in twenty days from scratch. <br /> Technologies used: HTML5, CSS, PHP, MySQL, JavaScript. </p> </div> <div class="portfolio"> <h3><a href="http://chrisshilts.com/" target="_blank">Portfolio for a web designer.</a></h3> <a href="http://chrisshilts.com/" target="_blank"><img src="images/project3.jpg" width="200" height="133" alt="Project 2" /></a> <p> Basically I made the blog page with a custom Content Management System including an Admin panel. <br /> Technologies used: PHP, MySQL, JavaScript. </p> </div> <div class="portfolio"> <h3><a href="http://www.borsp.com/sandh/dazer/" target="_blank"> E - Shop</a></h3> <a href="http://www.borsp.com/sandh/dazer/" target="_blank"><img src="images/project2.jpg" width="200" height="133" alt="Project 2" /></a> <p> I made the front - end and my colleague made the back - end. It's in a process of being uploaded. <br /> Techologies used: XHTML, CSS, JavaScript. </p> </div> </div> <?php include 'html/footer.php'; ?> Please help me! I managed to fix the problem with "overflow-x:hidden" property of "body" in CSS, but I do believe this is way too wrong.
  7. I have this form <form action="" method="get" name="size"> Størrelse <hr><label><input type="radio" value="9" name="size" onchange="this.form.submit()">92 (2år)</label> <label><input type="checkbox" value="147" name="size" onchange="this.form.submit()">68 (6-9 mdr.) </label><label><input type="checkbox" value="150" name="size" onchange="this.form.submit()">86 (18-24 mdr.)</label> <input type="checkbox" value="149" name="size" onchange="this.form.submit()">80 (12-18 mdr.)</label> <label><input type="checkbox" value="148" name="size" onchange="this.form.submit()">74 (9-12 mdr.)</label> </form> I want to make it so that when the user clicks one checkbox for example size 68 and then checks size 80 I want both sizes to be in the URL query string. But every time the user clicks a new checkbox, the query string changes accordingly. Maybe with a separator like ?size=4:23 and then I will handle it with the DB stuff. Please tell me how to add multiple elements in the query string with this form, thank you!
  8. Sorry, it's a tutorial, I missed to put that in the title.
  9. How to make border appear on the left and right sides of text? Let's say we have a div 200px x 100px with red border and ID of "container" <style type="text/css"> *{padding:0; margin:0;} #container{ width:200px; height:100px; border:2px solid red; } </style> <div id="container"> <p>Happy Potter</p> He was an awesome wizard! </div> Now we want to put the paragraph "Happy Potter" on the top of the div box between the red border. We do that by defining negative margin which will push up the paragraph like this: #container p{ margin-top:-15px; } Now our paragraph is in between the border, almost how we want it to be. Next we want to push it in the middle. So we use margin-left: #container p{ margin-top:-15px; margin-left:50px; } I'd suggest adjusting the left margin i.e. the pushing to the center thing with the developer tools of your browser ( right click on top of the element and Firebug ( for FF ) or Google Chrome Developer tools will pop up ) Next we want to remove the border that is overlapping the text. We do that by defining width of the text and giving it a background color that is the same as the div container and the outside area of it like this: #container p{ margin-top:-15px; margin-left: 50px; width: 83px; background: pink; } In my case the background color of both the container div and the area outside of it was pink so I gave the same color to the paragraph after defining its width. We have the final result: And now we and Harry Potter are happy Final code: <style type="text/css"> *{padding:0; margin:0;} #container{ width:200px; height:100px; border:2px solid red; } #container p{ margin-top:-15px; margin-left: 50px; width: 100px; background: pink; } </style> <div id="container"> <p>Happy Potter</p> He was an awesome wizard! </div>
  10. You are pure genius, thank you so much! Here is my final form, I hope someone else struggling with this problem could benefit from my experience. window.onload = function(){ var submit_button = document.getElementById('submit_button'); var cform = document.getElementById('cform'); cform.onsubmit = function(event){ event.preventDefault(); var response_text = document.ZIPTIE.recaptcha_response_field.value; var challenge_text = document.ZIPTIE.recaptcha_challenge_field.value; if(connection){ connection.onreadystatechange = function(){ if(connection.readyState == 4 && connection.status == 200){ if(connection.responseText == 10){ alert('Thank you for your feedback!'); cform.submit(); }else{ alert('Wrong Human Verification!'); location.reload(); } } } // before connection.open("GET","verify.php?c="+challenge_text+"&r="+response_text,true); connection.send(); } } }
  11. I have a contact form that gets processes with a Perl script. What I want to do is that when the user fills out the contact form and clicks submit, the reCAPTCHA would get processed and if the user had entered the correct CAPTCHA, it would return true, if not, it would return false and the form would not get processed. Now since the hosting does not allow Perl modules to be installed in order CAPTCHA to be processed there, it must be processed with PHP, that is why I am processing the CAPTCHA with AJAX, behind the scenes. Now, I have done everything, the CAPTCHA gets processed, but hell I can't make it the form not to get submited when the AJAX script returns false. Please help me! Here is the JS script function server_connect(){ // We declare the $connection variable which will hold the // core object depending on the browser. Now we have set it // equal to false since we do not know the user's browser // yet and we haven't defined the variable with the proper // object. var connection = false; // We check whether the browser is any browser but IE 6 - // Since IE 7, that MS browser supports the XMLHttpRequest object. if(window.XMLHttpRequest){ // If the browser supports the object and it doesn't // return 'undefined' make a new instance of the object and // assign it to the $connection variable. // If not, set $connection to false which means // this browser doesn't support the XMLHttpObject // and that means the user has IE version below 7. if(typeof XMLHttpRequest != "undefined"){ try{ connection = new XMLHttpRequest(); }catch(e){ connection = false; } } // If the above evaluation fails, // we make a new evaluation to set $connection with the // right object, in this case, for IE 6 - }else if(window.ActiveXObject){ try{ connection = new ActiveXObject('Microsoft.XMLHTTP'); }catch(e){ try{ connection = new ActiveXObject('Msxml2.XMLHTTP'); }catch(e){ connection = false; } } } // The return value of this function is // either the right AJAX server connection object // or false which means that AJAX cannot connect for some reason. return connection; } // We set the object to a variable and now we can use its properties // and methods when connecting to the server behind the scenes. var connection = server_connect(); // It's easy :-) // /****************************************************************************/ window.onload = function(){ var submit_button = document.getElementById('submit_button'); var cform = document.getElementById('cform'); cform.onsubmit = function(){ var response_text = document.ZIPTIE.recaptcha_response_field.value; var challenge_text = document.ZIPTIE.recaptcha_challenge_field.value; if(connection){ connection.onreadystatechange = function(){ if(connection.readyState == 4 && connection.status == 200){ if(connection.responseText == 10){ alert('OK'); return true; // Should return true if the responseText from verify.php is '10' }else{ alert(false); return false; // Should return false if the responseText from verify.php is not 10 } } } // before connection.open("GET","verify.php?c="+challenge_text+"&r="+response_text,true); connection.send(); } return false; } } And the HTML: <form action="process.pl" method="post" name="ZIPTIE" id="cform"> <br /> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><strong><font size="+2">Please tell us what you think!</font></strong></td> </tr> </table> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" > <BR> <TR> <td width="230" valign="middle"><STRONG>Your Name:</STRONG></TD> <td valign="middle"><INPUT NAME="name" SIZE="40" MAXLENGTH="100"></TD> </TR> <TR> <td valign="middle"><STRONG>Phone Number:</STRONG></TD> <td valign="middle"><INPUT NAME="phone_number" SIZE="40" MAXLENGTH="100"></TD> </TR> <TR> <td valign="middle"><STRONG>E-mail Address:</STRONG></TD> <td valign="middle"><INPUT NAME="email_address" SIZE="40" MAXLENGTH="100"></TD> </TR> <TR> <td valign="middle"><img src="images/spacer.png" width="1" height="8" border="0" /></TD> <td valign="middle"></TD> </TR> <TD WIDTH="230"><STRONG>Type of Feedback:</STRONG></TD> <TD> <SELECT NAME="type"> <OPTION VALUE="Positive">Positive</OPTION> <OPTION VALUE="Complaint">Complaint</OPTION> <OPTION VALUE="Comment">Comment</OPTION> <OPTION VALUE="Request">Request</OPTION> </SELECT> </TD> </tr> <TR> <td valign="middle"><img src="images/spacer.png" width="1" height="8" /></TD> <td valign="middle"></TD> </TR> <tr> <TD WIDTH="230"><STRONG>Store Location Your Writing About:</STRONG></TD> <TD> <SELECT NAME="location"> <OPTION VALUE="Portland">Portland</OPTION> <OPTION VALUE="Grand Ledge">Grand Ledge</OPTION> <OPTION VALUE="St. Louis">St. Louis</OPTION> <OPTION VALUE="Linwood">Linwood</OPTION> <OPTION VALUE="Rosebush">Rosebush</OPTION> <OPTION VALUE="Tecumseh">Tecumseh</OPTION> <OPTION VALUE="South Lyon">South Lyon</OPTION> </SELECT> </TD> </tr> <TR> <td valign="middle"><img src="images/spacer.png" width="1" height="12" /></TD> <td valign="middle"></TD> </TR> <TR> <td valign="middle">Your Message:</TD> <td valign="middle"><textarea name="message" cols="65" rows="4"></textarea></TD> </TR> <TR> <td valign="middle"><img src="images/spacer.png" width="1" height="8" /></TD> <td valign="middle"></TD> </TR> <TR> <td valign="middle"><img src="images/spacer.png" width="5" height="8" />Human Verification:</TD> <td valign="middle"> CAPTCHA!!!! <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6Leh-OYSAAAAAHvM0Ty2b6CsHilEgu4mM8oEsdvG "> </script> <noscript> <iframe src="http://www.google.com/recaptcha/api/noscript?k=6Leh-OYSAAAAAHvM0Ty2b6CsHilEgu4mM8oEsdvG " height="300" width="500" frameborder="0"></iframe><br> <textarea name="recaptcha_challenge_field" rows="3" cols="40" id="challenge"></textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge" id="response"> </noscript> END OF CAPTCHA!!! </TD> </TR> </table> <br /> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000"> <TR> <td align="center"> <FONT COLOR="#fff707"><strong>IMPORTANT!</strong> - We will not use your personal information in any manner other than you have approved!</FONT> </TD> </TR> </TABLE> <br /> <table align="center"> <TR> <TD> <INPUT TYPE="SUBMIT" VALUE="Submit" id="submit_button"> <INPUT TYPE="RESET" VALUE="Clear Form"></FORM></TD> I didn't write the HTML form, it was written by someone else. And I am not using jQuery because it is lame.
  12. Damn it... Spend so much time on an un-solvable issue. So smart of me... Thanks man.
  13. Howdy, OK, I have been struggling with this problem all evening yesterday and this morning. Please help! I have a table subscribers that holds the emails of subscribed users. Then I have the table posts that holds the blog posts. I want to make it so that with one query I pull out all the emails from the subscribers table and only ONE record from the posts table namely the post_id and the post title so that I can that way construct a link to where the user can click on their email that will take them to the latest blog post. I can make it with two queries, but I really want to do it with one. I tried everything, sub-queries, joins, crosses, prayers with no good. I wrote this: SELECT DISTINCT (SELECT DISTINCT MAX(post_id) FROM posts ) AS last_post , subscribers_email FROM subscribers But it always pulls out duplicate post_id rows like this: post_id subscriber_email 66 [email protected] 66 [email protected] Here is my PHP code: function send_mass_email($db){ $sql = 'SELECT subscribers_email, post_id, title FROM subscribers, posts WHERE CONDITION'; $query = $db->prepare($sql); $query->execute(); $suject = 'New blog post in www.dyulgerova.info'; $message = ' New blog post have been posted in www.dyulgerova.info/blog Link - *LINK HERE* '; while($row = $query->fetch(PDO::FETCH_NUM)){ mail($row[0], $subject, $message); } } Thank you very much!
  14. Is it possible to have a WordPress website that you can do so that you can play Angry Birds on it? I searched the internet and couldn't find an answer. Also, it appears there are no plugins for it. Thanks colleagues!
  15. Hello friends, My name Stefany and I am a computer programmer. Over the past 2 years I have created 15 websites, the most prominent being: 1. Social Network for the Texas Tech University; 2. Web-shop for a 4d Go player; 3. Personal history blog; 4. Another web-shop for a Bulgarian company; 5. Homepage for a Bulgarian national newspaper; My major skills include: Front end - XHTML, CSS, JavaScript Back end - PHP, Perl, AJAX Databases - MySQL, SQLite, MariaDB CMS - WordPress Other - XML, REST, SOAP Frameworks - CodeIgniter E-Commerce platforms - OsCommerce, Magento I am truly confident to create any kind of website, web application or script. Just send me a message, thank you. Portfolio with all the websites I had created so far and my programming blog - www.dyulgerova.info Github - https://github.com/Stefany93?tab=repositories CV - www.dyulgerova.info/cv.pdf Email: [email protected] Skype - age_of_empires3 Thank you very much! Stefany
  16. So when my boyfriend started searching for a roommate, I made him promise he would NOT get a female roommate. He looked me in the eyes and said "I promise" Well, today he told he had to find a female roommate, or he will get evicted from the flat he is renting. Because he has been searching for a roommate for 2 weeks without luck and he has to get a female one. I told him to find a cheaper place, he told me his one is the cheapest in the whole city, even tho it is a two bedroom flat and then he told me he has to pay 1500$ deposit for a new place, so he told me getting a female roommate is his only choice unless he becomes homeless. Now, he promised he wouldn't do that, and he broke his promise. Lately he became acting weird, like talking to me very little and HUNGIN UP the phone when I call him. So what do you guys think? My father told me you should dump the person who breaks his promise. When we met, I told him I have very strict and old-fashioned morals and getting a female roommate is a break for them. He said he was the same way, so it's not like I didn't warn him.
  17. Still does not work, here is the code. Thank you for you reply tho RewriteEngine On RewriteRule ^/directory2/$ /directory1/
  18. Howdy, I have a directory named directory1 and the user can access it by typing www.example.com/directory1. However, I want to make it so that the user would type www.example.com/directory2 but they will land on wwww.example.com/directory1, but the URL will show www.example.com/directory2 I tried doing that with this .htaccess: RewriteRule /directory2/ /directory1/ but it didn't work. I also searched in google but in vain. Please help!
  19. @gristoi, thank you, the problem turned out to be permissions-wise. I asked the sysadmin to fix it and he did.
  20. Please folks - I am dying out here
  21. I am sorry for the obvious question, but I searched the internet for an hour and I only found deprecated examples. Please help! I have the website www.example.com and I want to add the page product_details.php and the users can access it with www.example.com/product_details.php but when I simply added the file into the root, I get this error when accessing it: Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/home/peaches/public_html/product_details.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/gopart/gigabitware_framework') in Unknown on line 0 Please tell me how to proper add a new page in OsCom. Thank you very much!
  22. Thank you very much for the reply but it seems that the files were super weird so neither thing worked. I was forced to built a small Perl script to cut out the first column's contents needed to be dumped into the DB. Here is the script if anyone needs it. I am sorry, it is without comments because I had to write it in a hurry: open(my $file_txt, '>>', 'file.txt') or die('could not open the god damn filex'); my @files_for_dump = glob('files_dump\\*'); open(my $file_handle, $file_name); # or die "Could not open file '$filename' $!"; my $count_files = @files_for_dump; for(my $x = 0; $x < $count_files; $x++){ open(my $r, $files_for_dump[$x]); while(my $line = <$r>){ my @keywords = split('[,]', $line); my @t = shift(@keywords); foreach(@t){ print $file_txt $_."\n" } } }
  23. Howdy colleagues, I have like 4000 CSV files that I need to import into the DB keyurl. Each file has 10 columns, however, I only need to dump the keyword column into the DB table keyurl which has these fieds: int_glcode keyword int_glcode is an AUTO_INCREMENT column. However, when I upload my CSV file, I get the error "Invalid column count at line 1" I tried with the "Upload CSV with LOAD DATA" option and I get "only one row inserted" message while in reality only the int_glcode gets added to. I also tried creating a fake table with 10 columns to dump the data from the CSV file, but that failed too. it shows "only one row inserted" message yet again. Please tell me the correct way to do it, I am lost. This is the average CSV file that I need to dump: I just need to fetch the Keyword column, nothing else. Keyword,Visits,% New Visits,New Visits,Bounce Rate,Pages / Visit,Avg. Visit Duration,Transactions,Revenue,Ecommerce Conversion Rate (not set),53,100.00%,53,50.94%,2.02,00:00:32,0,$0.00,0.00% ac blower located in 2000 buick lesabre,53,50.94%,27,100.00%,1.00,00:00:00,0,$0.00,0.00% (not provided),27,0.00%,0,100.00%,1.00,00:00:00,0,$0.00,0.00% 01 lasbre heat and ac diagram,27,0.00%,0,100.00%,1.00,00:00:00,0,$0.00,0.00% 2000 buick lesabre ac blower,27,100.00%,27,100.00%,1.00,00:00:00,0,$0.00,0.00% 2001 buick lesabre blower,27,100.00%,27,100.00%,1.00,00:00:00,0,$0.00,0.00% fan blower motor for 2001 buick lesabre,27,100.00%,27,100.00%,1.00,00:00:00,0,$0.00,0.00% fan motor 2001 buick la sabre,27,100.00%,27,0.00%,2.96,00:02:10,0,$0.00,0.00% how to change a blower motor on a 2000 buick lesabre,27,100.00%,27,100.00%,1.00,00:00:00,0,$0.00,0.00% hvac blower motor replacement on a 2001 buick lesabre,27,100.00%,27,100.00%,1.00,00:00:00,0,$0.00,0.00% ,322,75.16%,242,83.54%,1.33,00:00:16,0,$0.00,0.00% Day Index,Visits 9/1/08,0 9/2/08,0 Thank you very much!
  24. Thanks man, worked like charm.
  25. Guys, I am going crazy. Please help. I am trying to make a FULLTEXT clause match 'acura integra radiator' but that sentence must be present in the fetched rows. Because now the mysql fetches everything that has either the words 'acura', 'íntegra' or 'radiator' Basically I am trying to create a tag cloud. I am not using the LIKE clause because it does not accept variables. Thank you.
×
×
  • 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.