Jump to content

shaunno2007

Members
  • Posts

    40
  • Joined

  • Last visited

    Never

Posts posted by shaunno2007

  1. If the div "#accessmenu_close_hide" is clicked then i want it to do the if statement so then when it is clicked it will check if the html in the "#accessmenu_close_hide" div is "<img src="images/lock_48.png" width="20" border="0" height="20">" if it is then i want it to do the if statement if not then i want it the else statement

     

    do you no what i mean?

     

    thanks

     

    Shaun

  2. Okay fine in FF but I.E don't work I really do hate I.E :/

     

    Anyway just seeing if you can help me

     

    here is the code:

     

    Code:

    $("#accessmenu_close_hide").click(function(){

         

          if(document.getElementById("accessmenu_close_hide_link").innerHTML == '<img src="images/lock_48.png" width="20" border="0" height="20">')

            {

            $("#accessmenu_close_hide").animate({ marginRight: "10px" }, 0400 );

              $("#accessmenu_close_hide_link").html('<img src="images/lock_open_48.png" width="20" height="20" border="0" />');

            $("#accessmenu").fadeIn("normal");

            }else{

            $("#accessmenu_close_hide").animate({ marginRight: "-2px" }, 0400 );

            $("#accessmenu_close_hide_link").html('<img src="images/lock_48.png" width="20" height="20" border="0" />');

            $("#accessmenu").fadeOut("normal")

         

          };

          });

     

     

    Thank you

     

    Shaun

  3. This stuff is hard look at this code:

     

    How can make php echo out all my images from my server onto my website?

     

    Right, what i am trying to do is echo out the pictures that are in the server, and at the same time echo out the links, i don't know how to say it i hope you understand. What i am getting with this is it echos out the picture, but 2 times and its in all of the link (my information box thing). i hope you understand you prob will not but i will see

     

    <?php
    while($website_row_m_i = mysql_fetch_array($website_result_m_i))
    {
    ?><a href="javascript:#" title="<?php echo "<center><b>Link Information Box</b></center>"; ?>
    <br/>
    <?php echo "<center><b>Link</b></center>" ; ?>
    <center>
    <?php echo substr ($website_row_m_i['url'], 0, 31); ?>
    </center>
    <br/>
    <?php echo "<b>From</b>: <font color='red'>{$website_row_m_i['name']}</font>" ; ?>
    <br/>
    <br/>
    <b>Category</b>
    <br/>
    <?php echo $website_row_m_i['category_id']; ?>
    <br/>
    <br/>
    <b>Description</b>
    <br/>
    <?php echo "<font size='1'>{$website_row_m_i['description']}</font>" ; ?>
    <br/>
    <br/>
    <b>Submitted on the:</b>
    <br/>
    <?php echo $website_row_m_i['created_at']; ?>
    <br/>
    <br/>
    <?PHP
    
    $folder = "uploads/";
    $handle = opendir($folder);
    
    # Making an array containing the files in the current directory:
    while ($file = readdir($handle))
    {
        $files[] = $file;
        echo "<img src='uploads/$file' /> <br />";
        
    } 
    closedir($handle);
    
    #echo the files
    
        
    
    ?>" style="cursor:default">More Info</a><br />
    <?php } ?> 

     

     

  4. OK check my shoutbox out at www.link-search.co.nr/shoutbox.php and as you see it has ajax all i want to do is after someone submits a shout it echos out "shout send" or something i will post the shoutbox on here....

     

    shoutbox.php

     

    <h1>Shoutbox</h1>
    <div id="shoutbox">
      <form id="shout" name="shoutbox" method="POST" onsubmit="saveData(); return false;">
    <p>Name:<br /> 
      <input name="shouter" type="text" class="shouter" size="10" maxlength="15" />
    URL/Email:
      <input name="shouter_contact" type="text" class="shouter_contact" size="10" />
    Comment:
    <input name="shouter_comment" type="text" class="shouter_comment" value="" size="16" />
    <input name="submit" type="submit" class="submit" id="submit" value="submit" />
    </p>
    </form></div>
    
    <div id="shoutarea">
    </div>
    

     

     

    sendshout.php

     

    <?php
    include("shoutbox-connect.php");
    
    open_connection();
    
    $shouter=addslashes(strip_tags(htmlspecialchars($_POST['name'], ENT_QUOTES))); // Cleans Input.
    $shout=addslashes(strip_tags(htmlspecialchars($_POST['message'], ENT_QUOTES))); // Cleans Input.
    $contact=addslashes(strip_tags(htmlspecialchars($_POST['contact'], ENT_QUOTES))); // Cleans Input.
    
    $timestamp = date("Y-m-d H:i:s");
    //echo $temp;
    $shout_sql = "INSERT into shoutbox (name, date, content, link)
    				VALUES ('$shouter', '$timestamp', '$shout', '$contact')";
    $shout_result = mysql_query($shout_sql);
    
    ?>

    outputinfo.php

    <?php
    header("Expires: Sat, 05 Nov 2005 00:00:00 GMT");
    header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    
    include("shoutbox-connect.php");
    
    open_connection();
    
    $shout_query = "SELECT * FROM shoutbox ORDER BY `date` DESC LIMIT 0 , 15" ;
    $shout_result = mysql_query($shout_query);
    $count = 0;
    
    while($shout_row = mysql_fetch_array($shout_result))
    {
    	$shouter_name = $shout_row['name'];
    	$shout_content = $shout_row['content'];
    	$shout_content = stripslashes($shout_content);
    	$shout_date = $shout_row['date'];
    	$shouter_contact = $shout_row['link'];
    	$contact_count = 0;
    
    	$dday = substr($shout_date, 8, 2);
    	$dmonth = substr($shout_date, 5, 2);
    	$dyear = substr($shout_date, 0, 4);
    
    	if(($count % 2) != 0)
    	{
    			echo "<p class='odd'><a href='http://$shouter_contact'><font color='#FFFFFF'>$shouter_name</a></font> - $shout_content <font color='#FFFFFF'>$dday-$dmonth-$dyear</font></p>";
    
    	}
    	else
    	{
    			echo "<p class='even'><a href='http://$shouter_contact'><font color='#FFFFFF'>$shouter_name</a></font> - $shout_content <font color='#FFFFFF'>$dday-$dmonth-$dyear</font></p>";
    
    	}
    	$count++;
    }
    
    if(isset($_POST['submit']))
    {
    echo "Shout successfully sent";
    }
    // as you can see here i tryed if(isset($_POST['submit'])) but i don't work 
    ?>

    database-connect.php

    <?php 
    $host = "localhost";
    $user = "root";
    $pass = "";
    $db = "bizlizard";
    $table = "websites";
    $connect = mysql_connect($host, $user, $pass);
    mysql_select_db($db);
    ?>
    

     

     

    if there is anything i have miss then please say or if you want something else what will hellp you help me with this say thank you

  5. Ok,

     

    you can't use the code verbatim. There are a couple spots where you need to change it to make it work for YOU and YOUR SITUATION.

     

    first spot..... $query = "SELECT * from $table WHERE search"; 

     

    You need to make it say something like "SELECT * FROM $table WHERE $fieldName LIKE '%$search%'"

     

     

    Notice the 3 variables there.... $table is set earlier and should be the name of the table your searching, $fieldName is one I added, replace that with the name of the field your looking in. If you want to look in a field called usernames, then replace it with that. The LIKE %$search% part is a wildcard search pattern.

     

    if the letter A was typed in the search field it woud find things like Another (a is the first letter), Panda (a is in the middle and at the end), Antarctica (a is in the beginning, middle and end) , should those things be in the database. the % is the wild card,

     

    $row['data']  needs to be $row['yourFieldName'] meaning replace that with the name of the field your searching in.

     

    Hope this helps some.

     

     

    This part i don't understand. :(

    you can't use the code verbatim. There are a couple spots where you need to change it to make it work for YOU and YOUR SITUATION.

     

    first spot..... $query = "SELECT * from $table WHERE search"; 

     

    You need to make it say something like "SELECT * FROM $table WHERE $fieldName LIKE '%$search%'"

    This part i don't understand. :(

    The LIKE %$search% part is a wildcard search pattern.

    This oark i do understand i have done this i will show you my name for the tables field names and the database name. :)

    $row['data']  needs to be $row['yourFieldName'] meaning replace that with the name of the field your searching in.

     

    Hope this helps some./quote]

     

     

    The database name is "bizlizard"

    The table name is "websites"

    And the field name is "url"

     

    Could you, if its not too much trouble, put it all together for me so i can see how it all goes. (Together)(If you want)

     

    Thank you very much

     

    Shaun

  6. try this

     

    <?php
    $host = "mysqlhost";
    $user = "user";
    $pass = "pass";
    $db = "db";
    $table = "table";
    
    $search = $_POST['search'];
    
    $connect = mysql_connect($host, $user, $pass);
    
    mysql_select_db($db);
    
    $query = "SELECT * from $table WHERE search"; //You would want to put in your specific search here!
    
    if(!$search)
    {
    echo "Please enter a search";
    }
    else
    {
    $result = mysql_query($query);
    }
    
    while($row = mysql_fetch_array($result))
    {
    extract($row);
    
    echo $row['data']; //you would change data to the data that you want displayed.
    }
    
    ?>
    

     

    hmm...

     

    now i am getting this...

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\bizlizard\link-search.co.nr new design\index.php on line 85

    Don't know why tho.

     

     

    Could i some how make it so it goes to another page like so...

     

    someone submits the form and then it sends the data and the user to search.php and the results are there?

     

  7. You would have to set the action to another page maybe search.php.

     

    Your search.php would look something like this

    <?php
    $host = "mysqlhost";
    $user = "user";
    $pass = "pass";
    $db = "db";
    $table = "table"
    
    $search = $_POST['search'];
    
    $connect = mysql_connect($host, $user, $pass);
    
    mysql_select_db($db);
    
    $query = "SELECT * from $table WHERE search"; //You would want to put in your specific search here!
    
    if(!$search)
    {
    echo "Please enter a search";
    }
    else
    {
    $result = mysql_query($query);
    }
    
    while($row = mysql_fetch_array($result))
    {
    extract($row)
    
    echo $row['data']; //you would change data to the data that you want displayed.
    }
    
    ?>
    
    

     

    This is kind of a rough draft but you should get the point and can modify for your needs.

     

    Got a problem...

     

    Its saying Parse error: syntax error, unexpected T_ECHO in C:\wamp\www\bizlizard\link-search.co.nr new design\index.php on line 89

     

    I don't know why i am getting this.

  8. I have this form

    <form id="submit-search-query" name="submit-search-query" method="get" action="">
       <label>
       <center><input name="search" type="text" class="show-search-box-text-box" size="20"/>
       </center>
       </label>
       <label>
       <center><input name="submit-search" type="submit" class="show-search-box-submit-button" value="Search" />
       </center>
       </label>
       </form>

     

    and i want it to search my database and echo out the search results that have to word what was entered in the form.

     

    Can anyone help thanks

     

    Shaun

  9. how can i put it with this cos i have this...

    <?php
    while($website_row = mysql_fetch_array($website_result))
    {
    ?>   
    
      <a href="http://<?php echo $website_row['url']; ?>"  target="_blank"><?php echo substr ($website_row['link'], 0, 76). "<br />" ; } ?></a>

     

     

     

     

  10. Nothing pisses me off more than sites built to a specific browser.

     

    It's not polite to ask users, who are giving you their time of day to check out your site, to use a different browser, thus wasting their time.  (In my opinion anyway.)

     

    Its not that i dont want people to view it in FF its because when people login to my website in FF the website goes wrong and i don't no how to fix it can you have a look and then you will no what i mean ok thanks

     

    Shaun

     

    www.link-search.x10hosting.com

  11. php processes Prehypertext meaning it can't detect the browser the end user is using.

     

    You shouldn't have to build to a browser since IE6 and FF2/3 both render w3 compliant to nearly the exact same.

     

    --------------------------------------------------------------------------------

    I have seen a way this can be done but a can not remember how or where i have seen it.

     

    Like when you go onto microsoft website using FF, to download something it says you are not using IE bla bla bla. how do you check to see what browser the user is using

  12. I have seen a way this can be done but a can not remember how or where i have seen it.

     

    Like when you go onto microsoft website using FF, to download something it says you are not using IE bla bla bla. how do you check to see what browser the user is using ???

  13. What will i need to do if i want to put something on my website that checked what browser the user is using and if there are using FF recommend them to use IE or if they are using IE recommend them to use FF.

     

    I would want it to echo out something saying "You are using FF we recommend you to use IE for this page!"

     

    How could i do this?

     

    thanks

     

    Shaun

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