
totallytech
Members-
Posts
42 -
Joined
-
Last visited
Everything posted by totallytech
-
Changed an else/if but now fails... What did I miss?
totallytech replied to totallytech's topic in PHP Coding Help
Hi, this is some code from whmcs but it is based on php... I was just hoping someone could follow through my code and see where I'd gone wrong.... -
Hey Guys, I'm doing some coding and I've managed to snip something off.... This is the original code <form method="post" action="{$systemsslurl}cart.php?a=add&domain=register"> <table class="table table-striped table-framed"> <thead> <tr> <th></th> <th>{$LANG.domainname}</th> <th class="textcenter">{$LANG.domainstatus}</th> <th class="textcenter">{$LANG.domainmoreinfo}</th> </tr> </thead> <tbody> {foreach from=$availabilityresults key=num item=result} <tr> <td class="textcenter">{if $result.status eq "available"}<input type="checkbox" name="domains[]" value="{$result.domain}" {if $num eq "0" && $available}checked {/if}/><input type="hidden" name="domainsregperiod[{$result.domain}]" value="{$result.period}" />{else}X{/if}</td> <td>{$result.domain}</td> <td class="textcenter {if $result.status eq "available"}domcheckersuccess{else}domcheckererror{/if}">{if $result.status eq "available"}{$LANG.domainavailable}{else}{$LANG.domainunavailable}{/if}</td> <td class="textcenter">{if $result.status eq "unavailable"}<a href="http://{$result.domain}" target="_blank">WWW</a> <a href="#" onclick="popupWindow('whois.php?domain={$result.domain}','whois',650,420);return false">WHOIS</a>{else}<select name="domainsregperiod[{$result.domain}]">{foreach key=period item=regoption from=$result.regoptions}<option value="{$period}">{$period} {$LANG.orderyears} @ {$regoption.register}</option>{/foreach}</select>{/if}</td> </tr> {/foreach} </table> <p align="center"><input type="submit" value="{$LANG.ordernowbutton} »" class="btn btn-danger" /></p> </form> and I've changed it to: <form method="post" action="{$systemsslurl}cart.php?a=add&domain=register"> {foreach from=$availabilityresults key=num item=result} {if $result.status eq "available"} <div style="width: 400px; color: #339933; font-size:14px;"><img src="/templates/dj/yes.jpg" style="float:left" />{$tld}<br />Available</div> <div style="width: 100px;" >{$name}<p style="color: #339933;">{$tld}</p></div> <div style="width: 200px;" ><select name="domainsregperiod[{$result.domain}]">{foreach key=period item=regoption from=$result.regoptions}<option value="{$period}">{$period} {$LANG.orderyears} @ {$regoption.register}</option>{/foreach}</select> <input type="submit" value="{$LANG.ordernowbutton} »" class="btn btn-danger" /></div> {/if} {if $result.status eq "unavailable"} <div style="width: 400px; color: #cc0000; font-size:14px;"><img src="/templates/dj/no.jpg" style="float:left" />{$tld}<br />Taken</div> <div style="width: 100px;" >{$domain}<p style="color: #cc0000;">{$tld}</p></div> <div style="width: 200px;" ><a href="http://{$result.domain}" target="_blank">WWW</a> <a href="#" onclick="popupWindow('whois.php?domain={$result.domain}','whois',650,420);return false">WHOIS</a></div> {/if} {/foreach}</form> The original code works fine and add to my cart, the new "updated" version fails... What have I done wrong?
-
Hi Guys, I've got a php script which has a standard header... the css fails to load though. My site is https://www.site1.com and the css is located on http://www.site2.com my css code is: <link rel="stylesheet" href="http://site2.com/style.css" type="text/css" media="screen" /> but for some reason it seems to fail.... Any ideas?
-
Hi Guys, I'm using some code to add to a shopping cart, you have to hard code the product details to the php so I have this <?php echo name="' . $image->alttext .'" options_name="Size" options="'.8x6:9.50;10x8:13.50.'" qty_field = "true" b_title="Add To Basket" ; The issue i have is with the options section : options="'.8x6:9.50;10x8:13.50.'" if I use options="8x6:9.50;10x8:13.50" then it only displays 8x6 - £9.50 and doesnt show the 10x8 one, If I add options="'.8x6:9.50;10x8:13.50.'" it breaks the code completely. Any ideas how I can code this?
-
Hey Guys, I'm looking for a basic php shopping cart. I dont want to have to set up products etc, I want to sell images on my website, so I'm setting up a php script to display the image and a simply add to cart button. I've been looking but everything needs products to be set up - I want to show different sizes on the site too. A customer visits and buys 8x6 img_001_12_13 x1 10x8 img_004_12_13 x1 etc etc, I just want to simply pass the variable 8x6 and img_001_12_13 to the cart Any ideas?
-
Hey Guys, I've got a database full of tables at the moment and I need to remove the first 2 characters from every single table. vbaccess = access vbaction = action etc etc its always removing "VB" from before the main table name I'm guessing its something like: RENAME TABLE `forum` . `access` TO `forum` . `vbaccess` ; But is there a way to do it en-mass, as there are currently 246 tables and dont fancy doing it manually. Any ideas?
-
Hi, I'm trying to create a script that will redirect to a url from a form input. Basically I have a page: http://mydomain.com/page (no .html or php etc) and I have an input box on my site - I want someone to be able to type in Joe Blogs and I'm looking to simply redirect to: http://mydomain.com/page/Joe%20Blogs How can I do this?
- 1 reply
-
- url redirect
- form
-
(and 2 more)
Tagged with:
-
Basic query - find a string within a string?
totallytech replied to totallytech's topic in PHP Coding Help
Ugh, scrub that... I was using it wrong! $pos = strpos($mystring, $current); should be $pos = strpos($current, $mystring); -
Hey Guys, I'm trying to run some code to say if the string "ims_image" is found do this.... else do that... I'm trying this: <?php $current = $_SERVER['REQUEST_URI']; $mystring = 'ims_image'; $pos = strpos($mystring, $current); echo "Search For " . $mystring . " within " . $current . "..... " . $pos; if ($pos !== false) { ?> echo '<div class="sidebar1">'; get_sidebar('gallery-left'); echo '</div>'; } else { } ?> Currently its failing - the echo output should say: Search For ims_image within /demo/ims_image/iwp-12-15-0011..... then either true or false but its blank.... just says Search For ims_image within /demo/ims_image/iwp-12-15-0011..... Am I using the wrong method of searching the string?
-
Hey Guys, I'm using a script within my wordpress site, but the author is not responding to any questions so I'm hoping someone here could help me out... One gallery I uploaded has 280 images, When viewing the gallery I see the first 20 images and just a simple “More Images” and “Previous Images” links. Is there a way to set it so it displays something like: Images 1-20 of 280 displayed. Results: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Next >> function display_galleries() { //allow plugins to overwrite output $output = apply_filters('ims_before_galleries', '', $this->gallery_tags, $this); if ('' != $output) return $output; extract($this->gallery_tags); global $post, $wp_query; $attach = ( (!empty($this->opts['attchlink']) && empty($this->meta['_to_attach'][0])) || !empty($this->meta['_to_attach'][0])); if (!empty($post->post_excerpt) && $this->in_array($this->imspage, array('photos', 'slideshow'))) $output = '<div class="ims-excerpt">' . $post->post_excerpt . '</div>'; $output .= "<{$gallerytag} id='ims-gallery-" . $this->galid . "' class='ims-gallery' itemscope itemtype='http://schema.org/ImageGallery'>"; foreach ($this->attachments as $image) { $title = get_the_title($image->ID); if (!empty($image->post_parent)) { $title = get_the_title($image->post_parent); $link = get_permalink($image->post_parent); } elseif ($attach) { $link = get_permalink($image->ID); } else { $image->meta['class'] = 'photo ims-colorbox'; $link = $this->get_image_url($image->ID); } $image->meta += array( 'link' => $link, 'alt' => $title, 'caption' => $title, 'title' => $title); $output .= $this->image_tag( $image->ID, $image->meta ); } $output .= "</{$gallerytag}>"; $wp_query->is_single = false; $output .= '<div class="ims-navigation">'; $output .= '<div class="nav-previous">' . get_previous_posts_link(__('<span class="meta-nav">←</span> Previous images', 'ims')) . '</div>'; $output .= '<div class="nav-next">' . get_next_posts_link(__('More images <span class="meta-nav">→</span>', 'ims')) . '</div>'; $output .= '</div><div class="ims-cl"></div>'; $wp_query->post_count = 1; $wp_query->is_single = true; $this->visited_gallery(); //register visit return $output; } I believe that is the code that actually writes the pagination area, I'm happy to post any other code if needed. Can anyone help me out please?
-
trouble moving a pop up to the centre of the page
totallytech replied to totallytech's topic in CSS Help
Hey, This is the code thats directly affected. I've removed one of the additional </div> however I think it may be from somewhere else on the page too so I put it back. <div id="tpmask"></div></div> <a id="totally-popup" name="totallypopup" href="#dialog"></a> <div id="boxes"> <div id="dialog" class="window"> <p>Hello. We use cookies on this website<br />to help us and our partners improve<br />your browsing experience. <a href="XXX" rel="nofollow" target="_blank">More Info</a></p><a class="close" href="#"></a> </div> </div> You can view a demo of the trouble at goo.gl/iAsxB -
Is there a way to set up an automated printing in PHP?
totallytech replied to eldan88's topic in PHP Coding Help
I agree with buying a printer, I bought a HP 3050a printer and using HP E-Print you can set up an email address, then you can simply cc email the orders to the new printers email address. I have my fax number forwarding to an email address, which then prints out. The printer was around £40GBP ($70USD) ish So easy, I'm using the technology for other businesses which need to generate orders etc. -
Hey Guys, I've got a pop up box showing the cookie warning (for the EU laws). I've got it in the corner of the screen and that's working fine but I want to centre it to the middle of the page. This is the code that I use to place the popup overlay top right, how can I change the css to make it centred? <style> #tpmask { background-color: #000000; z-index: 9999; display: block; position: absolute; left: 0; top: 0; opacity: 0.6; height: 100%; width: 100%; } #boxes .window { right:20px; top:20px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; width:auto; height:auto; display:none; z-index:9999; padding:20px; box-shadow: 0 0 18px rgba(0, 0, 0, 0.4); } #boxes #dialog { position: absolute; width: auto; margin: auto; max-width: 800px; height: auto; _width: 0; white-space: normal; overflow: visible; padding: 10px; font-family: 'Lucida Grande', Arial, 'Arial Unicode MS', Helvetica, sans-serif !important; color: #FFFFFF; font-size:13px !important; } #dialog a:link, a:visited, a:hover { color: #000000 } *html #boxes .window { position: absolute; } #boxes .window .close { background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: url('images/close.png'); background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; height: 36px; right: -19px; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; position: absolute; top: -19px; width: 36px; } </style>