Jump to content

11Tami

Members
  • Posts

    329
  • Joined

  • Last visited

    Never

Posts posted by 11Tami

  1. I really need some help. I fixed the just above problem but don't know how to fix this. The only problem I have left with this is when there are 2 or more links returned per id, like in example given in id 2.... is sometimes they both are returned and sometimes they aren't. Any way to fix this?

     

    <?php
    echo "<a href='?id=1'>Heading 1</a>";
    if ($_GET['id'] == 1){echo "<a href='topageone'>link1</a>";}
    echo "<a  href='?id=2'>Heading 2</a>";
    if ($_GET['id'] == 2){echo "<a href='topage2'>link2</a><a href='topage2'>link3</a>";}
    ?>

     

    Please let me know, thank you.

  2. Lol, did you take a good look, its not spam but tons of value took me years to find. Gosh something really wrong. Its not working in Mozilla and Opera, need some help to figure out why. Works fine in IE. When you click on the ones that are link it doesn't go to the web pages, it just sits there.

     

    <?php
    echo "<a href='?id=1'>Heading 1</a>";
    if ($_GET['id'] == 1){echo "<a href='topageone'>link1</a>";}
    echo "<a  href='?id=2'>Heading 2</a>";
    if ($_GET['id'] == 2)
    {echo "<a href='topage2'>link2</a>";?>

     

    I'm calling it with a php include. Maybe my include is incorrect for a full path file. This is how it looks.

     

    <?php

    include 'http://www.website.com/directory1/menu.php';

    ?>

     

    Can anyone see why the linking code above doesn't work in Mozilla and Opera? Please let me know, thank you very much.

  3. Thank you very much something like that is just what I need. Refreshing is no problem either and the search engines can also search the links. How do I do it so it can continue?  Because there will be other links with different id numbers as well. That way when they click on a different header, different links can appear instead.

     

    <?php
    echo "<a href='?id=1'>category1</a>";
    if(isset($_GET['id']))  {
    echo "<a href='http://www.website.com/leadstoapageelsewhere'>link 1</a>";}
    
    echo "<a href='?id=2'>category2</a>";
    if(isset($_GET['????']))  {
    echo "<a href='http://www.website.com/leadstoapageelsewhere'>link 2</a>";}
    ?>

     

    Please let me know, thanks.

  4. Hello, I need text link number 2 to appear but only if text link 1 has been clicked on. Trouble I'm having is it shows both of them at the same time.  So~

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    <?php
    $1 = "< href='http://www.website.com/pagelinksareon.php'>link 1</a>";
    echo "$1";
    if ($1)
    {echo "< href='http://www.website.com/leadstoapageelsewhere'>link 2</a>";}
    ?>

     

    Shows both at the same time which isn't what I need.

    Do I need some sort of if $1 is active type command? If so how is that done?

    How does php know if a link has been clicked on?

    Please let me know, thank you very much.

  5. Thanks I was adjusting that when you posted and I know it needs a bit of tweaking. Are you absolutely positive about that? I'm pretty sure the search engines won't follow them if the echos aren't pulled onto the page yet. The echos won't show on the page until one of the links is clicked on. Are you sure the search engines will follow a text link that is only in an "if" statement? Please let me know, thanks.

  6. Thanks I'll try. Maybe doing it visually will help.

    The first text link on a page:

    I am text link 1 that leads to another page. When I am clicked on two other text links appear

     

    I am text link 2 that appears only when the first one was clicked on

    I am text link 3 that appears only when the first one was clicked on

     

    I am text link 4 that appears only when 2 was clicked on

    I am text link 5 that appears only when 2 was clicked on

     

    I am text link 6 that appears only when 3 was clicked on

    I am text link 7 that appears only when 3 was clicked on

     

    on it goes.

     

    As shown certain next links only appear when some links are clicked on. All that I can pretty easily set up with php. Since I would probably need php "if" statements for example:

    <?php
    $1=<a href='http://thewebpageforthislinkhere'>I am text link 1 that leads to another page. When I am clicked on two other text links appear</a>;
    if ($1)
    { echo "<a href='http://thewebpageforthelinkhere'>I am text link 2 that appears only when the first one was clicked on</a>";
    echo "<a href='http://thewebpageforthelinkhere'>I am text link 3 that appears only when the first one was clicked on</a>";
    }
    ?>

     

    All that should work. But the part I am stuck on is how to get the big search engines to follow all these links? How to get the big search engines to read them all like regular links on any page and to follow them? Because it doesn't do a whole lot of good for me to set up a bunch of links if the biggest search engines can't even find their pages.

     

    Please let me know, thanks.

  7. Hello, need help with this, not sure how to do it. I need a text link on my page so that if it is clicked on

    a few other text links will appear, then if they are clicked on others will appear and so on. But the tricky part is I also need the links to be followed like normal links are, by search engines. I know I could do some php that if such and such link on is clicked then do this and show the other text link. But how can they be listed so search engines will follow them, even if they aren't clicked on yet? Please let me know, thank you.

  8. I need to someone to see this who knows what I am trying to do. Here is php for background images.

     

    <?php echo "<body style='background: url(http://www.website.com/a.gif);'>";?>

     

    I need to put a php image tag into the url( ) so that it puts the images I want into it with php.

     

    Maybe I need to put the whole "<body style='background into a variable instead?

     

    Someone who knows a lot about php, please let me know, thanks very much.

     

     

  9. Hello, here's some pagination code and my question below it.

     

    <?php
    mysql_connect('', '', '') or die(mysql_error()); 
    mysql_select_db("") or die(mysql_error()); 
    if(!isset($_GET['page'])){ 
        $page = 1; 
    } else { 
        $page = $_GET['page']; 
    } 
    //pulls results from database
    $max_results = 10;
    
    $total_results = mysql_result(mysql_query("SELECT COUNT(id) FROM business"),0);
    //name of query web pages is page
    $total_pages = ceil($total_results / $max_results);$page = (int)$_GET['page'];
    $from = (($page * $max_results) - $max_results); 
    $data = mysql_query("SELECT image, url, webname, description FROM business ORDER BY id ASC LIMIT $from, $max_results") or die(mysql_error()); 
    while ($info = mysql_fetch_array($data))
    { 
    Print $info['Name']; 
    echo "<p><a style='font-weight: bold; color: rgb(0, 0, 140); font-size: 14px;' href='$info[url]' target='_blank'>$info[webname]</a>  <span style='font-size: 14px; font-family: arial,sans-serif; padding-right: 3px;'>$info[description]</span></p>";
    } 
    //show current and previous page numbers
    echo "<br /><br /><span style='margin-left:20px'></span>";
    if($page > 1){ 
        $prev = ($page - 1); 
        echo "  <a style='color: rgb(0, 0, 128)' href=\"".$_SERVER['PHP_SELF']."?page=$prev\">Previous<<</a>   "; 
    } 
    
    for($i = 1; $i <= $total_pages; $i++){ 
        if(($page) == $i){ 
            echo "<span style='color: rgb(138, 0, 0);font-weight:bold'>$i </span>"; 
            } else { 
                echo "<a style='color: rgb(0, 0, 128)' href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> "; 
        } 
    } 
    
    // build next links 
    if($page < $total_pages){ 
        $next = ($page + 1); 
        echo "  <a style='color: rgb(0, 0, 128)' href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next>></a>"; 
    }
    ?>

     

    When the first page is loaded  or any links with this name like

    http://www.awebsite.com/business.php?page=1

     

    Then it shows the results for a whole page for the first page, and lists the numbers for the other pages for people to click on or not.

     

    The problem I am having is the search engines are also showing this page. http://www.awebsite.com/business.php

    and I don't know why. I have no links going to that page but the search engines are finding it automatically anyway. But when people go to that page http://www.awebsite.com/business.php

    All it shows is page numbers only and no content. Is there anything I can change in this pagination so that the lowest page found is not http://www.awebsite.com/business.php but http://www.awebsite.com/business.php?page=1 instead?

    Please let me know, thanks.

     

     

  10. I've got this:

     

    <?php
    $text = Array(); 
    $text[1] = "test1"; 
    $text[2] = "test2"; 
    $text[3] = "test3";
    $get = $text[rand(1, 3)];
    echo $get;
    ?> 

     

    It's working, now I just need to keep the same one from occurring twice in a row. Not sure how.

  11. Thanks, I looked up keys but don't know what you mean by number of keys. I need to keep the numbers in the array because I'll be rotating other numbers as well. Maybe it can be done without the cookies as well, since its random.

  12. Maybe there's a way to get it to output a number from the array first like 1, 2, or 3 and then put that into the random function? Anyone know how to get it to output an array number? Or maybe there is an easier way.

     

    I was missing the whole code, here's all of it.

     

    <?php 
    $maximum=3; 
    $a = (isset($_COOKIE['e']) && intval($_COOKIE['e']) < $maximum)? intval($_COOKIE['e'])+1 : 1; 
    setcookie("e", $a, time()+60*60*24*180); 
    $text = Array();
    $text[1] = "test1"; 
    $text[2] = "test2"; 
    $text[3] = "test3";
    php echo "$text[$a]";
    ?> 

  13. Hello, how would I get this to choose a line of text randomly instead of in order so it doesn't pick the same one twice in a row? Please let me know, thanks very much.

     

    <?php 
    $maximum=3; 
    $a = (isset($_COOKIE['e']) && intval($_COOKIE['e']) < $maximum)? intval($_COOKIE['e'])+1 : 1; 
    setcookie("e", $a, time()+60*60*24*180); 
    $text[1] = "test1"; 
    $text[2] = "test2"; 
    $text[3] = "test3";
    php echo "$text[$a]";
    ?> 

  14. I really appreciate your taking the time to help btherl. The problem I was having with preg_match is no one could give me a way to pull a image anywhere out of the line of the array. It only worked if the .jpg etc was close to the end of the line. Maybe they were giving me the wrong information, I couldn't find a way to do it with preg_match. But preg_grep was working.

     

    Almost all is working with your last post and its very close now, except for one thing. Its showing all array lines instead of just one. I tried attaching $contenttimer to

    print $image[$contenttimer]; and a few other places I thought might work and it didn't. Anyone know how to pull one line of the array out at a time but keeping most of the rest? Thanks.

     

  15. I really appreciate that, I tried invert before and don't know how to get it to work like it is supposed to. But that helped a little bit. Now its showing both items at the same time, its not picking one or the other. Here's what I have if I put else if on the second one it says "unexpected T else."  Anyone know a lot about preg grep and invert or know what I'm doing wrong? Thank you.

     

    <?php
    ini_set('error_reporting', 8191);
    ini_set('display_startup_errors', 1);
    ini_set('display_errors', 1);
    $content = Array(); 
    $content[1] = "http://www.website.com/textfile.txt";
    $content[2] = "<img src='http://www.website.com/thatfile.gif'/>";
    $content[3] = "<img  src='http://www.website.com/thisfile.jpg'/>";
    $contenttimer = date("s")%count($content)+1; 
    $matches = preg_grep('/(?:jpg)|(?:gif)/', $content);
    $non_matches = preg_grep('/(?:jpg)|(?:gif)/', $content, PREG_GREP_INVERT); 
    if($matches);
    {$gcontent = $content[$contenttimer];
    echo $gcontent;}
    if($non_matches);
    {$gcontent = file_get_contents($content[$contenttimer]); 
    echo $gcontent;} ?>

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