Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Posts posted by spiderwell

  1. you can do it without forms, i have used one in the list site in my signature. the hlink is to the php code that adds the like, but the jquery takes the link and deals with it, and prevents the link working by returning false:

     

    HTML

    <div id="like">
    <a class="likelink" href="returngenlist.php?action=like&id=46">
    <img height="25" border="0" onmouseout="javascript:document.thumbup.src='../images/like.png';" onmouseover="javascript:document.thumbup.src='../images/like_over.png';" alt="I like this list" src="../images/like.png" name="thumbup">
    </a>
    </div>
    [/html]
    
     
    JQuery:
    the msg is the returned output from the hlink above, so it will be a number 1 above its previous state.
    [code]
    $(function() {
        $('.likelink').click( function() {
               $.get( $(this).attr('href'), function(msg) {
               $("#liketotal").text(msg);
                });
                return false; // don't follow the link!
         });
    }); 
    

     

    I hope this helps

     

     

  2. that is of course html, CSS would be better, a 3rd option is a clear image as the spacer with a width of your choice

     

    i would not recommend using   as a method of layout at all.

  3. Why have you sent this to me in a PM?

     

    I havent even commented on this thread. Doing stuff like that is more likely to piss me off than make me want to help you. If you must randomly PM me at least have the curtesy to introduce yourself explain why you are PMing me with a bunch of code.

     

    :facewall:

  4. it can be done, but its not a simple fix, you need to probably rewrite a lot of how the system goes from page to page. and implement URL rewriting, but its quite possible that this method could break the current system as its very different.

     

    http://www.seoconsultants.com/articles/1000/url-rewriting

     

     

    this might help.

     

    I think for a quick fix it might be an idea to say have a page called contact.php and have it pull in content for 'cmd=141&sub_menu_item_id=141&template=1&menu_item_id=50'

  5. by shorten what is he after exactly?

     

    you could name all the files to be 1 letter long? seems stupid and pointless

     

    is the length down to querystrings? use POST methods?

     

    is it to get SEO friendly urls? so page.php?section=1 becomes /sectionname/index.php

     

    have you got an example to share of a long url to a prefered shortened version, that would be a good start point.

     

     

  6. you would need to make each favorite have a unique name or they will overwrite, and I dont think you can pass an array as a querystring.

    so it would have to be favorite1=value&favorite2=value

    you can post arrays definately so maybe a post instead of a get?

     

    then at the posted script loop through the array do delete the items

  7. I tried a different approach, but its not tested, might work: changed radio to single value to match against a hard coded array key in answers

     

    <form method="post" action="process/insert.php">
                   <div class="question">QUESTION : <input type="text" name="question" class="txtfield" /></div>
                   <div class="choices">CHOICES : <br /><br />
                   
                   <div class="flds"><input type="radio" name="radanswers"  value="A" checked="checked" />A. <input type="text" name="txtanswers['A']" class="txtfieldans" /></div>
                   <div class="flds"><input type="radio" name="radanswers"  value="B"  />B. <input type="text" name="txtanswers['B']" class="txtfieldans" /></div>
                   <div class="flds"><input type="radio" name="radanswers"  value="C"  />C. <input type="text" name="txtanswers['C']" class="txtfieldans" /></div>
                   <div class="flds"><input type="radio" name="radanswers"  value="D" />D. <input type="text" name="txtanswers['D']" class="txtfieldans" /></div>
                   </div>
                   <div class="clear"></div>
                <div class="buttons"><input type="submit" name="ins_question" value="Insert Question" class="btn" /></div>
             </form>
    
    
    here is my php script:
    
    foreach($_POST['txtanswers'] as $key =>$value){
    if($key == $_POST['radanswers'])
    {
    	$InsChoices = "INSERT INTO choices (`cID`,`qID`,`Itemchoices`,`isCorrect`) VALUES ('".rand()."','$questionID','".$value."','".$_POST['radanswers']."')";
    }
    else
    {
    	$InsChoices = "INSERT INTO choices (`cID`,`qID`,`Itemchoices`,`isCorrect`) VALUES ('".rand()."','$questionID','".$value."','')";
    }
    echo "<pre>";
    echo $InsChoices;
    echo "</pre>";
    }
    
    

     

    You dont really need to put in A or B for the `iscorrect` column, it could be true or false.

×
×
  • 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.