Jump to content

mazman13

Members
  • Posts

    156
  • Joined

  • Last visited

    Never

Posts posted by mazman13

  1. Try this:

     

    <?php 

    if (!empty($pk))

      {?>   

     

    <form action="google.php" method="GET" name="deleteForm" >

    <input type="hidden" name="pk" value="<? echo $pk;?>">

    <input type="submit" value="Delete">

    </form>

     

    <?php

      }

    >

     

    I'd rather do it like this. It's just a tad bit more work.

     

    <?php 

    if (!empty($pk))

      {   

     

    echo"<form action=\"google.php\" method=\"GET\" name=\"deleteForm\" >

    <input type=\"hidden\" name=\"pk\" value=\"<? echo $pk;?>\">

    <input type=\"submit\" value=\"Delete\">

    </form>";

    }

  2. Ok.

     

    So I'm writing a program for a bodyshop. Customers are asked 11 questions all with yes or no answers.  Yes is good, no is bad. From that they can take the overall % for the month and see what the approve rating is.

     

    I had a format I thought was going to work but as I got into it, it doesn't seem like it is going to work.

     

    Example:

     

    $a = 10; // How many questions did he answer yes to

    $b = 357; // How many customers they had this month

     

    Format:

     

    $c = ($a * 100) / $b;

     

    echo"$c";

    OUTPUT = 2.8%

     

    But that is just one customer. If I tallied up all the yes answers eventually they would be more than what I'm dividing them by and defeat the function.

     

    What should I do? Any ideas?

     

    We also want a way to track the overall approval rating for the past 12 months.

  3. Ok I'm writing a CSI program for a body shop and need to be able to take % from the data they receive.

     

    This works well:

     

    EI:

     

    $yes = "30";

    $total = "170";

     

    $newtotal = ($yes * 100) / $total;

     

    echo"$newtotal%";

     

    Answer is: 17.647058823529411764705882352941%

     

    How can I get the answer to just get:

    17.6%?

     

    Any ideas to limit this string?

    Thanks

  4. Hey man-

     

    I installed the program on my host, but for some reason its returning "object"...anything i'm doing wrong?

     

    <?php require_once('magpierss/rss_fetch.inc'); ?>

    <strong><font size="3">Download ANY of your favorite past shows here! But hurry,

    who knows how long they will be available?</font></strong><br /><br />

    <?php

    $url = "http://www.michaelzavala.com/feed.xml";

    $rss = fetch_rss($url);

    echo"$rss";

    ?>

    <br>

    </p>

  5. Yeah, and I'm just not having any luck finding anything that will work.

     

    The one thing I did find was that one huge PHP code that would read files, but its not working on the new server. Plus there has to be an easier way.

     

    I've used sites that can do it for you, i.e.(feedroll.com), but they charge now. And its a pain to go through them when you can (at least try) do it yourself.

     

    Thanks guys

  6. [b]Here is my code:[/b]

    //If a message is sent
    [color=red]if($action == "send")
      {
     
          $query = "SELECT * FROM $db";
      $result = mysql_query($query)
          or die ("Can't do anything with the query!");
      $num = mysql_num_rows($result);[/color]

    [color=green]
          $i=0;
    while ($i < $num) {
      $row = mysql_fetch_array($result,MYSQL_ASSOC); //starts to get e-mails from the database
          extract($row);[/color]

    [color=orange]$e_message = stripslashes($e_message); //converts the subject and message strings
    $e_message = nl2br($e_message);
    $e_subject = stripslashes($e_subject);[/color]

    sends the e-mails:       
    [i][color=navy]//Sends them the letter
            $to = "$ml_email";
            $subj = "$e_subject";
            $mess = "
            <html>
            <h2>$e_header</h2><p>
           
            $e_message<p>
           
            <font color='#666666' size='1' face='Tahoma, Times New Roman'>the michael zavala show is &copy 2006 by michael zavala<strong>

              <a href='http://www.themichaelzavalashow.com'>www.themichaelzavalashow.com[/url] | <a href='http://www.myspace.com/themichaelzavalashow'>www.myspace.com/themichaelzavalshow[/url]</strong></font>

             
    <strong><font color='#666666' size='1' face='Tahoma, Times New Roman'>please do not respond to this e-mail.

              </font></strong><font color='#666666' size='1' face='Tahoma, Times New Roman'>if you wish to stop receiving e-mails from the michael zavala show, please <a href='http://www.michaelzavala.com/show/mailinglist_unsubscribe.php?action=unsubscribe&ml_email=$ml_email' target='_blank'>unsubscribe[/url].</font><p>
           
            <a href='http://click.linksynergy.com/fs-bin/click?id=tOWLWDAF1Yk&offerid=78941.10001365&type=4&subid=0'><IMG alt='Apple iTunes' border='0' src='http://images.apple.com/itunesaffiliates/US/2006/09/05/MaryJBlige_468x60.jpg'>[/url]<IMG border='0' width='1' height='1' src='http://ad.linksynergy.com/fs-bin/show?id=tOWLWDAF1Yk&bids=78941.10001365&type=4&subid=0'>
           
            </html>";
            mail($to, $subj, $mess, "From: The Michael Zavala Show <show@themichaelzavalashow.com>\n" .
              "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1");
    $i++;
          }[/color][/i]
          echo("E-mail's have been sent.
    ");
      };

    [b]the output looks great...but the spaces:[/b]
    this is what i type in:
    [i]more...

    thanks
    michael[/i]

    [b]but it output for $e_message is:[/b]
    [color=limegreen][font=Verdana][font=Verdana]"more...







    thanks



    michael"[/font][/font][/color]

    I hope thats better, I don't know what code tags are
  7. I have a mailing list set up that will send a message to everyone in my database.

    But when it comes back with HUGE spaces...its prob somthin' simple, but I guess I'm missin it.

    Here is my code:
    if($action == "send")
    {

    $query = "SELECT * FROM $db";
    $result = mysql_query($query)
    or die ("Can't do anything with the query!");
    $num = mysql_num_rows($result);



    $i=0;
    while ($i < $num) {
    $row = mysql_fetch_array($result,MYSQL_ASSOC);
    extract($row);
    $e_message = stripslashes($e_message);
    $e_message = nl2br($e_message);
    $e_subject = stripslashes($e_subject);
    //Sends them the letter
    $to = "$ml_email";
    $subj = "$e_subject";
    $mess = "
    <html>
    <h2><b>$e_header</b></h2><p>

    $e_message<p>

    <font color='#666666' size='1' face='Tahoma, Times New Roman'>the michael zavala show is &copy 2006 by michael zavala<strong><br />
    <a href='http://www.themichaelzavalashow.com'>www.themichaelzavalashow.com</a> | <a href='http://www.myspace.com/themichaelzavalashow'>www.myspace.com/themichaelzavalshow</a></strong></font><br />
    <br /><strong><font color='#666666' size='1' face='Tahoma, Times New Roman'>please do not respond to this e-mail.<br />
    </font></strong><font color='#666666' size='1' face='Tahoma, Times New Roman'>if you wish to stop receiving e-mails from the michael zavala show, please <a href='http://www.michaelzavala.com/show/mailinglist_unsubscribe.php?action=unsubscribe&ml_email=$ml_email' target='_blank'>unsubscribe</a>.</font><p>

    <a href='http://click.linksynergy.com/fs-bin/click?id=tOWLWDAF1Yk&offerid=78941.10001365&type=4&subid=0'><IMG alt='Apple iTunes' border='0' src='http://images.apple.com/itunesaffiliates/US/2006/09/05/MaryJBlige_468x60.jpg'></a><IMG border='0' width='1' height='1' src='http://ad.linksynergy.com/fs-bin/show?id=tOWLWDAF1Yk&bids=78941.10001365&type=4&subid=0'>

    </html>";
    mail($to, $subj, $mess, "From: The Michael Zavala Show <show@themichaelzavalashow.com>\n" .
        "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1");
    $i++;
    }
    echo("<b>E-mail's have been sent.</b><br />");
    };

    the output looks great...but the spaces:

    "more...







    thanks



    michael"

    I guess it's adding more <br>s??
    Any ideas?
  8. Thanks Andy-

    I got it now. The lightbulb went on.

    I did have a probem, on this blog, the links will show up, but if your adding and html embed for a youtube video...it takes that out. lol So i think i'm gonna stick with one or the other.

    Thanks for your help!

    Does the script you posted all deal with .net, .org, and so on?
  9. Alright, I'm a little confused, I'm still a tab bit new with php.

    There is no simple way to auto-format a string, I got that.

    So what do I do if my string it:
    "I saw a website and it was www.cool.com"

    I want www.cool.com to be a link...can I add something before and after the www.cool.com and have a function, search and replace it with html? That prob won't work.

    But I just need some ideas, and maybe some explainin' to get my mind wrapped around it!
    Thanks-
    Michael
  10. Ok, I have a script that picks a random number based on the number of banners in my database.

    The number is used to pick a rank number in the banners.

    example: random number 1, so it picked picture.jpg (rank no. 1) from the database and plays it.

    Is there a way, to just have it pick a row number.

    example: SELECT * FROM database WHERE COL NUMBER IS (random number from script)

    cuz the way i have it now, if i erase a banner now, the image rank is erased, so some banners might now be picked. can i get info from a row number? i hope people can understand what i'm saying...

    ask questions if you don't understand...i havn't slept much this week.
  11. Well I'm using this script to pick a random number for banner ads. Everything is already in place and working, I just don't like adding a banner to the database AND updating that file to a new number everytime. I would like to add to the database and have PHP update the number.

    It random. 1 - whatever numbers of banners there are in the database. Right now I have 7, so its 1, 7. But if I add another one I want PHP to make it to 8 and so on.

  12. I'm trying to have it so my PHP script will rewrite a PHP file with the following information:

    <?php $imgad_num = rand(1, [b]$num[/b]); ?>

    The $num of course will be replaced with a number before it's sent out, so the writing will be:

    <?php $imgad_num = rand(1, 8); ?>
    Something like that.

    Can I put this in a var?
    Anyideas?

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