Jump to content

Ricky55

Members
  • Posts

    100
  • Joined

  • Last visited

  • Days Won

    1

Ricky55 last won the day on July 21 2016

Ricky55 had the most liked content!

Contact Methods

  • Website URL
    http://www.qwerty-design.co.uk/

Profile Information

  • Gender
    Male
  • Location
    Yorkshire UK

Ricky55's Achievements

Regular Member

Regular Member (3/5)

2

Reputation

  1. Thanks man. He's now saying this can be done in the Apache config using two ports. Getting a bit out of my depth to be honest.
  2. Hi guys, I have hired a developer to help me create an e-commerce project using Laravel. The customer admin and checkout were written by an in house dev that has since left who wrote these outside of Laravel, using Laravel for just the main admin to control orders etc. I told the new dev to throw away anything that didn’t make good sense or fit with modern best practices. He kept the two sections outside of Laravel, although he is using Laravel for authorisation. Looking at his code I have lost all confidence, I’m no expert but he has functions all over the place, repeated in different files there’s no OOP it looks a mess then yesterday he announced that I’d need two instances of php running on my server to get the site to even work. Not two different versions, the same version. I’ve never even heard of this. He said one for Laravel and one for the other parts of the site. Long story I know but what do you guys think? Is this possible? Is it a bad idea? What do you think of what I’ve said? I’ve googled around and it seems possible to run two different versions of php but that’s not what he’s talking about. Any advice very welcome and sorry if I’ve posted in wrong category. Thanks Richard
  3. Hi guys sorry for being a total noob but when I type this code I'm getting an error. Should this be wrapped in a if ? <?php $selector = (isset($_GET['selector']) ? isset($_GET['selector'] : false; switch($selector) { case 'supreme': $href = '/folding-beds/browse-by/supreme'; $text = 'Supreme Collection'; break; case 'deluxe': $href = '/folding-beds/browse-by/deluxe'; $text = 'Deluxe Collection'; break; case 'airflow': default: $href = '/folding-beds/browse-by/airflow'; $text = 'Beds with Airflow Fibre Mattresses'; break; } ?>
  4. As per usual you guys didn't let me down, best forum on the web is this IMO and I'm not just saying that. You can keep your Stack Overflow with their over restrictive rules. Thanks so much guys I really mean that. I do help people with stuff I know, I'm not just one of these lazy sods. I think I'll use Pyscho's suggestion. Mac_gyver yours looks cool but I don't fully understand it :-) Once again thanks!!!! Ps There are 10 options thats why I asked!
  5. Hi guys I only use PHP every now and again so my knowledge is basic at best. I have this code which is working. I was just wondering if there was a better way of writing this. <?php if(isset($_GET['selector'])) { $selector = $_GET['selector']; } if ($selector == 'airflow') { $href = '/folding-beds/browse-by/airflow'; $text = 'Beds with Airflow Fibre Mattresses'; } if ($selector == 'supreme') { $href = '/folding-beds/browse-by/supreme'; $text = 'Supreme Collection'; } if ($selector == '') { $href = '/folding-beds/browse-by/airflow'; $text = 'Beds with Airflow Fibre Mattresses'; } ?>
  6. Thanks for the reply. I didn't think it was actually specific to the plugin. It's more related to just php than it is to the plugin. Surely all info is in my post to provide an answer?
  7. Hi guys I'm using WordPress and the advanced Custom Fields plugin. I have a basic loop that spits out the code for a slider. I'm using the image caption to populate the href of the link. Currently only the first image carries a caption and therefore a link. I need to set my code up so it uses the link when the caption exists and without the link when it doesn't. The advanced custom fields plugin does have a "if field exists" but I just don't know how to write the code. Posted below is my code. <?php $the_query = new WP_Query(array( 'post_type' => 'slider', 'posts_per_page' => '1', )); while ($the_query->have_posts()) : $the_query->the_post(); ?> <?php $images = get_field('image_gallery'); if($images) : ?> <!-- Flex Slider --> <div class="flexslider entry-thumbnail"> <ul class="slides"> <?php foreach ($images as $image) : ?> <li><a href="<?php echo $image['caption']; ?>" data-lity><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>"></a></li> <?php endforeach; ?> </ul> </div> <?php endif; endwhile; ?> This is the basic example the advanced custom fields plugin gives you to use the if field exists. <?php if( get_field('field_name') ): ?> <p>My field value: <?php the_field('field_name'); ?></p> <?php endif; ?>
  8. where else can it be configured? I was changing it in Plesk in the PHP settings.
  9. Hi guys Bit of a PHP noob and the dev I use is away on holiday and I've got a client screaming at me, the usual carry on :-( I'm getting the following error Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 32 bytes) in /var/www/vhosts/XXXXX.co.uk/httpdocs/os/system/database/drivers/mysql/mysql_result.php on line 167 The memory allocation was set to the default option of 128M I've tried increasing this to 2048M and it still errors. Php Info is reporting the new allocation too. Do I need to set this in the script? or restart the server? any tips would be massively appreciated. I think the app was created using Codeigniter, it uses the MVC framework anyway I know that much. (not sure if that has any bearing) Cheers guys.
  10. Guys just going back to the version, which would you recommend 5.5 or 5.6? A lot of my websites are wordpress if that has any bearing?
  11. oh I didn't realise it was an issue. I thought it sounded recent 5.3 to 5.4. Its my server actually so i better get that sorted. That worked by the way guys thanks very much. I just want to say that I find this the best forum I have use / used. You are all sound guys and are super quick and super helpful. Brilliant! Thanks Richard
  12. Hi guys I'm very much a PHP noob. I only use the very basics. I have the code below that I created with the help of this forum some time back. It just generates some random images. I've just uploaded this to my new server and all I get is a blank screen. I've tried displaying errors but none seem to display. My new server has PHP version 5.3.3 and my old server was using 5.4 I think. Can you spot anything that might be causing this issue? Is it something to do with that server root? Cheers in advance, as always any help will be very much appreciated. Richard <?php $root = $_SERVER['DOCUMENT_ROOT']; $path = '/_/images/brand-logos/'; $random = 4; $images = array_filter(glob($root . $path . "*.*"), function($v){ return in_array(strtolower(pathinfo($v, PATHINFO_EXTENSION)), ["gif", "jpg", "png"]); }); shuffle($images); $randomImages = array_slice($images, 0, $random); foreach($randomImages as $v) echo "<img src='" . substr($v, strlen($root)) . "' alt='" . ucfirst(pathinfo($v, PATHINFO_FILENAME)) . " Logo'>"; ?>
  13. Thanks guys. It turned out to be. Just wanted to also say how much I appreciate your answers. I've used this forum a few times and my questions have always been answered correctly and quickly. Great job guys. if(isset($_GET['varname'])) { $isTtex = $_GET['varname']; }
  14. Hi Guys PHP beginner here. I'm passing a variable via a link just so I can conditionally load some javascript. Its all working fine but I'm getting an undefined variable error. On my link I have: <form id="jtex" method="get" action="/folding-beds/"> <input type="hidden" name="varname" value="jtex"> <p><a href="javascript:{}" onclick="document.getElementById('jtex').submit(); return false;">View our range of J-Tex™ Folding Beds »</a></p> </form> Then on the page that this form links to I have $isTtex = $_GET['varname']; Then in my footer I'm using this code to conditionally load some javascript. <?php if (isset($isTtex)) : ?> // Run some JS <?php else : ?> // Run some other JS <?php endif; ?> I've turned off error reporting for a temp fix but I really want to fix properly. I've tried a few solutions I've found online but they seemed to prevent the variable being set at all. Should also say that this isn't anything to do with showing private data or anything like that so security is not a concern for this one. If you guys could shed any light I'd be very grateful. Thanks in anticipation. Ricky
×
×
  • 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.