Jump to content

OAFC_Rob

Members
  • Posts

    118
  • Joined

  • Last visited

Everything posted by OAFC_Rob

  1. I have an email address which when any emails are received they're use postfix to open a php file, which then on the first line execute php via linux. This works a treat and then will do the parsing of the email and upload attachments to my server. The issue is however, security at the moment the folder is set to 777 rights, NOT by me! #!/usr/bin/php -q <?php //run this php script, doing this we will be using user "nobody" I have tried setting up a new group and owner called upload but it doesn't work because at the point of execution we are set to linux's nobody user. I thought I could switch the user using the following command #! runuser -l upload -c /usr/bin/php -q <?php //my php script will now run However this didn't work! I have also tried altering the nobody alias to "upload" and then altered the folder owner and group to match this user, which didn't work. The only thing I have remotely got to work is setting the group to nobody allowing the file to upload to the server, but again this is not perfect because it seems there are three users required to upload hence why I tried to set up a new group. Any ideas would be appreciated, my usual stop of google isn't helping too much
  2. fixed it, the code previous had to many \r\n for the headers aftera bit of trail and error on my server. Then it came through as a blank email after further investigation it was because I needed an extra \n for each boundary, bloody hell that was annoying to hunt down! Hope this helps anyone who might have the same problem. $this->mimeBoundary = "Multipart_Boundary_x".md5(time())."x"; $this->headers = "From: ".$this->from."\r\n"; $this->headers .= "MIME-Version: 1.0\r\n"; $this->headers .= "Content-Type: multipart/alternative; boundary=".$this->mimeBoundary."\r\n"; $this->headers .= "Content-Transfer-Encoding: 7bit". "\r\n"; $this->body = "This is a multi-part message in MIME format.\r\n"; $this->body .= "--".$this->mimeBoundary."\r\n". "Content-Type: text/plain; charset=\"iso-8859-1\" Content-Transfer-Encoding: 7bit\r\n\n". $this->textTemplate."\r\n"; $this->body .= "--".$this->mimeBoundary."\r\n". "Content-Type: text/html; charset=\"iso-8859-1\" Content-Transfer-Encoding: 7bit\r\n\n". $this->htmlTemplate."\r\n". "--".$this->mimeBoundary."--\r\n";
  3. Sorry it's taken me ages to actually get back to this issue. I have managed to get the mail class to now send the mail, it seems that my hosting company was blocking the mail for being spam because the email address in the freom section wasn't setup. Now I'm having issues with the multipart boundaries, it is outputting the entire html code etc... $this->mimeBoundary = "Multipart_Boundary_x".md5(time())."x"; $this->headers = "From: ".$this->from."\r\n\r\n"; $this->headers .= "MIME-Version: 1.0\r\n\r\n"; $this->headers .= "Content-Type: multipart/alternative; boundary=".$this->mimeBoundary."\r\n\r\n"; $this->headers .= "Content-Transfer-Encoding: 7bit". "\r\n\r\n"; $this->body = "This is a multi-part message in MIME format.\r\n\r\n"; $this->body .= "--".$this->mimeBoundary."\r\n". "Content-Type: text/plain; charset=\"iso-8859-1\" Content-Transfer-Encoding: 7bit\r\n". $this->textTemplate."\r\n"; $this->body .= "--".$this->mimeBoundary."\r\n". "Content-Type: text/html; charset=\"iso-8859-1\" Content-Transfer-Encoding: 7bit\r\n". $this->htmlTemplate."\r\n". "--".$this->mimeBoundary."--";
  4. Hi, I'm having issues with a multipart boundary mail class I've written, I believe the reason it won't send is because the header information is wrong somewhere but I can't seem to spot it. $this->mimeBoundary = "==Multipart_Boundary_x".md5(time())."x"; $this->headers = "MIME-Version: 1.0\r\n"; $this->headers .= "From: ".$from."\r\n"; $this->headers .= "Content-Type: multipart/alternative; boundary=\"".$this->mimeBoundary."\""; $this->body = "This is a multi-part message in MIME format.\r\n"; $this->body .= "--".$this->mimeBoundary."\r\n"; "Content-Type: text/plain; charset=\"iso-8859-1\" Content-Transfer-Encoding: 7bit\r\n". $this->textTemplate."\r\n"; $this->body .= "--".$this->mimeBoundary."\r\n". "Content-Type: text/html; charset=\"iso-8859-1\" Content-Transfer-Encoding: 7bit\r\n". $this->htmlTemplate."\r\n". "--".$this->mimeBoundary."--\r\n"; return mail($to, $subject, $this->body, $this->headers);
  5. This isn't in the php.ini file though extension=php_mysql.dll would I need to add it and where? Also Can you use msqli with a mysql database??
  6. Hi, I'm having some issues with my Mysql driver, Zendframeworks is telling me that the driver isn't installed and also on another project tail is stating that it cannot use mysql_connect, which I'm presumming is the same issue. I am running PHP 5.3 and I know that they have altered the way MySQL works in this version but I thought I had it setup correctly in my PHP.ini I have read that you're suppose to have the following line uncommented in the php.ini extension=php_pdo_mysql.dll extension=php_pdo_mysql.so Is this still the case in php 5.3? As when I search for these lines vi and nano both cannot find them, so should I add them? Also another thing I read was the following; However, running php (5.3) as an apache (2.2) module on my machine (windows 7), it still wouldn't work. I figured out the extension_dir value in php.ini needs to be set using an absolute path (relative just wouldn't work)! However, when I uncommented and changed extension_dir from ./ to / and restarted, it caused the zend to fall over and die. Any ideas of what I am missing in my PHP.ini pretty sure thats where the issue lies.
  7. I've had to copy over a a script from another developer and tried to get it running on my machine, but my php error log keeps coming back with the following; b74a6000-b75bc000 rw-p 00000000 00:00 0 b75bc000-b76f0000 r-xp 00000000 fd:00 786556 /usr/lib/libnss3.so b76f0000-b76f3000 r--p 00134000 fd:00 786556 /usr/lib/libnss3.so b76f3000-b76f5000 rw-p 00137000 fd:00 786556 /usr/lib/libnss3.so b76f5000-b76f9000 rw-p 00000000 00:00 0 b76fe000-b7703000 r-xp 00000000 fd:00 918366 /usr/lib/php/modules/pdo_sqlite.so b7703000-b7704000 rw-p 00004000 fd:00 918366 /usr/lib/php/modules/pdo_sqlite.so b7704000-b7705000 rw-p 00000000 00:00 0 bfd51000-bfd66000 rw-p 00000000 00:00 0 [stack] [Fri Sep 07 10:01:35 2012] [notice] child pid 1310 exit signal Aborted (6) I'm still learning linux command line stuff, and how to setup php etc... so go easy on me Does this mean I am missing some files / configs or have I got something different setup to the other developer. Also the reason I am having to have a look at it is because he is away on holiday and something he usually runs locally isn't working. On his machine I have determined that it is an issue when setting up an PDO object for an external database connection.
  8. I have decided to have a bash at teaching myself Zend frameworks, the inital setup etc... has gone smoothly but I want to use MySQL and not SQLite as shown in the quickstart tutorial. I have enabled PDO_mysql in my php.ini file which wasn't there to start with and I have add what I thought was correct lines of code into the confirgation file see below [production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "Application" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 0 resources.view[] = resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" resources.db.adapter = "PDO_MYSQL" [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1 resources.db.adapter = "PDO_MYSQL" resources.db.params.host = "localhost" resources.db.params.username = "root" resources.db.params.password = "password" resources.db.params.dbname = "test" However this doesn't seem to be working and throwing back the following error message Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but the extension is not loaded' in /var/www/spider-content/library/Zend/Db/Adapter/Pdo/Abstract.php:342 Stack trace: #0 /var/www/spider-content/library/Zend/Db/Adapter/Abstract.php(247): Zend_Db_Adapter_Pdo_Abstract->setFetchMode(2) #1 /var/www/spider-content/library/Zend/Db.php(270): Zend_Db_Adapter_Abstract->__construct(Array) #2 /var/www/spider-content/library/Zend/Application/Resource/Db.php(142): Zend_Db::factory('PDO_MYSQL', Array) #3 /var/www/spider-content/library/Zend/Application/Resource/Db.php(154): Zend_Application_Resource_Db->getDbAdapter() #4 /var/www/spider-content/library/Zend/Application/Bootstrap/BootstrapAbstract.php(683): Zend_Application_Resource_Db->init() #5 /var/www/spider-content/library/Zend/Application/Bootstrap/BootstrapAbstract.php(626): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('db') #6 /var/www/spider-content/library/Zend/Application/Bootstrap/Bootst in /var/www/spider-content/library/Zend/Db/Adapter/Pdo/Abstract.php on line 342 I have had a look around and can't seem to find a solution to this problem, has anyone got any ideas??? I'm pretty stuck at the moment :'(
  9. I have a css drop down menu working on a ui called menuFirstLevel with the li then achors called navMain then within that li another ul called menuSecondLevel again with li's and just achors this time. It all works perfectly on firefox and IE, but not on chrome and IE im usually good with css but struggling a little bit with this one, any ideas? CSS /* MENU / NAVIGATION LINKS */ div#navContainer { width: 980px; height: 50px; background-image: url('../images/container/topContainer2.jpg'); background-repeat: no-repeat; background-position: top left; } ul.menuFirstLevel { list-style-type: none; display: block; top: 20px; left: 85px; padding: 0px; z-index: 100; position: relative; list-style-type: none; width: 800px; height: 30px; list-style: none; } ul.menuFirstLevel li { float: left; border-top: 1px solid #252525; /*--Create bevel effect--*/ border-bottom: 1px solid #444; /*--Create bevel effect--*/ padding: 0; margin: 0; list-style: none; } ul.menuFirstLevel li:hover { position: relative; display: block; float: left; border-top: 1px solid #252525; /*--Create bevel effect--*/ border-bottom: 1px solid #444; /*--Create bevel effect--*/ padding: 0; margin: 0; } /* NAV LINKS FOR MENU */ ul.menuFirstLevel li a.navMain, ul.menuFirstLevel li:hover ul.menuSecondLevel { display: block; float: left; padding: 0px; width: 122px; height: 28px; margin: 0 5px 0 5px !important; margin: 0 2px 0 2px; text-align: center; text-decoration: none; background-image: url(../images/container/bt.gif); background-position: top left; background-repeat: no-repeat; color: #313537; font-size: 13px; font-weight: bold; font-style: italic; line-height: 28px; z-index: 110; list-style: none; } ul.menuFirstLevel li:hover ul.menuSecondLevel, ul.menuFirstLevel li ul.menuSecondLevel { background-image: none; padding: 0; margin: 0; background-color: #313537; } /*HOVER EFFECT NORMAL */ ul.menuFirstLevel li a:hover, ul.menuFirstLevel li a:hover.navMain { color: #700c01; text-decoration: none; background-image: url(../images/container/btA.gif); background-position: top left; background-repeat: no-repeat; } /* MENU LEVEL 2*/ ul.menuFirstLevel li ul.menuSecondLevel { display: none; position: absolute; top: 29px; left: 0px; width: 122px; height: auto; background-color: #313537; } /* ENSURE THEY ALL HAVE BACKGROUND COLOUR */ ul.menuFirstLevel li ul.menuSecondLevel li { background-color: #313537; text-align: left; padding: 0; margin: 0; } ul.menuFirstLevel li ul.menuSecondLevel li a { padding: 0 0 0 10px; margin: 0; } ul.menuFirstLevel li:hover li { float: none; } ul.menuFirstLevel li:hover li a { font-size: 12px; font-weight: bold; font-style: normal; color: #e2dcdc; } /* LAST ELEMENT LEFT BLANK AND CORNERS ROUNDED ON IT */ ul.menuFirstLevel li ul.menuSecondLevel li.bottom { float: left; margin: 0; padding: 0; background-color: #313537; border-bottom: 1px solid #313537; border-radius: 0 0 10px 10px; -moz-border-radius: 0 0 10px 10px; /* Firefox 3.6 and earlier */ width: 122px; height: 5px; } ul.menuFirstLevel li li a:hover { color: #700c01; } HTML <div id="navContainer"><!--OPEN DIV FOR navContainer --> <ul class="menuFirstLevel"><!--OPEN DIV FOR UL MENU LEVEL 1 --> <li><a title="Home Page" href="/index.php" class="navMain"><span>Home</span></a></li> <li><a title="About Nordmanni" href="/about/" class="navMain"><span>About Us</span></a> <ul class="menuSecondLevel"> <li><a title="Nordmanni History" href="/about/"><span>Group History</span></a> <li><a title="Nordmanni Events" href="/events/"><span>Events</span></a> <li><a title="Viking, Saxon, Celt Images" href="/gallery/"><span>Gallery</span></a> <li class="bottom"></li> </ul> </li> <li><a title="Contact" href="/contact/" class="navMain"><span>Contact</span></a> <ul class="menuSecondLevel"> <li><a title="Enquiry" href="/contact/"><span>Enquiry</span></a> <li><a title="Book Viking, Saxon, Celtic Group" href="/book-us/"><span>Book Us</span></a> <li><a title="Membership Types" href="/membership/"><span>Membership</span></a> <!--<li><a title="Nordmanni Freqeuntly Asked Questions (FAQ)" href="/faq/"><span>FAQs</span></a>--> <li><a title="Nordmanni Links" href="/links/"><span>Links</span></a> <li class="bottom"></li> </ul> </li> </ul><!--CLOSE DIV FOR UL MENU LEVEL 1 --> </div><!--CLOSE DIV FOR navContainer -->
  10. I am trying to get the jQuery ui slider handles if dragged to meet, to keep a minimum distance apart of say 50, so it would look like 50 - 100 on a rnage from 0 to 200. I have done this with no problems really, but my next bit is a bit harder and I can't seem to find anything on the web that is helpful. What I want to happen, if a user clicks and drags the first ui handle, the second will increment as well keeping that gap of 50 unless the range max value is met. Here is the code I've got; $("#priceRange").slider({ range: true, min: 50, max: 1000, values: [50, 500], step: 50, slide: function(event, ui){ priceMin = ui.values[0]; priceMax = ui.values[1]; if((priceMax-priceMin)<50){ return false; } }); And here is an exmaple I saw on a website, which makes me believe it is possible. http://www.allsaints.com/men/new/?WT.ac=ss12mens/ Please help me before I go insane!!
  11. I have a funcytion which get the height of the div and I want this function to be running while the slidToggle effect is taking place, anyone have any ideas? If I run it before it looks gittery, if I run with the callback function it looks jittery. This is the function taken out of the function and running at the callback. So ideally it should be a smooth transition with the div sliding down and the height of another div adjusting. $('.accordionHeader').click(function() { $(this).toggleClass('accordionHeaderActive'); $(this).next().slideToggle('slow', function(){ contentHeight = $(".content").outerHeight(); height = (contentHeight-500); //$("#adjuster").animate({"height" : height},"fast"); $("#adjuster").css('height', height); }); return false; }).next().hide();
  12. Think that would be hard to do, because of all the css. I seem to have a working solution now, luckly but would have liked to know the reasoning behind it. Could flotas be affecting it?
  13. Right I have an update, nto a full solution / explaination of what is going on but a hack around it. When I do dump out the height of the content container on document.ready it is something like 949 but when I have mousemove on document it comes out at the true height of the content container which is something like 271. I have ensured the parent divs etc... all have height set to auto but that doesn't seem to have helped. Any ideas of what is going on?? Coding $(document).ready(function() { $("#test").html($(".content").height()); $(document).mousemove(function() { $("#test").html($(".content").height()); }); });
  14. I am trying to get the height of a div as the layout stay the same, but content alters from page pushing down a advert. I know I can use the following; $(".mainGenericContentContainer").css("height") to get the pixel height of the div $(".mainGenericContentContainer").height() to get the height, but can have a few issues across browsers $(".mainGenericContentContainer").outerHeight() to get the height ignoring margins, padding etc.. $(".mainGenericContentContainer").innerHeight() to get marging, padding and height of the div So I thought it would be pretty simple target the div, get the height and alter the top of the relative div containing my advert. However the height returned for my div is something like 1146 when firebug under the layout section says the computed box height is 356 I have looked at the div and a direct height isn't being set with it inheriting from the parent, but a min height is being set. When I manually force the height to 500px on the div it seems to work. Any ideas of how to get around this issue
  15. Yeh, just realised that this morning, after sleeping on it, going to give it a bash when I get home tonight. Thanks for the help
  16. No DOesn't seem to be # # Virtual Hosts # # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.2/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # Use name-based virtual hosting. # ##NameVirtualHost *:80 # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # ##<VirtualHost *:80> ##ServerAdmin postmaster@dummy-host2.localhost ##DocumentRoot "C:/xampp/htdocs/dummy-host2.localhost" ##ServerName dummy-host2.localhost ##ServerAlias www.dummy-host2.localhost ##ErrorLog "logs/dummy-host2.localhost-error.log" ##CustomLog "logs/dummy-host2.localhost-access.log" combined ##</VirtualHost> <VirtualHost *:80> ServerAdmin postmaster@dummy-host.localhost DocumentRoot "C:/xampp/htdocs/duff3/" ServerName hannahduff ServerAlias hannahduff ErrorLog "logs/hannahduff.localhost-error.log" CustomLog "logs/hannahduff.localhost-access.log" combined </VirtualHost> <VirtualHost *:80> ServerAdmin postmaster@dummy-host.localhost DocumentRoot "C:/xampp/htdocs/innovationation/" ServerName innovationation ServerAlias innovationation ErrorLog "logs/innovationation.localhost-error.log" CustomLog "logs/innovationation.localhost-access.log" combined </VirtualHost>
  17. In the hosts file?? Yes, but it is this way around 127.0.0.1 innovationation
  18. Yeh I swapped them around and did exactly waht you said, so how do i fix it
  19. Yes I'm editing the following files; C:/xampp/apache/conf/extra/http-vhosts C:/Windows/System32/drivers/etc Yes I have stop apache, waited a few secons, freshed the browser to get an erorr, started, and refreshed the browser to get the same site Yes it is showing the document root for hannahduff
  20. Okay, i've done this at work the other week, its been a very very long day and im at home trying to set some virtual hosts up and for the life of me cant see what the hell is going wrong; It keeps opening up both hosts to the same document root, when they are set differently httpd-vhosts in xampp file <VirtualHost *:80> ServerAdmin postmaster@hannahduff.localhost DocumentRoot "C:/xampp/htdocs/duff3" ServerName hannahduff ServerAlias hannahduff ErrorLog "logs/hannahduff.localhost-error.log" CustomLog "logs/hannahduff.localhost-access.log" combined </VirtualHost> <VirtualHost *:80> ServerAdmin postmaster@dummy-host.localhost DocumentRoot "C:/xampp/htdocs/innovationation" ServerName innovationation ServerAlias innovationation ErrorLog "logs/innovationation.localhost-error.log" CustomLog "logs/innovationation.localhost-access.log" combined </VirtualHost> hosts file within system32/drivers/etc # Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost 127.0.0.1 innovationation 127.0.0.1 hannahduff
  21. Doesn't matter i've figured it all out now, the event.preventDefault(); wasn't need the return false needed to go before the css display block and I needed an else part to the statement to submit the form if no errors
  22. I have found a work around, get the validation to run on the button click and if errors event.preventDefault(); If anyone can explain why the first bit wouldn't work that would be brilliant.
  23. Do you mean you want some content to like a loading screen to appear if that field has been clicked or submited or whatever? If so an easy way to do it is have another get loaded up on the some event, passing a get variable through and then on the AJAX page have in PHP if variable is set then show loader. for example $.get("ajax/cashier_entry.php?loader="+id, function(loader) { $('#showLoader').html(loader); }); Or it coudl be done by having the laoder etc... pre coded on the page and have the CSS display set to none and if something hasn't happened ie XMLHTPP request is still loading via your get then show the loader, not too sure how to do this in jQUERY but javascript it is easy as, and rememer you can swap it about by putting javascript in jQuery. Hope that helps if I have understood ur issue correctly
×
×
  • 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.