Jump to content

marcus

Members
  • Posts

    1,842
  • Joined

  • Last visited

Posts posted by marcus

  1. [code=php:0]
    echo "<tr><td align=center bgcolor=gray><font face=Arial color=#FFFFFF>-</font></td>";
    echo "<td align=center bgcolor=gray><font face=Arial color=#FFFFFF>INACTIVE</font></td></tr>";
    }

    }
    elseif (mysql_num_rows($q) > 0)
    [/code]

    I'm not sure if you needed that bracket at the end of your echoing. Just remove the either one of the closing brackets.
  2. I was pointing out that if you were to echo out YOUR $str line and it contained a variable ($) inside of it, that it would echo off the variable name instead of the content of the variable.

    [code=php:0]
    <?php
    $varname = hello;
    $str = '<td><p class="classname">$varname</p></td>';

    echo $str;
    ?>
    [/code]

    In the table cell it would echo off $varname instead of hello, unless you went my way

    [code=php:0]
    <?php
    $varname = hello;
    $str = "<td><p class='".classname."'>$varname</p></td>";
    echo $str
    ?>
    [/code]

    In which case you would get the return of hello instead of $varname.
  3. [quote author=jesirose link=topic=119797.msg490943#msg490943 date=1166930969]

    [quote]$str = '<td><p style="className">Text</p></td>';[/quote]

    [/quote]

    Well, it wouldn't matter either way. But it would matter if he were to echo a variable. You could always escape the double quotes.

    [code]
    $str = "<td><p style='".classname."'>$var1 is a person</p></td>";
    [/code]
  4. it's referring to the second line of that.

    [code]
    if(mysql_num_rows($q) > 1) {
    echo "<tr><td align=center bgcolor=gray><font face=Arial color=#FFFFFF>-</font></td>";
    echo "<td align=center bgcolor=gray><font face=Arial color=#FFFFFF">INACTIVE</font></td></tr>";
    }
    [/code]
  5. Wow, your code is a complete mess.

    [code]echo "<td bgcolor="#00FFFF">WATCHING</td>";[/code]

    You're basically trying to start a new string on that line.

    [code]echo "<td bgcolor='".#00FFFF."'>WATCHING</td>";[/code]

    Escape your quotes. You can't have another set of double quotes inside another unless you escape them.

    So basically it's:
    [code]singlequote(')doublequote(")period(.)TEXTINSIDEHEREperiod(.)doublequote(")singlequote(')[/code]

    As long as TEXTINSIDEHERE doesn't include any single or double quotes or any periods it will work fine. You need to clean up your code too, put some indents in there so you can recognize individual if and elseif statements.
  6. [code=php:0]
    <?php
    $name = $_POST[name];
    $email = $_POST[email];
    $comments = $_POST[comments];
    if (!isset($name) || !isset($email) || !isset($comments)) {
    header("Location: http://www.mysite.com/noresponse.htm");
    exit;
    }else {


    $msg = "E-MAIL SENT FROM $email\n";
    $msg .= "Sender's Name: $name\n";
    $msg .= "Sender's E-Mail: $email\n";
    $msg .= "Sender's Place: $place\n";
    $msg .= "Message: $comments\n\n";


    $to = "myname@gmail.com";
    $subject = " Feedback";
    $mailheaders = "From: Response Forms <> \n";
    $mailheaders .= "Reply-To: $email\n\n";

    $send = mail($to, $subject, $msg, $mailheaders);
    ?>
    <HTML>
    <HEAD><TITLE>My site - Thank You</TITLE>
    <meta http-equiv="refresh" content="10;url=http://www.mysite.com/contactus.htm">
    </HEAD>
    <BODY>
    <p><img src="images/banner.jpg" width="446" height="100"><img src="images/shubha.jpg" width="354" height="100"></p>
     
    <H1>Thank you. Your response is valuable to us.</H1>

    <P><strong>Your Name:</strong>
    <? echo "$name"; ?>
    <P><strong>Your E-Mail Address:</strong>
    <? echo "$email"; ?>
    <P><strong>You are from:</strong>
    <? echo "$place"; ?>
    <P><strong>Message:</strong>
    <? echo "$comments"; ?>
    <H3>Please wait and you will be taken back to the page you were viewing</H3>

    </BODY>
    </HTML>
    <?php
    }
    ?>
    [/code]
  7. [code]
    <?php
    if (!isset($name) || !isset($email) || !isset($comments)) {
    header("Location: http://www.mysite.com/noresponse.htm");
    exit;
    }else {


    $msg = "E-MAIL SENT FROM $email\n";
    $msg .= "Sender's Name: $name\n";
    $msg .= "Sender's E-Mail: $email\n";
    $msg .= "Sender's Place: $place\n";
    $msg .= "Message: $comments\n\n";


    $to = "myname@gmail.com";
    $subject = " Feedback";
    $mailheaders = "From: Response Forms <> \n";
    $mailheaders .= "Reply-To: $email\n\n";

    $send = mail($to, $subject, $msg, $mailheaders);
    if($send){
    ?>
    <HTML>
    <HEAD><TITLE>My site - Thank You</TITLE>
    <meta http-equiv="refresh" content="10;url=http://www.mysite.com/contactus.htm">
    </HEAD>
    <BODY>
    <p><img src="images/banner.jpg" width="446" height="100"><img src="images/shubha.jpg" width="354" height="100"></p>
     
    <H1>Thank you. Your response is valuable to us.</H1>

    <P><strong>Your Name:</strong>
    <? echo "$name"; ?>
    <P><strong>Your E-Mail Address:</strong>
    <? echo "$email"; ?>
    <P><strong>You are from:</strong>
    <? echo "$place"; ?>
    <P><strong>Message:</strong>
    <? echo "$comments"; ?>
    <H3>Please wait and you will be taken back to the page you were viewing</H3>

    </BODY>
    </HTML>
    <?php
    }else {
    echo "your mail was not delivered";
    }
    }
    ?>
    [/code]
  8. Um, that wouldnt work, the url is given as a get, and i'm trying to make it produce it so that links with href=" will be produced in href="http://cs-blog.net/file.php?url=$url" and if it was from chyea.net the index would just stay at chyea.net then if you clicked contact it would be href="http://cs-blog.net/file.php?url=http://chyea.net versus href="http://cs-blog.net/file.php?url=http://chyea.net/contact.php"

    But on the page it comes out with: http://cs-blog.net/file.php?url= but in the source it shows http://cs-blog.net/file.php?url=$url"contact.php"

    [code]
    <?php
    $url = $_GET['url'];
    if(!isset($url)){
    echo "<form method=get><input type=text name=url value=http://><input type=submit value=Go></form>";
    }else {
    $file = file_get_contents("$url");
    echo "<form method=get><input type=text name=url value=http://><input type=submit value=Go></form><br><br>";
    $replace = 'href="http://cs-blog.net/file.php?url=$url"';
    $file = str_replace('href="',$replace,$file);
    $file = str_replace('../',"",$file);
    echo $file;
    }
    ?>
    [/code]
  9. say, the url you typed in was like miniclip.com or something. the links there are just href="/games/gamename.php"

    i want so when the person clicks that it will go to ?url=http://miniclip.com/games/gamename.php

    that didnt work ken, when i went to my other site, chyea.net and tried to click contact it stayed on chyea.net not chyea.net/contact.php

  10. Parse error: syntax error, unexpected T_STRING in /home/csblog/public_html/file.php on line 8


    What I am trying to do, is to get file contents of a website and echo them off, but if a link exists i want it to also direct it to the same page

    [code]
    <?php
    $url = $_GET['url'];
    if(!isset($url)){
    echo "<form method=get><input type=text name=url value=http://><input type=submit value=Go></form>";
    }else {
    $file = file_get_contents("$url");
    echo "<form method=get><input type=text name=url value=http://><input type=submit value=Go></form><br><br>";
    $replace = "href='."http://cs-blog.net/file.php?url=$url".'";
    $file = str_replace('href="',$replace,$file);
    echo $file;
    }
    ?>
    [/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.