Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. you may find the foreach or while construtcs useful along with array_multisort.... anything more and I'd just be doing it for you!
  2. what a lazy toe-rag!!!
  3. First of don't bother with frames - you don't need em and they are horrible! The length of a page should not need to be controlled - let it be what it is (unless you need to restrict a certain portion to an alloted size - then use a div with width/height settings and overflow: auto in your css!) Welcome to the board mate - hope you enjoy the wonderful world of banging heads against monitors!
  4. Have alittle problem... On my development machine this works fine... I create an object and put various bits in/take them out etc. herers the code... [code] <?php require_once('../shopping_cart/classes/cart.clss.php'); if ( isset ( $_SESSION['cart'] ) ) { $cart = unserialize($_SESSION['cart']); } else { $cart = new shopCart; } if ( isset ( $_GET['action'] ) ) { $num = isset($_GET['num']) ? $_GET['num'] : 1; switch ($_GET['action']) { case 'additem': $cart->addItem ( $_GET['id'] , $num ); break; case 'removeitem': $cart->removeItem ( $_GET['id'] , $num ); break; case 'togglecart': $cart->togglecart(); break; default : } } $_SESSION['cart'] = serialize($cart); ?> [/code] Now on my development machine I can (after this part of the code has been executed) check $cart->items (one array in the object) however on the live server the whole object has been serialized so I can now only check the byte-stream rep. the object itself no longer 'exists'. I can't see any differences in ini settings from my machine to that of the live server so any pointers would be very much appreciated.
  5. maybe nothing but put the semi colon after return false. and why are you still using single quotes for html attribute values?? u naughty boy! ;)
  6. Hi everyone. OK valid xhtml1.1 page, I have a shopping cart that is placed inside a fixed height div (so it scrolls rather than fills the page up).  Each item in the shopping cart is displayed like so..... [code] <tr class="odd"> <td class="name"><a id="cart5"></a><a href="?section=3&amp;cat=1&amp;id=5" title="Dead Glass">Dead Glass</a></td> <td class="number"> <a href="?section=3&amp;cat=1&amp;id=5&amp;action=removeitem#cart5" title="Remove Item">-</a> 1 <a href="?section=3&amp;cat=1&amp;id=5&amp;action=additem#cart5" title="Add Item">+</a> </td> <td class="cost">£&nbsp;899.99</td> </tr> [/code] Now the idea here is that either side of the quantity is a link to add/remove, and when the user clicks one the #cart5 part of teh url will mean that on the resulting page this record will be pushed up to the top of the container, using the (<a id="cart5"> anchor) of the shopping cart (so the user can see it once more.) This works once only. When the next page is finished processing the link does NOT work again (the url is correct - I have checked) but clicking that url simply does not perform anything.  If I remove the #cartX you can sucessfully add/remove items many times using those links... Can anyone suggest why this is happening? Any help would be very much appreciated... PS: this aspect is imply to make the cart work without js (but I have not put the js in yet!)
  7. two ways. daniel got the first the second is to set the display property of the span to block (or float it!) give it a heigt and width of the image you want and set your image as the background.
  8. D'OH the is an ';' rigth after if(isset($_POST['email'])); !!! I missed that! take it out. Just looked at your code and spotted something that will save you some headaches... You have the check type function to check which type was set... but if you look at the logic and your html you will notice that the user coudl check bothboxes or neither which would set type to 3 - be careful with that!!! If you only want them to be able to slect one I suggest you change to radio buttons....
  9. try this... [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>GSmash Tournament registration</title> </head> <body> <?php // Check to make sure that the user isnt spamming people via the form: function spamcheck($field) { if ( eregi("to:", $field) || eregi("cc:", $field) || eregi(";", $field) ) { return true; } else { return false; } } function checkType($type) { if ( $_POST['type1'] == true && $_POST["type2"] == false ) { $type = 1; } elseif ( $_POST['type1'] == false && $_POST["type2"] == true ) { $type = 2; } else { $type= 3; } return $type; } //Make sure the form is filled out: if(isset($_POST['email'])); { //check if the email address is invalid $mailcheck = spamcheck($_POST['email']); if ( (bool)$mailcheck == true) { echo "Sorry, the e-mail you have entered is invalid, please re-enter it."; } else { //send email if the e-mail is valid $email = $_POST['email']; $subject = "Smash Entry For: " . $_POST['name']; $type = checkType(); $message = $_POST['sname'] . ", " . $_POST['char'] . ", " . $type; mail("Linkmaster424@aol.com", "Subject: " . $subject, $message, "From: " . $email . "\r\n"); echo "Thanks for your entry!Your data will be sent to the tournament staff."; } } else { ?> <h1 align="center">Glenwood SSBM Tournament Form</h1> <hr /> <br /> <h3 align="center">Fill out the form and click the &quot;Send&quot; button.</h3> <form method="post" action="ssbm.php"> Email: <input type="text" name="email" /><br /> Name: <input type="text" name="name" /><br /> Smash Name: <input type="text" name="sname" max=4 min=1 size=16><br /> Character: <input type="text" name="char" /><br /> Entry Type(select at least one):<br /> One on One:<input type="checkbox" name="type1"><br /> Teams:<input type="checkbox" name="type2"><br /> </form> <p><em>Note: In order to join the tournament, you will be required to pay an entry fee of &nbsp; &nbsp; $5.00 upon entry. &nbsp;This is mandatory for both teams and singles, meaning that if you are on a team, &nbsp;you AND your partner will need to pay the entry fee, totalling ten dollars. &nbsp;The same goes if you &nbsp;were to enter in both tournaments, you would have to pay a fee of ten dollars(five for each tournament).</em></p> <br /> <p><font size="2">&copy;2006 By Tristan Nolan.</font></p> <?php } ?> </body> </html>[/code]
  10. you have to use upper case with those matey!!! and PHP_SELF (not php_shelf) not seen shelf anywhere ;) try this.. [code] <?php if ($_POST) {   // create empty error variable   $msg = ""; I receive undefined variable _post so I tried : <? $browser = $_SERVER['PHP_SELF']; echo "the sniffer says: $browser" ; ?> [/code] NOTE: try not use short tags '<?' use '<?php' instead - and turn off teh short tags in your php.ini file otherwise any xml files will reek havoc! ALSO $_SERVER['PHP_SELF'] returns the name of name of the current script NOT the browser (or user agent) check the manula for the super globals info....
  11. echo the query to teh screen and check it in phpmyadmin or something - see if it returns any rows or highligths any specific error.
  12. This is how I would have done it - you shoudl find it a bit easier to read.... [code] <?php if ( $found['total'] == 0 ) { $sql = " UPDATE users SET activated = 1 WHERE userid = '" . mysql_real_escape_string ( $_REQUEST['id'] ) . "' AND password = '" . mysql_real_escape_string ( $_REQUEST['code'] ) . "' "; $sql = mysql_query($qry) or die ( 'Query Error: ' . mysql_error()); if ( mysql_affected_rows ( $sql ) == 0 ) { ?> <strong><font color="red">Your account could not be activated, no user found by that id or password!</font></strong>"; <?php } else { ?> <strong>Your account has been activated!</strong> You may login below!<br />"; <?php include ( './login.php' ); } } else { ?> <strong>You have already activated your account!</strong> You may login below!<br />"; <?php include ( './login.php' ); } ?> [/code] well if it didn't bugger up teh tabs so much ;)
  13. STrike that - just loaded it into my editor - it was just your nesting of code that threw me... There is a missing ';' at the end of teh last echo line.
  14. I see the problem... From the start of the checktype function you have an if statement at the end of whic you have return xxx.  You will note the if statement finishes above the return and there is another closing brace immediately after - this is closing the function code block - decide what shoudl happen there and adjust the script accordingly.
  15. well provided your server will run php scripts and is configured properly no-one will ever see teh source code unless they get you ftp details and download teh actual file from your server
  16. No his structure is correct try to avoid comparing completely different elemenst in an else if statement - if only to avoid confusion. if you are looking at one compariosn with many potential values that control code flow then use the switch statement but in this case it is not necessary
  17. you are missing one closing '}' at teh end of that code (bewteen the echo statement and the '}')
  18. You can't use die and then output info for the user!!! That script is simply not structureed well so you have missing closing tags etc etc. Learn to indent you code more effectively - it will help you spot erros. This is what I think you trying to do (I have removed the die(mysql_error()); line as it is not needed - if there were and error you'd never get to that line..) [code]if ( $found['total'] == 0 ) { $sql = mysql_query ( "UPDATE users SET activated = 1 WHERE userid = '" . mysql_real_escape_string ( $_REQUEST['id'] ) . "' AND password = '" . mysql_real_escape_string ( $_REQUEST['code'] ) . "'" ) or die ( 'Query Error: ' . mysql_error ); if ( mysql_affected_rows ( $sql ) == 0 ) { echo "<strong><font color='red'>Your account could not be activated, no user found by that id or password!</font></strong>"; } else { echo "<strong>Your account has been activated!</strong> You may login below!<br />"; include ( './login.php' ); } } else { echo "<strong>You have already activated your account!</strong> You may login below!<br />"; include ( './login.php' ); }[/code]
  19. lost the thread a bit there (tired) BUT there are numerous ways to do a 'roll-over' usign css. NOW the :hover psuedo class (as I last read) can only RELIABLY be applied to the a tag; IE6 < won't apply it to any other element without a plugin (I am told there is one for it but never bothered looking for something no-one else can't be bothered to find!). So lets stick to the a tag for now. As far as I have seen the most common method for switching the image is indeed to specify a different image for the background on the in teh :hover declarations. You can also create an image that is TWICE the size of your image - have your image on top and the 'roll-over' state under it all in one image. Then use :hove to shift the background image up (this means you must make the element display: block; and give it a height and width.) The just use.. :hover { background-position 0 -60px; } The final method is quite nice but proprietory.... you can use the filer for IE and thinsg liek opacity for compliant browser to actually 'cahnge' the image itself - no two images just using css to alter how its displayed... I always go here to have a look at that last effect (done on whole site instead of just :hover etc.) [url=http://www.stuffandnonsense.co.uk/]http://www.stuffandnonsense.co.uk/[/url] look at it in ie then in ff - and note exact same mark-up ;)
  20. try giving contentWrapper a margin of 5px and removing the padding.
  21. None of the extensions that I have uncommented in the .ini file are loading (those that I have removed the leading ';' anyway)!!! (I have php 4.4.4 on win xp apache 2.0.59) when I run phpmyadmin this warning is on the frontpage: [color=red]The mbstring PHP extension was not found and you seem to be using multibyte charset. Without mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.[/color] But that extension is uncommented in my ini file. I have some code requiringthe gd lib - all scripts yeild fatal warning if any gd lib functions are called.. when I run phpinfo(); I DO NOT get the 'Configure Command' information in the top box.... Can anyone suggest possible causes If I need to post more info just say so.
  22. Ok this is boring me now. I have php 4.4.4 running on winxp (sp2 + all updates) apache 2.0.59 For some reason teh gd library is not loading - i get teh call to undefined function imagecreateform.... and gd_info() returns similar fatal error... here is the extensions bit of my config.... extension=php_mbstring.dll ;extension=php_bz2.dll ;extension=php_cpdf.dll ;extension=php_crack.dll extension=php_curl.dll ;extension=php_db.dll ;extension=php_dba.dll ;extension=php_dbase.dll ;extension=php_dbx.dll ;extension=php_domxml.dll extension=php_exif.dll ;extension=php_fdf.dll ;extension=php_filepro.dll extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_hyperwave.dll ;extension=php_iconv.dll ;extension=php_ifx.dll ;extension=php_iisfunc.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_java.dll ;extension=php_ldap.dll extension=php_mcrypt.dll ;extension=php_mhash.dll ;extension=php_mime_magic.dll ;extension=php_ming.dll extension=php_mssql.dll extension=php_msql.dll ;extension=php_oci8.dll ;extension=php_openssl.dll extension=php_oracle.dll ;extension=php_pdf.dll ;extension=php_pgsql.dll ;extension=php_printer.dll ;extension=php_shmop.dll ;extension=php_snmp.dll extension=php_sockets.dll ;extension=php_sybase_ct.dll ;extension=php_w32api.dll extension=php_xmlrpc.dll extension=php_xslt.dll ;extension=php_yaz.dll extension=php_zip.dll Any pointers very much appreciated....
  23. Good morning... I have a little problem. I have a field in a table that holds comma separated values of the primary key values of another table that relate to this record. I want to use a join query to pull all the records from the second database where the id is in the comma separarted string contained in the first table. Now I have tried this and imagine (if its possible to do this in one query that is) that the right answer will be something similar... the field containing the comma separated values i want is called `images` and is in the `tbldoc` table. [code] SELECT `im`.* FROM `tblimages` AS `im`, `tbldocs` AS `doc` WHERE `doc`.`docid` = " . $_GET['d_id'] . " AND `im`.`image_id` IN (`doc`.`images`) [/code]
×
×
  • 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.