Jump to content

rarebit

Members
  • Posts

    1,002
  • Joined

  • Last visited

Everything posted by rarebit

  1. In reality I had another issue with that reference, they all came through as the same, so I did basically the same but to a temporary array then copied it (may have time to find a better method later), also as you said the trailing comma err'd on me, so here's a quick amendment. $params2=substr($params2, 0, -1); $param=array(); // need to copy because need references!!! grrr for($i=0;$i<count($aa);$i++){ $param[]=&$aa[$i]; } I generate the params and types on the fly so that any number of products may be added at once. I will be banging these (+others) into functions later, but / or how do you mean? (I saw some class examples on php.net but i'm in a rush so just moved on, but I do prefer to optimise wherever possible!) Cheers
  2. After trying every version of array merge, it finally worked by changing this: $param[]=&$k;
  3. Hi, i'm getting the following error when executing the following code. The count should be right That line may now be 39 ( call_user_func_array() )I've tried hard coding the types too (so no extra comma)! And without array_values(), plus other things... and when I print each set of params out they are right if(isset($_POST['order'])){ print "Order<br />"; $param=array(); $params=""; $params2=""; foreach($_POST as $k=>$v){ $pos = strpos($k, 'sku'); if($pos!==false&&$pos==0){ $param[]=$k; $params.="s"; $params2.="?,"; } } if(count($param)>0){ print "Selecting<br />"; if($stmt = $db->prepare("SELECT sku, title, info, quant, cost FROM ".$db_table_prefix."product WHERE sku IN (".$params2.")")) { call_user_func_array('mysqli_stmt_bind_param', array($stmt, $params, array_values(&$param))); $stmt->execute(); Many thanks!
  4. Hi, I wrote some code a fair while ago now and just trying to use it again. The code works fine on my Linux distro, but on Windows i'm getting an error... Basically 'id' is an int not null autoincrement, and I pass it an empty string. Do you know what the issue is?
  5. rarebit

    display:none

    Yep, you were right. The question to myself is how did it change, cos it was working before...
  6. rarebit

    display:none

    The unordered list (ul) below the list (li). <li class='liOpen'><span class='bullet' onmouseover='changeit(this, 1);' onmouseout='changeit(this, 0);' onclick='changeit(this, 2);'> <a href='http://10.0.0.55/cmstmp/rawstar7/cmsmonkey.0.4.1/site/pro/c/basics/index.html'>Basics</a></span></li> <ul> ... </ul> At first glance on discovering the issue I also thought the 'li' block should have been wrapping the associated 'ul', but supposedly not, and the basic version I have doesn't either.
  7. rarebit

    display:none

    Hi, I made a menu a while back and have now just realised it's not initialising properly and I can't see why. Basically some blocks are initialised to to 'display:none', and they show the correct icon and the js works as if initialised that way, but the block below displays whether or not it is set as 'none'. The JS code is probably not required to be shown here, but... The HTML code <ul class='rctree'> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/index.html'>Programming</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55site/pro/c/index.html'>C</a></span></li> <li class='liOpen'><span class='bullet' onmouseover='changeit(this, 1);' onmouseout='changeit(this, 0);' onclick='changeit(this, 2);'> <a href='http://10.0.0.55/cmstmp/rawstar7/cmsmonkey.0.4.1/site/pro/c/basics/index.html'>Basics</a></span></li> <ul> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_hello.html'>Hello</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_input.html'>Console Input</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_text_01.html'>Text Formatting</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_logic.html'>Logic</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_funcs_01.html'>Functions</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_file_01.html'>File IO</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_macros.html'>#define & Macro's</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_pointers.html'>Array's & Pointers</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_system_01.html'>System Calls</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/basics/tut_c_console_01.html'>Console Parse App</a></span></li> </ul> <li class='liClosed'><span class='bullet' onmouseover='changeit(this, 1);' onmouseout='changeit(this, 0);' onclick='changeit(this, 2);'> <a href='http://10.0.0.55/cmstmp/rawstar7/cmsmonkey.0.4.1/site/pro/c/io/index.html'>IO</a></span></li> <ul> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/io/file_io_rand.html'>Basic Random Access</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/io/file_io_rdb.html'>Random Access DataBase</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/io/file_io_seq2.html'>Sequential Access</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/io/file_io_cat.html'>Cat</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/io/file_io_popen.html'>Popen</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/io/file_io_hexdump.html'>Hexdump</a></span></li> <li class='liBullet'><span class='bullet'> <a href='http://10.0.0.55/site/pro/c/io/file_io_fcount.html'>FCount</a></span></li> </ul> </ul> The CSS code @media screen, print { ul.rctree li { list-style: none; } ul.rctree { margin-left:0px; padding:0px; } ul.rctree ul { margin-left:10px; padding:0px; } ul.rctree li { margin-left:5px; padding:0px; } ul.rctree li .bullet { padding-left: 15px; } ul.rctree li.liOpen .bullet { cursor: pointer; background: url(../../res/icons/li_minus.gif) center left no-repeat; } ul.rctree li.liClosed .bullet { cursor: pointer; background: url(../../res/icons/li_plus.gif) center left no-repeat; } ul.rctree li.liBullet .bullet { cursor: default; background: url(../../res/icons/li_bullet.gif) center left no-repeat; } ul.rctree li.liOpen ul { display: none; } ul.rctree li.liClosed ul { display: none; } } The JS code var nodelast = null; var timeout_id = null; function changeit(node, state) { if ( (state==1) && (node.parentNode.className != 'liOpen') ) { // NEW OVER nodelast = node; timeout_id = setTimeout('node_open(nodelast)', 1000); } else if (state==0) { // OUT clearTimeout(timeout_id); } else if (state==2) { // CLICK node_open(node); } } function node_open(node) { if(node.parentNode.className == 'liOpen') { node.parentNode.className = 'liClosed'; } else { node.parentNode.className = 'liOpen'; } } Help greatly appreciated!
  8. mmm, worked... RewriteRule ^$ index.phtml [R]
  9. Hi, I've just noticed an issue on my site and am wondering if it's either because of or solvable by mod_rewrite. Basically the home page displays images fine if you go to something like: www.here.com/index but if you just go to the root: www.here.com/ then no images display... I've tried using things like: RewriteRule ^$ index.phtml [QSA,L] but for some reason I think i'll have to use a redirect...
  10. rarebit

    Opera Issues

    er? The 'x/y/z' is representative of a domain and directories. eh? The URL be... x/y/z/money/res/icons/user.gif Whilst the protocol was specified by 'http://'. The absolute locations specified work in all browsers but not Opera, i'll try removing the protocol, but can't see that it should make any difference. In the first place I didn't include code because the URL's all conform to all examples (of absolutes, including domain) i've found, and also pass W3Schools, and they work in FF, IE, and Chrome without issue. Either way, ignore this thread please Haku, you seem to be misunderstanding the issue, but thanks for the input?
  11. One way could be to use ajax. Load the page then fetch the data in portions?
  12. rarebit

    Opera Issues

    Right, the 'alt' bit is obvious, but why no image? <div class='login_user_i'> <a href='http://x/y/z/login/profile' style='background:transparent url(http://x/y/z/monkey/res/icons/user.gif) no-repeat left top;text-indent:27px;display:table-cell;width:auto;height:24px;text-align:left;' title='Profile' > </a> </div> and a typical link: <span class='menu_std' style='float:left;'><a href='http://x/y/z/site/info'>INFO</a></span>
  13. rarebit

    Opera Issues

    Sorry haku I don't understand your answer. I've shown no code (if you meant to write 'line' and not 'like'). I've also checked for erroneous semi-colons and can't find any for either issue.
  14. I think you need to close your select tag...
  15. One way is to use BBC (I think)... Another is to use header to redirect after a set amount have been sent, calling itself till list finished. Or similar using a cron job.
  16. If your users click back without clicking submit then you should look at ajax to update any in page updates...
  17. The delay issue is probably to do with your server, most web servers don't alot much ram (esp for basic packages). FFMPEG requires a fair bit of ram and processor, but it is best av package around. I think guidence is to use the php-ffmpeg api, see here: http://ffmpeg-php.sourceforge.net/
  18. It's really a HTML issue, all multiple spaces (etc) will be displayed as a single space, it's the HTML way, i'd suggest something like mjdamato but expand it to include tabs (e.g. replace with 4 non breaking spaces).
  19. 1. This should be in the HTML forum I think... 2. Using code tags to surround code make helping easier... Your checkbox code looks correct, so... Have you looked at the page source once it's generated to see if any of your variables have introduced any erroneous characters which are exiting quotes prematurely? (even though I see your using htmlspecialchars()) p.s. it looks like you can dl the source code from the publishers site: http://www.sitepoint.com/books/phpmysql4/?historicredirect=phpmysql1
  20. Have you induced an error? e.g. missing a ';' or use of a non prefixed '$' variable?, tried to use 'header' after html already sent?
  21. rarebit

    Opera Issues

    Hi, I was just doing some testing and found two issues when using the Opera Browser: 1. It seems to not want to display gif's, but also not display their alt's either? 2. When hovering over links the first time, the cursor changes to a hand, but if I remove and re-hover then the cursor doesn't change.
  22. Not fully looked into it, but: if ($_POST['imageupload']=='upload' && isset($_FILES['new_image'])){ Do you notice the difference?
  23. It's happening because the data is an array, not a string! You need to iterate through it, something like this maybe... foreach($email_message as $e) { $email_message .= $e."\n"; }
  24. Basically anything included all becomes one big entity, so you only need to start the session once. and echo $_SESSION['username'];
×
×
  • 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.