Jump to content

Search the Community

Showing results for tags 'script'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Hi guys , i am really stuck here .. i am not a php programmer and got a script from a friend to open a link random on click anywhere on site .. this script works great but it only opens a link once a day , i need it to open a link every time the users clicks on the site. i googled a lot and fount that it is the cookie settings , only in all tutorials online they talk about setting cookie time on 0 ... this option is not written in the script i have and there is a tag made , new_Date i can not find any info on those tags like new day , and changing it to 0 breaks the script. does somebody know how to change this script so it works on every click on the site. this script is needed for affiliate links and i need it to open every time someone clicks on something on the site without time delay or a time delay from 1 minute for the main page. but most importent is the code without time delay . if someone wants to help i'll be very thankful course googling is not going to solve this for me .. Thanks the script :::: <script> var puShown = false; var PopWidth = 1370; var PopHeight = 800; var PopFocus = 0; var _Top = null; function GetWindowHeight() { var myHeight = 0; if( typeof( _Top.window.innerHeight ) == 'number' ) { myHeight = _Top.window.innerHeight; } else if( _Top.document.documentElement && _Top.document.documentElement.clientHeight ) { myHeight = _Top.document.documentElement.clientHeight; } else if( _Top.document.body && _Top.document.body.clientHeight ) { myHeight = _Top.document.body.clientHeight; } return myHeight; } function GetWindowWidth() { var myWidth = 0; if( typeof( _Top.window.innerWidth ) == 'number' ) { myWidth = _Top.window.innerWidth; } else if( _Top.document.documentElement && _Top.document.documentElement.clientWidth ) { myWidth = _Top.document.documentElement.clientWidth; } else if( _Top.document.body && _Top.document.body.clientWidth ) { myWidth = _Top.document.body.clientWidth; } return myWidth; } function GetWindowTop() { return (_Top.window.screenTop != undefined) ? _Top.window.screenTop : _Top.window.screenY; } function GetWindowLeft() { return (_Top.window.screenLeft != undefined) ? _Top.window.screenLeft : _Top.window.screenX; } function doOpen(url) { var popURL = "about:blank" var popID = "ad_" + Math.floor(89999999*Math.random()+10000000); var pxLeft = 0; var pxTop = 0; pxLeft = (GetWindowLeft() + (GetWindowWidth() / 2) - (PopWidth / 2)); pxTop = (GetWindowTop() + (GetWindowHeight() / 2) - (PopHeight / 2)); if ( puShown == true ) { return true; } var PopWin=_Top.window.open(popURL,popID,'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,top=' + pxTop + ',left=' + pxLeft + ',width=' + PopWidth + ',height=' + PopHeight); if (PopWin) { puShown = true; if (PopFocus == 0) { PopWin.blur(); if (navigator.userAgent.toLowerCase().indexOf("applewebkit") > -1) { _Top.window.blur(); _Top.window.focus(); } } PopWin.Init = function(e) { with (e) { Params = e.Params; Main = function(){ if (typeof window.mozPaintCount != "undefined") { var x = window.open("about:blank"); x.close(); } var popURL = Params.PopURL; try { opener.window.focus(); } catch (err) { } window.location = popURL; } Main(); } }; PopWin.Params = { PopURL: url } PopWin.Init(PopWin); } return PopWin; } function setCookie(name, value, time) { var expires = new Date(); expires.setTime( expires.getTime() + time ); document.cookie = name + '=' + value + '; path=/;' + '; expires=' + expires.toGMTString() ; } function getCookie(name) { var cookies = document.cookie.toString().split('; '); var cookie, c_name, c_value; for (var n=0; n<cookies.length; n++) { cookie = cookies[n].split('='); c_name = cookie[0]; c_value = cookie[1]; if ( c_name == name ) { return c_value; } } return null; } function initPu() { _Top = self; if (top != self) { try { if (top.document.location.toString()) _Top = top; } catch(err) { } } if ( document.attachEvent ) { document.attachEvent( 'onclick', checkTarget ); } else if ( document.addEventListener ) { document.addEventListener( 'click', checkTarget, false ); } } function checkTarget(e) { if ( !getCookie('popundr') ) { var e = e || window.event; var win = doOpen('http://yourlinkurl.url/bannerpage.phphtml'); setCookie('popundr', 1, 24*60*60*1000); } } initPu(); </script>
  2. Can Someone please look at the following zip file and edit index and code-gen so when someone refer required amount of visitors, php echo will redirect them to complete.php I have got css and js but not uploading as they are too big Thanks (please help me) script.zip
  3. include "header.php"; if(isset($_GET['post_id'])) { $select=mysqli_query($con,"select...."); while($data=mysqli_fetch_array($select)) { echo "bla bla bla"; to_head("<title>asd</title><meta itemprop="name" content="asdfasdf">..."); } } include "footer.php"; This is samthing what i want... I have header.php and footer.php and any script ex news.php where how news and read SEO stuff from database and put in HEAD of the document. I tried with jquery like $("head").append(str); and it works but then i read google don't run jquery when vist website. This is done with drupal, wordpress and php-fusion Drupal: https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_add_html_head/7 php-fusion: https://www.php-fusion.co.uk/forum/viewthread.php?thread_id=30959 so it is possible but i don't know how. Any idea?
  4. Hi I've been stuck trying to execute a script for a few weeks now and I really need help. The script is supposed to schedule social media posts via functions.php and wp-load.php but I get errors. Can someone do me a favour? Drop your email and I'll send you the details to connect to my database. Thanks
  5. Howdy ya'll . . . I am a new member here. My background with html & css is all self-taught, but I have no knowledge of PHP so I am here looking for some expert help with a problem I am having with a comments script that I have on some of the pages of my new website. So, because of my ignorance when it comes to PHP, please be gentle with me. LOL So here is my problem: I am using the comments script from Script Mills in the sidebar of my website. I have overcome the first big obstacle - got it installed and working. I posted a test comment and it worked, but I do not like the way the posted comment shows on the page. I have searched all the script folders for a style sheet and can't find one. So my question is: how does one go about styling/changing the way the output of a script like this posts to the page? If you need to see what I am talking about, the page http://pickmysmoker.com/cb_offset_smoker_1280.php and if it will help to understand what I am trying to do, feel free to post anything to the comment and see how it posts. In particular, I would like to move the comments further down in the sidebar and utilize more of the sidebar area so that the comments take up more of the width. I hope my question makes sense and there is someone here that can offer me some help/advice/guidenance in getting this squared away. Thanks in advance . . .
  6. I have purchased a ad manager type script and have put so much work in to the site but i cannot get the cron file to execute properly due to errors. The makers of the script arent answering my emails so I am left to find the answer myself im hoping some experts can shine a light on this for me I have the cron running once daily as required the error messages are as follows: /home2/net2you/public_html/2xx.co.uk/include/CronStats.php: line 1: ?php: No such file or directory /home2/net2you/public_html/2xx.co.uk/include/CronStats.php: line 2: syntax error near unexpected token `;' /home2/net2you/public_html/2xx.co.uk/include/CronStats.php: line 2: `ob_start();' I have installed the script on two different hosts and get the exact same errors. any help would be much appriciated the contents of the cron file are below ______________________________________________ <?php ob_start(); ini_set("max_execution_time", 0); error_reporting(0); require_once("db_connection.php"); // hits table fix $ws = mysql_query("select pid from publishersinfo"); while($row = mysql_fetch_assoc($ws)){ $max = mysql_fetch_assoc(mysql_query("SELECT count(distinct ip) as distinct_hits, count(ip) as hits, date from hits where pub_id='$row[pid]' group by date order by hits desc, distinct_hits desc limit 1")); mysql_query("update publishersinfo set hits = '$max[hits]', distinct_hits = '$max[distinct_hits]' where pid = '$row[pid]' "); $country_clicks = mysql_query("select count(country) as clicks, country from hits where is_click = 1 and pub_id = '$row[pid]' GROUP BY country order by clicks desc"); mysql_query("delete from country_clicks where pid = '$row[pid]' "); while($rc = mysql_fetch_assoc($country_clicks)){ mysql_query("insert into country_clicks set clicks = '$rc[clicks]' , country = '$rc[country]', pid = '$row[pid]', updated = CURDATE() "); } } mysql_free_result($ws); // adv info $advertisement_ids = mysql_query("select adv_id from advertisersinfo"); while($ro = mysql_fetch_assoc($advertisement_ids)){ $clicksToday = mysql_result(mysql_query("select count(hit_id) from hits where adv_id = '$ro[adv_id]' and is_click='1' and is_sale='0' and `date` = CURDATE()"),0,0); $impressionsToday = mysql_result(mysql_query("select count(hit_id) from hits where adv_id = '$ro[adv_id]' and is_click='0' and is_sale='0' and `date` = CURDATE()"),0,0); $conversionsToday = mysql_result(mysql_query("select count(hit_id) from hits where adv_id = '$ro[adv_id]' and is_sale='1' and `date` = CURDATE()"),0,0); mysql_query("update advertisersinfo set clicksToday = $clicksToday, clicksTotal = (clicksTotal + $clicksToday), impressionsToday = $impressionsToday, impressionsTotal = (impressionsTotal + $impressionsToday), conversionsTotal = (conversionsTotal + $conversionsToday) where adv_id = '$ro[adv_id]' "); } mysql_free_result($advertisement_ids); // targeted_ads $cmp_ids = mysql_query("select cmp_id from adv_campaign"); while($ro = mysql_fetch_assoc($cmp_ids)){ $clicksToday = mysql_result(mysql_query("select count(hit_id) from hits where cmp_id = '$ro[cmp_id]' and is_click='1' and `date` = CURDATE()"),0,0); mysql_query("update adv_campaign set clicksToday = $clicksToday, clicksTotal = (clicksTotal + $clicksToday), remaining_budget = (remaining_budget - expense_today) where cmp_id = '$ro[cmp_id]' "); //camp_appeared $camp_appeared = mysql_query("select distinct publishersinfo.url, publishersinfo.pid from publishersinfo, hits where hits.cmp_id= '$ro[cmp_id]' and hits.pub_id=publishersinfo.pid order by hits.hit_id, hits.pub_id"); mysql_query("delete from camp_appeared where cmp_id= '$ro[cmp_id]' "); while($cmp = mysql_fetch_assoc($camp_appeared)){ mysql_query(" insert into camp_appeared set url = '$cmp', pid = '$cmp[pid]', cmp_id = '$ro[cmp_id]', updated = curdate() "); } } mysql_free_result($cmp_ids); /* $as = mysql_query("select ad_id from publishers_adspaces"); while($row = @mysql_fetch_assoc($as)){ $max_one_day_clicks = mysql_result(mysql_query("SELECT count(hit_id) as total from hits where is_click=1 and ad_id='$row[ad_id]' group by date order by total desc limit 1"),0,0); mysql_query("update publishers_adspaces set hits = $max_one_day_clicks "); } mysql_free_result($as); */ $users = mysql_query(" select uid from users where utype = 'pub+adv' "); while($r = mysql_fetch_assoc($users)){ $price = mysql_result(mysql_query("select sum(h.click_price) as price from publishersinfo pi inner join hits h on pi.pid = h.pub_id where pi.uid = '$r[uid]' and h.cmp_id <> 0 and h.date=curdate() and h.is_click=1 "),0,0); mysql_query("delete from pub_earningstoday where uid = '$r[uid]' "); mysql_query("insert into pub_earningstoday set updated = CURDATE(), uid = '$r[uid]', price = '$price' "); } ?>
  7. hii.. i want a travel search engine script in php website. i am searching for 2 to 3 days on it. but i dont know how to start. i searched on google. find sme APIs for it. but where to implement those APIs. what code i need to write for it. it would be grateful if anyone give some suggestions on this. thanks and regards.
  8. I'm not amazing with PhP, so excuse me if it looks terrible xD I've taken tutorials, edited them to fit my wanting and tried it out, it seems to deny anything other than an image type, but could it be abused? <div id="image-upload"> <h2>Upload your image</h2> <form action="upload.php" method="post" enctype="multipart/form-data"> Upload:<br><br> <input type="file" name="image"><br><br> Image Title:<br><br> <input type="text" name="image_title"><br><br> <input type="submit" name="submit" value="Upload"> </form> <?php include("upload_file.php"); function GetImageExtension($imagetype) { if(empty($imagetype)) return false; switch($imagetype) { case 'image/bmp': return '.bmp'; case 'image/jpeg': return '.jpg'; case 'image/png': return '.png'; default: return false; } } if ($_FILES['image']['error'] !== UPLOAD_ERR_OK) { die(); } $extension = getimagesize($_FILES['image']['tmp_name']); if ($extension === FALSE) { die("<br><font color='#8B0000'>Unable to determine image typeof uploaded file</font>"); } if (($extension[2] !== IMAGETYPE_GIF) && ($extension[2] !== IMAGETYPE_JPEG) && ($extension[2] !== IMAGETYPE_PNG)) { die("<br><font color='#8B0000'>Only images are allowed!</font>"); } if (!empty($_FILES["image"]["name"])) { $file_name=$_FILES["image"]["name"]; $temp_name=$_FILES["image"]["tmp_name"]; $imgtype=$_FILES["image"]["type"]; $ext= GetImageExtension($imgtype); $imagename=$_FILES["image"]["name"]; $target_path = "../../images/upload/".$imagename; $title = $_POST["image_title"]; if(move_uploaded_file($temp_name, $target_path)) { $query_upload="INSERT into `images_tbl` (`images_path`,`submission_date`,`image_title`) VALUES ('".$target_path."','".date("Y-m-d")."','".$title."')"; mysql_query($query_upload) or die("error in $query_upload == ----> ".mysql_error()); echo '<br>Image uploaded!'; }else{ echo '<br><font color="#8B0000">Only images are allowed!</font>'; } } ?>
  9. hi there is this game i play and i am trying to accomplish a code which adds items coming from the games xml. the game is called zwinky and i'm having a small problem which can maybe be easily fixed. Here are the codes: http://paste.ee/p/JHMow http://paste.ee/p/pIEUt they are written differently. Okay So the problem is a little message when used on my webhost comes up on browser saying : "HTTP/1.1 100 Continue HTTP/1.1 200 OK Date: Sat, 24 May 2014 22:52:31 GMT Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8c DAV/2 mod_jk/1.2.28 Cache-Control: max-age=0, must-revalidate Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: anx="os=-&g=-&oc=-&sn=dfprdzwinky4&od=none&op=-&fv=1400971951270&ob=-&om=-&lv=1400971951270&ok=-&nv=1"; Version=1; Domain=.zwinky.com; Max-Age=7776000; Expires=Fri, 22-Aug-2014 22:52:31 GMT; Path=/ Content-Language: en-US Content-Length: 92 Connection: close Content-Type: application/xml;charset=UTF-8 User not signed in" as you can see it says "user not signed in" yet i am signed in into the game.. So i believe somewhere in the code the cookies are wrong or the code doesn't have the necessary elements to show that you are being logged in. to get the cookies/ login info you need to create a game account which takes 10-20 seconds: http://registration..../register.jhtml and then using fiddler/charles or any other method displaying the accounts cookies it should show them up. I don't know what is needed to add to the code to make it work here our other topics on this issue never solved which might help: http://forum.ragezon...44/help-920369/ http://www.webdevelo...129-php-execute if anyone could help please! it's not hard making the game accounts and viewing the cookies, please and thank you!!!!
  10. hi there is this game i play and i am trying to accomplish a code which adds items coming from the games xml. the game is called zwinky and i'm having a small problem which can maybe be easily fixed. Here are the codes: http://paste.ee/p/JHMow http://paste.ee/p/pIEUt they are written differently. Okay So the problem is a little message when used on my webhost comes up on browser saying : "HTTP/1.1 100 Continue HTTP/1.1 200 OK Date: Sat, 24 May 2014 22:52:31 GMT Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8c DAV/2 mod_jk/1.2.28 Cache-Control: max-age=0, must-revalidate Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: anx="os=-&g=-&oc=-&sn=dfprdzwinky4&od=none&op=-&fv=1400971951270&ob=-&om=-&lv=1400971951270&ok=-&nv=1"; Version=1; Domain=.zwinky.com; Max-Age=7776000; Expires=Fri, 22-Aug-2014 22:52:31 GMT; Path=/ Content-Language: en-US Content-Length: 92 Connection: close Content-Type: application/xml;charset=UTF-8 User not signed in" as you can see it says "user not signed in" yet i am signed in into the game.. So i believe somewhere in the code the cookies are wrong or the code doesn't have the necessary elements to show that you are being logged in. to get the cookies/ login info you need to create a game account which takes 10-20 seconds: http://registration.zwinky.com/registration/register.jhtml and then using fiddler/charles or any other method displaying the accounts cookies it should show them up. I don't know what is needed to add to the code to make it work here our other topics on this issue never solved which might help: http://forum.ragezone.com/f144/help-920369/ http://www.webdeveloper.com/forum/showthread.php?268129-php-execute if anyone could help please! it's not hard making the game accounts and viewing the cookies, please and thank you!!!!
  11. i need help with a login i have on my site. I'm new to this so i dont know if i'll get any help
  12. <input onkeyup="s?e=Date.now():s=Date.now()"onblur="c=this.value.length;this.value+=c/(e-s)"><script>s=0</script> <script>s=0</script> Once this executes - it's completely needless. But without s=0 there are no s, e variables. With = OK. How is it logically possible to reduce keeping it short?
  13. does anyone know a class that can generate a menu with category and subcategory that connects to mysql with pdo ? thank you
  14. can someone help me?can you make this script?i dont make the script yet. when i click set as correct..., clicked response become correct answer and the other become default. thanks in advance, sorry for my bad english. iam indonesian.
  15. Hi, Could someone explain me how the websites stats & values are made like in: http://www.sitevalor.com or http://www.websiteoutlook.com ? Do i need a special class/library for this ? Thanks.
  16. Hi, I am trying to run a script using the php exec command. It is called 'Drush'. You might be familiar with it. It's a way to perform certain tasks on a Drupal site using the command line (bypassing Apache). Anyway, when executing my drush command in the terminal manually it works just fine. But when executing it using exec() it doesn't seem to be able to find Drush. I set all the permission of the directory and all its contents to 777 and it is still not working. I am also calling drush using the entire path and not just drush as specified in .bash-profile. Example: /Applications/drush/drush --root="/Applications/MAMP/htdocs" --uri="client2.drupal.local" usu "nodes" Where usu is a custom command and nodes is an argument. Again.., this works just fine when run manually in the terminal. Just not when executed using exec(). I tried executing 'ls' and that does work... Does anybody have any idea what could be the problem here? Thanks! Roderick
  17. Could anyone explain why my script just isnt working? I dont understand PHP and would be enterally greatful. Im told Parse error: syntax error, unexpected T_ECHO in /home/content/65/11493065/html/PHP/html_form_send.php on line 265 which is the echo at the end Many thanks <?php /* subject and email variables */ $subject = 'form completion'; $to = 'office@english-centre.co.uk'; /* gathering data variable */ $name = $_POST['name']; $telephone = $_POST['telephone']; $email = $_POST['email']; $type = $_POST['type']; $ability = $_POST['ability']; $previous_lessons = $_POST['previous_lessons']; $comments = $_POST['comments']; $found_site = $_POST['found_site']; $body = <<<EOD <br><hr><br> Client Name: $name <br> Telephone: $telephone <br> Email: $email <br> Intrested in: $type <br> Current ability: $ability <br> Previous lessons: $previous_lessons <br> Any comments: $comments <br> found site through: $found_site <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail ($to, $subject, $body, $headers); /* results rendered as HTML */ $theResults = <<<EOD <HTML> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- #BeginTemplate "Template.dwt" --> <head> <meta content="en-gb" http-equiv="Content-Language"> <!-- #BeginEditable "doctitle" --> <title>The English Centre 07905080578</title> <!-- #EndEditable --> <title>The English Centre</title> <link rel="stylesheet" href="../JS/gilbitron-Lean-Slider-ffe9a31/demo/style.css" type="text/css" media="screen" /> <script src="../JS/gilbitron-Lean-Slider-ffe9a31/demo/scripts/modernizr-2.6.1.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script src="../JS/gilbitron-Lean-Slider-ffe9a31/lean-slider.js"></script> <link rel="stylesheet" href="../JS/gilbitron-Lean-Slider-ffe9a31/lean-slider.css" type="text/css" /> <link rel="stylesheet" href="../JS/gilbitron-Lean-Slider-ffe9a31/demo/sample-styles.css" type="text/css" /> <link href="../CSS/styles.css" rel="stylesheet" type="text/css" media="screen"> <style type="text/css"> .auto-style1 { margin-bottom: 1em; } </style> </head> <body> <div id="wrapper"> <div id="top"> <div id="logo"> <img alt="English Centre" height="220" src="../Images/book-covered-in-uk.jpg" width="606"></div> <div id="language"> <h3 class="auto-style1">The English Centre </h3><br>07905080578<br> <a href="mailto:Office@english-centre.co.uk"> Office@english-centre.co.uk</a><br><br>Language Select<br><br> </div> </div> <div id="topna"> <ul> <li><a href="../default.html" class="button">Home</a></li> <li><a href="../French/default.html" class="button">About Us</a></li> <li><a href="courses.html" class="button">Courses</a></li> <li><a href="Teachers.html" class="button">Teachers</a></li> <li><a href="FAQ.html" class="button">FAQ</a></li> <li><a href="Contact.html" class="button">Contact</a></li> </ul> </div> <div class="slider-wrapper"> <div id="slider"> <div class="slide1"> <img src="../Images/big ben.jpg" alt="" /> </div> <div class="slide2"> <img src="../Images/main/hills.jpg" alt="" /> </div> <div class="slide3"> <img src="../Images/main/talking people.jpg" alt="" /> </div> <div class="slide4"> <img src="../Images/main/towerbridge.jpg" alt="" /> </div> </div> <div id="slider-direction-nav"></div> <div id="slider-control-nav"></div> </div> <script type="text/javascript"> $(document).ready(function() { var slider = $('#slider').leanSlider({ directionNav: '#slider-direction-nav', controlNav: '#slider-control-nav' }); }); </script> <div id="subbanner"> <marquee behavior="scroll" direction="left"><img alt="English lessons" height="72" src="../Images/main/scroll%20text.jpg" width="1188"></marquee> </div> <!-- #BeginEditable "Content" --> <div id="wrapper0"> <div id="content"> <h1>Contact Us</h1> <p>To find out more information complete the form and we will be in touch soon</p> <div id="form" style="width: 673px"> <form name="feedback" action="../PHP/html_form_send.php" method="post" style="width: 638px"> <ol> <li> <label for="name">Name</label> <input type="text" name="name" id="name"> </li> <li> <label for="telephone">Telephone</label> <input type="tel" name="telephone" id="telephone"> </li> <li> <label for="email">Email</label> <input type="email" name="email" id="email"> </li> <li> <label for="type">Type of Lesson</label> <select name="type"> <option value="single">Single Lessons</option> <option value="package">Lesson Package</option> <option value="friends">Learn with a Friend</option> </select></li> <li> <label for="ability">Current ability</label> <select name="ability"> <option value="beginner">Beginner</option> <option value="beyond beginner">Beyond Beginner</option> <option value="intermediate">Intermediate</option> <option value="fair">Fair</option> <option value="fluent">Fluent</option> </select></li> <li> <label for="previous_lessons">Previous Lessons?</label> <select name="previous_lessons"> <option value="no">No</option> <option value="school only">Learned only in School</option> <option value="over5years">Over 5 Years ago</option> <option value="5years">last 5 Years </option> <option value="2 years">Last 2 Years</option> <option value="pc only">Only on the Computer</option> </select></li> <li> <label for="comments">Comments</label> <textarea name="comments" style="width: 278px; height: 117px"></textarea> </li> <li> <label for="found_site">How did you find us?</label> <select name="found_site"> <option value="google">Google</option> <option value="bing">Bing</option> <option value="yahoo">Yahoo</option> <option value="gumtree">Gumtree</option> <option value="friend">Friend</option> <option value="flyer">Flyer</option> <option value="advert">Advert</option> <option value="other">Other</option> </select></li> <li> <label for="send">Send it</label> <input name="Submit1" type="submit" value="submit" /> </ol> </form> <h2 style="width: 667px"> Our goal is to help you speak fluently!</h2> </div> </div> </div> <div id="wrapper1"> <div id="rightside" style="width: 292px"> <h2> Our Other Services</h2> <ul> <li>Proofreading <li>Dissertation Writing/Proofreading <li>Essay Writing Service <li>CV Writing Service <li>Essay Writing Skills Class <li>Business Plan Writing <li>Marketing Plan Writing <li>PowerPoint Writing </ul> <p> </p> <p>If you require our other services or would like to submit a CV to work for the English Centre please use the email above</p> <img alt="Learn English" height="253" src="../Images/main/students.jpg" width="313"></h3> </div> </div> <!-- #EndEditable --> <!-- #BeginEditable "right%20side" --> <!-- #EndEditable --> <div id="footer"> <p>© Copywrite 2013 - The English Centre, London, UK</p> </div> </div> </body> <!-- #EndTemplate --> </html> EOD echo "$theResults"; ?>
  18. I've written a basic bash script to test SSMTP, SSMTP works fine, but the script I wrote doesn't send the message correctly clear echo "sending mail" echo "who are you sending it to?" read $to echo echo "excellent, now what is the subject?" read $subject echo echo "marvelous, now write a quick message:" read $message echo To: $to > mail.txt echo From: emailbox >> mail.txt echo Subject: .$subject >> mail.txt echo $message >> mail.txt clear echo "ok, I will send this message for you..." ssmtp $to < mail.txt echo "message sent successfully!" thsi just creates the file without the variables in it for some reason can anyone spot where I've gone wrong? thanks
  19. Hello All, Well I am new to this forum and just came to get the answer of one question. :cool: I am working on building one PHP based site and have to add one feature to it. But I am not sure how I can achieve this. May be any of you can help me. Thanks in advance, here's the thing I wanna achieve:- My site has total 2 pages. On one page there is one form where user will enter one "ID" for ex. "ID1234", as soon as he entered this, the whole site [of 2 pages] must be duplicated with this new ID used in domain. Ex. If my site name is "www . mywebsite . com", then a duplicated site must have this kind of link "www . mywebsite . com/ID1234" or "www . mywebsite . com/?R=ID1234". I have to urgently make this thing work out. All the responses will be appretiated. Thank you
  20. The first block of code is what i want to use since i know it works, but i dont know how to use it with the code already there. <?php if (strpos($_SERVER['REQUEST_URI'], 'upload.php') == false) { echo 'the stuff below is removed, or if the URL is something else, its not removed' ?> This code is already in my form and can not be changed!!! This is what I want to remove totally if the URL is upload.php <div class="navbar" name"navbar" Id="navbar"> <div class="navbar-inner" name="navbar-inner" Id="navbar-inner">' <?php echo a_view('core/account/login_dropdown'); ?> <?php echo a_view_menu('topbar', array('sort_by' => 'priority', array('menu-hz'))); ?> <?php echo a_view('search/search_box', array('class' => 'search-header')); ?> </div> </div> Can anyone help?
  21. I'm a newb. I uploaded and installed a script and inserted the correct info to direct it to my MySQL database. Then I deleted all of it but then later decided to upload and install that same script again. The installation file is an install.php file contained in an 'install' folder. After directing my browser to install.php again it came up with a bunch of MySQL errors and will not let me install again. I then deleted that MySQL database and created a new one and also once again deleted everything and again re-uploaded the script. Once again it comes up with a bunch of MySQL errors and will not let me install. The errors look like this: "Warning: SK_MySQL::connect() database connection failed in /home/content/...API/MySQL.class.php on line 17" and "Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/content/...API/MySQL.class.php on line 35". It looks like it's trying to connect to that old database but how can it possibly be trying to do that if I deleted that old database and deleted everything on my site and re-uploaded a fresh script that has no connection or knowledge of that old database? I'm assuming there must be some file left on my site that I was not able to delete. I'm using Godaddy and I simply went into the FTP page and deleted everything on my site and even tried restoring the site to when I first obtained my hosting account.
  22. Hello coder buddies, I have made this table with all the dates of the years going upto 2063, to keep it simple, it contains 3 columns which have been pre-popluated, example as follows... Actual table AutoIncNo | BookingDate | Status The calendar is in 2 parts. 1) Calendar to select a date 2) A list menu to select the amount of nights they wish to stay. So I take the original date (the one they select) and rearrange the format to suit the table... PHP Code: $CalendarDate = str_replace("/", "-", "$CalendarDate"); $QueryDate = date("Y-m-d", strtotime($CalendarDate)); Connect to the database... PHP Code: include_once('../connect/connectdatabase.php'); Run the first query to check if the dates they require are available. $QueryDate is the date they select $NightsForQuery is the amount of nights they want to stay PHP Code: $CalendarQuery = mysql_query("SELECT * FROM BookingsCalendar WHERE BookingDate='$QueryDate' LIMIT 1"); while($row = mysql_fetch_array($CalendarQuery)) {$AutoInc = $row["AutoIncNo"];} $AutoInc2 = $AutoInc + $NightsForQuery - 2; $SelectDates = mysql_query("SELECT * FROM BookingsCalendar WHERE AutoIncNo BETWEEN $AutoInc AND $AutoInc2"); while($row = mysql_fetch_array($SelectDates)) { $AutoIncNo = $row["AutoIncNo"]; $BookingDate = $row["BookingDate"]; $Status = $row["Status"]; if ($Status == 'booked') { $LastBookedDate = $BookingDate; $LastAutoIncNo = $AutoIncNo; $Handle = 1; } } // End - while($row = mysql_fetch_array($SelectDates)) { if ($Handle !== 1) {echo 'DATES AVAILABLE >> WRITE BOOKING CODE';} So if the handle is not equal to 1 its fine and they can book, but, if the dates arn't available (i.e, $Handle == 1) I need to check the closest available dates either side (before and after) the date they wanted where the Status is 'available' for the amount of nights they wish to stay... So I set out to establish the first available date in either direction and thts where I got stuck. Looking at it I'm sure you could run a while loop to find the next available block inside the code above, but not sure how. PHP Code: $FirstDateQuery = mysql_query("SELECT * FROM BookingsCalendar WHERE Status='available' AND AutoIncNo < $LastAutoIncNo ORDER BY AutoIncNo DESC LIMIT $NightsForQuery"); while($row = mysql_fetch_array($FirstDateQuery)) { $AutoIncNo = $row["AutoIncNo"]; $BookingDate = $row["BookingDate"]; $Status = $row["Status"]; echo $BookingDate . ' '; } Which works, but, it selects the previous 4 rows individually. So for example, if someone tries to book from 2013.06.01 but cant because its 'booked' for the next 4 days, the above script runs and brings up 2013.05.31 - 2013.05.30 - 2013.05.29 - 2013.05.28 as a result. But if one of those dates are booked it will skip it and give me the next one (selecting as it is the next 4 that meet the condition 'available') So if say 2013.05.29 was booked it would show 2013.05.31 - 2013.05.30 - 2013.05.28 - 2013.05.27 missing out the day which is booked. Now the thing is that we need the next 4 rows together (undivided/continuous/without breaks in the dates) which are 'available'. If you have a better more efficient way or can adapt what is already here, that would be grand... My brain hurts lol. Thank you, L-Plate
  23. i am trying to make an update script using an xml with a login username / password authorization. i have never encountered one before one looking to see if anyone could point me in the right direction. any questions please ask matt
  24. Hi there, i'm busy with a project but know im stuck at some point. What i want to do is, when someone presses the home button it changes his color. How I wanted to do is swap from image 1 (white) to image 2 (blue). So the person can see on which page he/she is. But when i put this code into the website, it wont show nothing. When i press 2 times it will show the blue image. And when i press many times you see the white and blue image swapping. But it won't stand on the white image, only on the blue image Here is the code i use. --> <a href='' "<?php echo $this->createUrl("/admin/survey/sa/index"); ?>" onclick="edit()"><img id="img1" onclick="imageChange(this)"'<?php echo $sImageURL;?>home.png' alt='<?php $clang->eT("Default administration page");?>' /> <script type="text/javascript"> { var img1 = "/LimeSurvey/styles/scanyours/images/home.png"; var img2 = "/LimeSurvey/styles/scanyours/images/home1.png"; } { var imageChoice = 1; } function imageChange(element) { if (imageChoice == 1) { element.src = img2; imageChoice = 2; } else if (imageChoice == 2) { element.src = img1; imageChoice = 1; } } </script></a>
  25. Im trying to make a list of resources where it shows you how to make variable set like this: $user->option
×
×
  • 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.