Jump to content

onekoolman

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by onekoolman

  1. Heres the code:

    [code]<?php
    if($_POST['$value'] == 'a' || 'b' || 'c' || 'd' || 'e' || 'f' || 'g' || 'h' || 'i' || 'j' || 'k' || 'l' || 'm' || 'n' || 'o' || 'p' || 'q' || 'r' || 's' || 't' || 'u' || 'v' || 'w' || 'x' || 'y' || 'z')
    echo "<img src='http://www.domain.com/styles/1/images";
    echo "/";
    echo "$value";
    echo ".gif'>";
    ?>[/code]

    Is there a way, so that ANY time a letter is typed in a textarea it is posted as an image? If theres a space I want blank.gif to display.

    Example:

    "I Type This"

    I want: (To be displayed)

    [code]<img src="http://www.domain.com/styles/1/images/i.gif">
    <img src="http://www.domain.com/styles/1/images/blank.gif">
    <img src="http://www.domain.com/styles/1/images/t.gif">
    <img src="http://www.domain.com/styles/1/images/y.gif">
    <img src="http://www.domain.com/styles/1/images/p.gif">
    <img src="http://www.domain.com/styles/1/images/e.gif">
    <img src="http://www.domain.com/styles/1/images/blank.gif">
    <img src="http://www.domain.com/styles/1/images/t.gif">
    <img src="http://www.domain.com/styles/1/images/h.gif">
    <img src="http://www.domain.com/styles/1/images/i.gif">
    <img src="http://www.domain.com/styles/1/images/s.gif">[/code]

    The form

    [code]<form action="post.php" method="POST">
    <text area name="value" rows="50" cols="10">
    </textarea>
    </form>[/code]
  2. I still actually have a small problem. I want the includes to come from a different directory not the one the script runs in..


    In this code I want my directory before the $GET function, I tried but its just giving errors:

    [code]if (isset($_GET['page1']) && in_array($_GET['page1'],$page1)) {
    include /MYDIRECTIORY/($_GET['page1'].".php");[/code]


    The Remaining Codes: To call a page you would use [a href=\"http://www.domain.com/index.php?page1=type1\" target=\"_blank\"]http://www.domain.com/index.php?page1=type1[/a]
    The page its calling would reside in the same directory, named type1.php

    [code]<?php
    $page1 = array("type1","type2","type3");
    $page2 = array("type1","type2","type3");
    $page3 = array("type1","type2","type3");
    $page4 = array("type1","type2","type3");

    if (isset($_GET['page1']) && in_array($_GET['page1'],$page1)) {
    include ($_GET['page1'].".php");
    }
    elseif (isset($_GET['page2']) && in_array($_GET['page2'],$page2)) {
    include($_GET['page2'].".php");
    }
    elseif (isset($_GET['page3']) && in_array($_GET['page3'],$page3)) {
    include($_GET['page3'].".php");
    }
    elseif (isset($_GET['page4']) && in_array($_GET['page4'],$page4)) {
    include($_GET['page4'].".php");
    }
    else {
    include("includes/main.php");
    }
    ?>[/code]
  3. The site is running, on that code, its modified for the site, the reason why is cause itll take hours to get it remodified, and I dont have that time, the entire site works fine, but the hompage doesnt show up right.
    Cause it doesnt have a default. the most I could do was make a case for ?page=main, but thats not loaded when you go directly to the site. Making another page could work, but that would also take hours because the links are based on index.php. So I dont know I was looking for the kind-of fix that I described, if its not possible np, I will just live with it for a while. Thanks.
  4. Like I said the example is setup as an example theres a reason behind it, but I don't know how to explain it, I will setup an example site somewhere..

    What im saying is if I add a default code at the bottom, if your in the switch at the bottom which is #4 that default shows if theres no case, and when theres a case it doesnt. But if its a request for a switch above that one that default also displays, which is what I want to eliminate. I only want default to display if there is no request by index.php.

    as soon as ?page shows up I dont want default.

    Full working example..

    [a href=\"http://www.scrapbooking4ever.com/\" target=\"_blank\"]http://www.scrapbooking4ever.com/[/a]
  5. Using the code below, I am trying to figure out a way to have a default of all the switch statements, but if I put a default at the end of them all, if the statement isnt switch page4, it shows up on page 1, page 2, and page 3.

    Is there a way to have all the statements, but default only displays when there is NO index.php?thing=case

    So if its [a href=\"http://www.domain.com\" target=\"_blank\"]http://www.domain.com[/a] it shows default, and if its [a href=\"http://www.domain.com/index.php\" target=\"_blank\"]http://www.domain.com/index.php[/a] it still shows it.

    Yet if its [a href=\"http://www.domain.com/index.php?page1=p1\" target=\"_blank\"]http://www.domain.com/index.php?page1=p1[/a] it shows that page, but not the default.

    There's a reason behind why I want it that way for my site, the example below shows it as not needed, but thats the way I need it.

    [code]<?php

    switch($_GET['page1']) {

       case "p1":
          include("includes/page1.php");
       break;

    }

    switch($_GET['page2']) {

       case "p2":
          include("includes/page2.php");
       break;

    }

    switch($_GET['page3']) {  

       case "p3":
          include("includes/page3.php");
       break;

    }

    switch($_GET['page4']) {

       case "p4":
          include("includes/page4.php");
       break;

    }

    ?>[/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.