Jump to content

gerkintrigg

Members
  • Posts

    830
  • Joined

  • Last visited

Everything posted by gerkintrigg

  1. I hope this is considered on topic. I currently use the Rockmelt web browser. If you have never heard of it, then you missed a great moment in the web because the Rockmelt browser will be switched off at the end of July. So I was wondering which browser do you use for day to day web programming? I've used Firefox and chrome before, but rock melt thrashed them all. It'll be horrible going down to something that's "okay", but it's time for a battle of the browsers. What do you all think? Neil
  2. Thanks, I'll look into that.
  3. My homepage twitter feed stopped working and I wonder whether it's something to do with the change in Twitter to the oAuth protocol? I have no idea where to start, so I think it may be best to find a system that actually works. My current one uses jQuery, but I'd like a pure PHP one so that I can access multiple accounts and use PHP to do it. Any suggestions?
  4. Does anyone here know of a good email marketing script that can do things like stack emails to lower server demand, or a tutorial to help me out? I'm pretty good with PHP but I want to save a bit of time if possible. Also, I want to do it in HTML.
  5. Hi everyone. I'm actually posting this because it took me ages to work it out and I figured others might benefit from it. It may not be the slickest way of making a breadcrumb trail for website navigation, but it's ideal for what I need. None of the other web examples did what I wanted, so hopefully you'll find this useful too. Just use it as an include: <div><a href="<?php echo $root;?>index.php">Whatever Site Name You Like </a> <?php $crumbs = explode("/",$_SERVER["REQUEST_URI"]); $crumb_count=0; $breadcrumb_root=$root; $my_path=trim($root,'/'); foreach($crumbs as $key=>$crumb){ #assign each link a number: $crumb_num=$key; #echo $crumb_num; #if the crumb number is not 0: if($crumb_num!='0'){ #set the crumb root: $breadcrumb_root.='/'.$crumb; $my_path.='/'.$crumb; ?> - <a href="<?php echo $my_path;?>"><?php #remove any variables: $crumb_no_q=explode("?",$crumb); $crumb=$crumb_no_q[0]; $crumb=str_replace('_',' ',$crumb); $crumb=ucwords(str_replace('.php','',$crumb)); echo $crumb; ?></a><?php } } ?></div>
  6. So I'll tell you what I want to do and the two ways I can see of doing it and then request help in achieving either of them because neither seem to work: The problem: I want to be able to add a flat discount to the total of a transaction using PayPal - in other words, I want to be able to have maybe five or six items in my cart and for the discount to be £35 and for that to appear as a negative figure (or a discount). Possible solution 1: To add an item as a discount item with effectively a negative value. I've tried adding a minus symbol and that fails. I've tried removing the whole discount from one item in the list, but there's no guarantee that any item will cost more than the discount - especially if there are lots of individual items. Possible solution number 2: To add a percentage discount to each item that corresponds to the total discount. This isn't as slick as I'd like and it poses problems of display because the figures would look different to the current checkout which states the discount as a lump sum rather than pro-rata. Suggestions welcome. I've looked through the documentation for paypal and there doesn't seem to be anything I can get to work.
  7. the sub cat selector is being invoked... I ended up doing it by href in the end (it's only for a back end system) but it's rather annoying that I can't get it working as a jump menu... I did it before with another form, but this is playing up.
  8. I'm making an ajax query to allow my select box to parse a selected id to an ajax query using this code: <select name="top_cat<?php echo $r['product_id'];?>" id="top_cat<?php echo $r['product_id'];?>" onchange="javascript: MyAjaxRequest('sub_cat_selector<?php echo $r['product_id'];?>','sub_cat_selector.php?id='+top_cat<?php echo $r['product_id'];?>.value);"> It doesn't work and I think I may be making a very silly mistake. Any suggestions?
  9. I am using Mod Rewrite too, but this creates a blank page to work from so they can customise it themselves. I'm fine with doing it this way and there are reasons for it which I won't go into now, but needless to say I need a subdirectory (a real one) for each new shop.The only issue is how to duplicate the file.
  10. I wrote a script to automatically generate a folder with an index page in it using data from a database record, but it only operates when the administrator activates the record. I've worked out nearly all of it, but is there a simple way to copy the original contents of the master file, but leave the original intact? I'm not getting any errors, and the directory is being created, but it's empty. So-far I have: $path_to_file=$root.$shop_name.'/index.php'; if(!file_exists($path_to_file)){ mkdir($root.$shop_name,'0777'); copy($root.'members/do-not-delete.php', $root.$shop_name.'/index.php'); } I can't see anything wrong with the code and all the Google snippets seem to suggest this is the way to do it. Help, please. Neil
  11. ini_set("memory_limit","128M"); Sorted.
  12. Yup. I guess then that the question is how'd I avoid the issue that reads: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 13056 bytes) in /home/ghostpub/public_html/includes/img_resize.php on line 31
  13. I have no idea what the problem / question is either, which is why I asked if I solved it...
  14. I have written an accounting web app to keep track of my receipts and I HATE paper junking up my office, so I added an image upload. I was hoping my iPhone can take the photo then and there and upload the record to the website for permanent backup and the receipt would go in the bin. Instead it says the image is too big. Is there an easy way to reduce the size of the image I'm uploading or should I change the PHP script to handle bigger uploads?
  15. Does this answer your question: $q="INSERT INTO accounting (`item_name`, `description`, `date`, `cost`, `sector` ) VALUES ( '$item_name', '$description', '$insert_date', '$cost', '$sector' );"; $sql=mysql_query($q); $record_id=mysql_insert_id(); if (!empty($_FILES['img']['tmp_name'])){ // for the main image: $image = new SimpleImage(); $image->load($_FILES['img']['tmp_name']); $image->resizeToWidth(600); $image->save($root.'members/admin/accounting/images/'.$year.'-'.$month.'-'.$day.'_'.$record_id.'.jpg'); $img='members/admin/accounting/images/'.$year.'-'.$month.'-'.$day.'_'.$record_id.'.jpg'; $q="UPDATE `accounting` SET `img` = '$img' WHERE `id`='$record_id';"; $sql=mysql_query($q); } $go='index.php'; header( 'Location: '.$go ) ; ?>
  16. I've got an ongoing problem with IE. It never seems to behave like any of the other browsers when it comes to CSS. Now, I have an issue with this page: http://pirantin.com/index.php where the drop downs just don't work. I don't want to have to re-code the whole thing, but I just don't understand why it's stopped working all of a sudden. Can anyone suggest anything?
  17. Hello! I am using CSS to nest a menu on this page: http://pirantin.com/index.php It's not displaying correctly in ...wait for it... da da daaaa! Internet explorer! Yes, our old friend Microsoft is acting up again. Can anyone here suggest a way of getting around it. I think it WAS working, but I don't know what happened. :o/ Thanks, Neil
  18. The Price column accounts for discounts and negotiation so yes it totals correctly. Thanks for the great advice. I now get it. :-)
  19. Hi Guys, I'm going to struggle to explain this, but I'll have a go. I want to use a database of book sales to work out which book has made the most money. I want to output all the books based on the sum of the database "price" field. I've tried multiple options, but none of them seem to do exactly what I need. I want the output to look like this: Book 1: ?75,000 Book 2: ?50,000 Book 3: ?25,000 I don't know if there's much point showing this code, but here it is anyway: <h2>Top Grossing Books</h2> <?php $q="SELECT `books`.`title`,`book_purchases`.`book_id`, SUM(`book_purchases`.`price`) as `book_sales_total` FROM `books`,`book_purchases` WHERE `currency`='p' AND `book_id`=`book_id` AND `books`.`id`=`book_purchases`.`book_id` ORDER BY `book_sales_total` DESC"; $sql=mysql_query($q); while($r=mysql_fetch_array($sql)){ echo $r['book_id'].': '.$r['book_sales_total'].'<br />'; } ?> I can't really get my head around this one and the Google Searches don't appear to help. Any advice?
  20. Array ( [Logged_In] => No [phpSESSID] => 553531b0c3b97a97a51bf7fab11ff507 [__utma] => 198886393.755584100.1324303205.1346139057.1346144284.339 [__utmb] => 198886393.92.9.1346146550090 [__utmc] => 198886393 [__utmz] => 198886393.1345877694.329.21.utmcsr=facebook.com|utmccn=(referral)|utmcmd=referral|utmcct=/l.php )
  21. Right... I'm not sure what I need to look at. It seems fine to me. But its not working.
  22. Hi all. I've got a simple logout script which used to work fine with sessions, bu as soon as I registered a cookie, everything started failing. I have tried this script on its own, but I just don't get it... Both the cookie and the session still says "Yes" - and that's not what's supposed to happen. Here's the code: session_start(); header("Cache-control: private"); //IE 6 Fix $root='../'; session_destroy(); session_unregister('Logged_In'); setcookie("Logged_In", 'No', time()-60); $go=$root.'logged_out.php'; echo 'Cookie: '.$_COOKIE['Logged_In']; echo '<br />Session: '.$_SESSION['Logged_In'];
  23. I'm trying to make a javascript calculator to work out if something is viable, but there's an issue with the formatting. I want to output a line break like I can with PHP, but Javascript doesn't want me to do it. I've tried \n and <br\/> but neither work. Please help. Here's my code: <script> function ViabilityCheck(){ // define the variables: var print_quote = document.getElementById('print_quote').value; var handling = document.getElementById('handling').value; var postage = document.getElementById('postage').value; var discount = document.getElementById('discount').value; var rrp = document.getElementById('rrp').value; var output_div_field = document.getElementById('output_div_field').value; // now work out the viabilty and put that out as a variable: var OurCut = ((rrp/100)*(100-discount)); var output_div = document.getElementById('output_div'); while( output_div.firstChild ) { output_div.removeChild( output_div.firstChild ); } var OVOurCut='Turnover Per Book: ?'+OurCut.toFixed(2); var OVGrossProfit='Turnover less the printing cost Per Book: ?'+(OurCut.toFixed(2)-print_quote); output_div.appendChild( document.createTextNode(OVOurCut+'<br\/>'+OVGrossProfit)); } </script>
  24. Is there an easy way to parse a CSS sheet as PHP? Maybe using htaccess or something?
  25. Hi all. I just want to know the name of the variable to tell PayPal (the stinking leviathan that it is) what my recurring payments are for. It currently shows my customer a blank description field! Urgh! Here's the code I have: <form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <input type="hidden" name="business" value="paypal@truro.com"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="no_shipping" value="1"> <input type="image" src="../../furniture/buy_now_web_btn.png" border="0" name="submit" alt="Buy Now with PayPal - it's fast, free and secure!"> <input type="hidden" name="a3" value="3.50"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <input type="hidden" name="src" value="1"> <input type="hidden" name="sra" value="1"> <input type="hidden" name="description" value="One month personal hosting"> </form> Other than that, it works fine... any suggestions, chaps?
×
×
  • 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.