Jump to content

Andrew R

Members
  • Posts

    158
  • Joined

  • Last visited

    Never

Posts posted by Andrew R

  1. Hi

     

    Sorry for the unclear topic title.  I'm trying to display all the results from a database and use echo them using $total.

     

    $total =     do {  "".$row_use['lon']." ".$row_use['lat'].""  } while ($row_use = mysql_fetch_assoc($use)); 
    
    echo $total;

     

    I was wondering why does that not work?  How do I get the php repeated regions to work?

  2. Hi.  I’m using the following script to display/hide parts of the html on the page.  I use the span to make this work

     

    <script type="text/javascript">
    function showStuff(id) {
    	document.getElementById(id).style.display = 'block';
    }
    function hideStuff(id) {
    	document.getElementById(id).style.display = 'none';
    }
    </script>

     

    <span id="deals" style="display: display;">
    <<<<Html in here>>>
    </span

     

    To make it hide you click on the below link image.

     

    <a href="#" onclick="hideStuff('deals'); return false;"><img src="images/hide.png" width="10" height="10" border="0"></a>

     

    To make it display you click the below link image.

     

    <a href="#" onclick="showStuff('deals'); return false;"><img src="images/show.png" width="10" height="10" border="0"></a>

     

    When I click on the above button to hide or display the html how would I get the button to change from hide to show or vice versa? 

     

     

    Any help and advice would be much appreciated  :)

     

    Thanks

  3. How do I display results from a database in a particular format.  For example the following text in this format including the lines in stored in the database:

     

    “Hello,

     

    Welcome to the news for 11/06/07.

     

    Thanks”

     

    When I echo the results using the usual,

    <? echo $row_news[‘news’]; ?> 

    it doesn’t echo the information in the database in the format it is stored for example it will display like this. 

    “Hello, Welcome to the news for 11/06/07. Thanks”
      How do I get it to display in the format it in displayed in the database?

     

    Thanks.

     

  4. Hi

     

    How would I echo a particular amount of text fields depending on how many the user selects from a drop down menu that I have already created.  For example say the user selects 4 or whatever other number from a drop down menu how would I echo 4 or whatever the amount of text fields for a user to input text into?   An example would be an airline website were you select how many people are travelling and then it echo fields for those people to enter their names.

     

    Cheers  :)

  5. I just re-read your post... are you saying you always want to display the part before the _ ? No matter what the length?

     

    Yeah most names in the database are four characters long but some are longer so I want to display everything before the _. 

     

    How would have add something that this into the above code

    $names = addslashes($riga[2]);

    instead of the

    <? echo $row_users[‘name’]; ?>

     

    Thanks for the help.

  6. For a script I’m using php inside a javascript with echos.  The problem I’m having is that for some names like ‘Jim O’Reilly’ the code is displaying an error.  I think this is to do with the ‘ in the persons name.

     

    $info = "<font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><strong>Name: </strong>".$name [1]."<br></font></a></font>";

     

    Further down in the script I echo the $info.  The script works fine when people names don’t have commas or any sort of speech marks like .  I think these things are breaking up the script but I don’t know how to get around it?

     

    Any ideas

     

    Thanks

     

  7. Hmmm....I have the same exact line in one of my scripts, the only difference is I have the +14 days in double quotes and it works fine. Maybe give that a try? I doubt it makes a difference, but it's worth a go. Oh, maybe your variable needs to be in double quotes as well.

     

    $nxt = date("$date", strtotime("+14 days"));
    

     

    It's working now but its not adding on the 14 days.  Just echoing the date from the database?

  8. Hi

     

    The below script pulls a date from the database depending on what user is selected and then adds on 14 days (2 weeks).  The problem is the script is not giving me the desired output.  Any ideas? 

     

    Cheers

     

    <?  $date =  $row_thing['date'];
    
    
    						$nxt = date('$date', strtotime('+14 days'));
    
    
    
    						echo $nxt;
    
    
    						?>

  9. Hi

     

    How would I insert this (below) inside an echo that contains html?             

     

     

    <?php do { ?>

     

    <?php } while ($row_bh = mysql_fetch_assoc($bh)); ?>

     

     

     

    <? if ($ree == 'YES') {
    	  echo"<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"bar\">
                  <!--DWLayoutTable-->
                  <tr> 
                    <td width=\"249\" height=\"18\" valign=\"top\"><strong>TEEST</strong> </td>
                    <td width=\"590\"></td>
                  </tr>
                </table>
    <table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"3\" bgcolor=\"#F5F5F5\" class=\"border\">
                  <!--DWLayoutTable-->
                  <tr> 
                    <td width=\"121\" height=\"22\" valign=\"top\" bgcolor=\"#CCCCCC\" class=\"bar2\">1 </td>
                    <td width=\"95\" valign=\"top\" bgcolor=\"#CCCCCC\" class=\"bar2\">2</td>
                    <td width=\"96\" valign=\"top\" bgcolor=\"#CCCCCC\">3</td>
                    <td width=\"93\" valign=\"top\" bgcolor=\"#CCCCCC\">4</td>
                    <td width=\"96\" valign=\"top\" bgcolor=\"#CCCCCC\">5</td>
                    <td width=\"100\" valign=\"top\" bgcolor=\"#CCCCCC\">6</td>
                    <td width=\"104\" valign=\"top\" bgcolor=\"#CCCCCC\">7e</td>
                    <td width=\"77\" valign=\"top\" bgcolor=\"#CCCCCC\" class=\"bar2\"><!--DWLayoutEmptyCell--> </td>
                  </tr>
    
                  <tr> 
                    
        <td height=\"23\" valign=\"middle\"></td>
        <td valign=\"top\"><td>
        <td valign=\"top\">< td>
        <td valign=\"top\"></td>
        <td valign=\"top\"></td>
        <td valign=\"top\"></td>
        <td valign=\"top\"></td>
                    
        <td align=\"right\" valign=\"middle\"><!--DWLayoutEmptyCell--> </td>
                </table>";
    
    
    
    }
    
    	  ?>

     

    How would I put the php inside the echo without getting errors

     

    Cheers  :)

  10. Inactive Member Script

     

    I’m considering writing an inactive member script.  For example if a user doesn’t log in for 30 days (1 month) or more they will receive an email.  I’m struggling to work out how a script like this would work with any user input from the admin.  Also things like dates.  How would the system count back 30 days, i.e if the date is 2007-04-07, how would I count back 30 days?

     

    Any ideas would be much appreciated

     

    Cheers

  11. Hi

     

    How do I get my site taken of Google or the text and the title changed on it so it is more relevant?  I believe there is some way to do it through meta tags?  How do I limit certain words aswell?

     

    Cheeers

     

  12. I've used the superglobal arrays, Post and Get now and I'm now not getting any errors although none of the answers I submit in the test are being submitted.  How would I add post and get arrays to the following? 'user_answer[" . $i . "]' etc

     

    print "<FORM ACTION='$PHP_SELF' METHOD='post'><BR>\n";
    while ($j <= 20)  {
    	print "Question #" . $j . ': ' . "<b>".$question[$i]."</b><BR>\n";
    	print "<INPUT TYPE='radio' NAME='user_answer[" . $i . "]'  VALUE='A'>".$ans1[$i]."<BR>\n";
    	print "<INPUT TYPE='radio' NAME='user_answer[" . $i . "]'  VALUE='B'>".$ans2[$i]."<BR>\n";
    	print "<INPUT TYPE='radio' NAME='user_answer[" . $i . "]'  VALUE='C'>".$ans3[$i]."<P><P>\n";
    	$i++;
    	$j++;
    }
    
    //print "<INPUT TYPE='hidden' NAME='qkey' VALUE='$questionkey'>\n";	
    $ii=0;
    while ($ii<=19) {
    	print "<input type='hidden' name='answer[$ii]' value='$answer[$ii]'>\n";
    	print "<input type='hidden' name='orgid[$ii]' value='$orgid[$ii]'>\n";
    	$ii++;
    
    } 

    Thanks very much.

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