Jump to content

mazman13

Members
  • Posts

    156
  • Joined

  • Last visited

    Never

Everything 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. Thanks man! That worked great... one quick question...running on like no sleep here... If I wanted to get only the 1st 3 on that XML file...how would I limit that? I couldn't do it with a foreach right?
  5. 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>
  6. 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
  7. I'm trying to find a pretty quick way to incorp XML feeds to your site. I had a HUGE code that I used on my old server, but I now moved to a new GoDaddy server and the code no longer works. So i'm trying to find something that will work. I host podcasts, so XML feeds are pretty important. Thanks guys
  8. Is there a function to see if a file exists on a server? I know the file_exists function, but that doesn't seem to work when you try to find it on a server instead of a computer. Any ideas?
  9. Ok so here is my plan... >Make a page with a list of tracks...next 2 each track is a BUY NOW button >They click it, go to paypal pay the bill >Then they come right back to my site and the track downloads... Can that be done? Am I missing anything?
  10. in my html? my html is working fine, its my string in $e_message from the text area that is throwing up extra spaces. is it because of the nl2br()? i've taken that off only to have it not break anything.
  11. [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
  12. 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?
  13. 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?
  14. So I still use the same function you posted? And then use the new code you posted for the output?
  15. Ok, that works, but i'm having array_shift() errors, I guess since there is no array its freakin' out. What do I replace that with?
  16. Ok! I def wanna use it, I'm just having a hard time following it. Would I have to customize it or anything? Do I erase the $test array?
  17. 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
  18. Code works great, just one lil' thing to fix to make it work: SELECT * FROM $tablename ORDER BY RAND[b]()[/b] LIMIT 1
  19. Wow! thats it? I don't even need that random PHP script huh? it will pick somethin on random huh?
  20. 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.
  21. Yeah I just thought about that. I don't need to update it with a text file, I just need to have that file count the number of rows in the database, and update that number... That will work. I'll test it and see how it goes. Thanks
  22. 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.
  23. 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?
  24. That script works. Thanks. Can you explain it? I think I have an idea, but I just want to make sure.
×
×
  • 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.