Jump to content

Q695

Members
  • Posts

    783
  • Joined

  • Last visited

Everything posted by Q695

  1. How do you automatically add commands like strip slashes () around a $_GET, $_POST, et al?
  2. ???I've tried it, and it didn't help too much. ???
  3. In the shortest, and most complete answer how does one need to set up their site to have pay pal work with it, and not kill the data that the user is submitting?
  4. Why doesn't this work, and is there a way to make it work? SELECT * FROM ads WHERE ( * LIKE '%a%' ) OR ( * LIKE '%b%' ) # Server version: 5.0.51a-community # Protocol version: 10 # Server: Localhost via UNIX socket
  5. state id was text, but i did solve it.
  6. There is a good answer to a log in script on answers.
  7. I was referring to the one in the bar at the top of the page.
  8. How does php freaks do things like their search engine?
  9. if ($cost>=1) { if ($cost==round($cost)) { $cost="$".$cost.".00"; } else { $cost="$".$cost."0"; }
  10. Try this out, because I had a very similar issue: if ($cost>=1) { if ($cost=abs($cost)) { $cost="$".$cost.".00"; } else { $cost="$".$cost."0"; }
  11. Why is't the file working properly? //e-mail script else { $aid=1; //$_GET['ad_id']; $key=2; //$_SESSION['key']; $to="**@**"; $subject="Confirm your post on Assertive Classifieds"; //message body $message=" <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> <title>Confirm your post on Assertive Classifieds</title> </head> <a href=\"***\">Please click here to activate your ad.</a> </body> </html> "; //e-mail from $from="invalid@***"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; if ((strstr($to, "@") && (strstr($from, "@") && ($subject) && ($message)))) { mail($to, $subject, $message, $headers); echo "Mail sent"; } else { echo "Mail was unable to be sent at this time due to an e-mail issue."; } }
  12. Why isn't the following outputting several states when several states are being passed to it? if ($_POST['action']=1) { foreach ($_POST['state_id'] as $var => $value) { echo "$value<br />"; } } ???
  13. I just created a class to solve the issue with the help of someone in a chat room:D .table { width:100%; position:relative; margin-top:-22px; }
  14. I've been having trouble embedding a table within a table for a while now, and feel like giving up. I use a php include for this application, to more easily perform layout. The reason I'm rewriting the pages is because I'm unable to contact the old webmaster to get the files off his server for some reason, and he sold his business that is currently hosting the pages. Master page is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <?php //error_reporting(E_ALL); $page=$_GET['page'] ?> <meta content="en-us" http-equiv="Content-Language"> <title>MN - SD52 - GOP</title> <style type="text/css"> .text { color: #FFFFFF; font-weight: bold; } .text2 { color:#0000FF; } .textb { color:red; } .link { text-decoration: none; } .rule { height:3px; background:#000080; border:0px; } .hr { background:red; border:0; height:6px; } </style> </head> <body bgcolor="blue" text="white" style="margin: 0;"> <table cellspacing="0" align="center" border="0"> <tr> <td colspan="2" bgcolor="white"> <img src="images/banner_top2.jpg"> </td> </tr> <tr> <td align="center" bgcolor="#CC0000" colspan="2"> <strong> <a class="link" href="?page=0"><span class="text">Home</span></a> | <a class="link" href="?page=1"> <span class="text">SD 52 Info</span></a> | <a class="link" href="?page=2"> <span class="text">News</span></a> | <a class="link" href="?page=3"> <span class="text">Calendar</span></a> | <a class="link" href="?page=4"> <span class="text">Elected Republicans</span></a><b> | </b> <a class="link" href="?page=5"> <span class="text">Links</span></a> | <a class="link" href="?page=6"> <span class="text">Get Involved</span></a> | <a class="link" href="?page=7"> <span class="text">Contribute</span></a> | <a class="link" href="?page=8"> <span class="text">Contact Us</span></a> </strong> </td> </tr> <tr> <td align="center" style="background-color:white;padding:0;"> <?php if (0<=$page & $page<= { switch ($page) { case 0: include"home.php"; break; case 1: include"sd_info.php"; break; case 2: include"news.php"; break; case 3: include"calendar.php"; break; case 4: include"elected.php"; break; case 5: include"links.php"; break; case 6: include"involve.php"; break; case 7: include"contribute.php"; break; case 8: include"contact.php"; break; } } /*-------side bar------------- side navagation bar goes here use "?page=$page&sub="___number___ for hyperlink start with sub=0 only include the body/td text for html compliance referr to info.php for example remember to use the style scripts */ /*text would go here will pull from a text database follow rules for the side bar */ ?> </td> <td bgcolor="#CC0000" align="center" style="width:100px" valign="top"> <?php include "basic/info.php"; ////////////////I'm currently working on this portion, but feel free to work on it for layout if you have time ?> </tr> <tr> <td colspan="3" bgcolor="#CC0000" align="center"> <strong>Paid for by the Republican Party of Minnesota Senate District 52. <br>Not authorized by any candidate or candidate committee.</strong></td> </tr> </table> </body> </html> Slave page is: <table bgcolor="white" align="center" border="0" cellpadding="0" cellspacing="0"> <?php $sub=$_GET['sub']; if (!$sub) { $sub=3; } echo " <td bgcolor=\"#CC0000\" style=\"width:125px\"> <center> <font color=\"#ffffff\"><strong>Contact Us</strong></font> <hr class=\"rule\"> <a class=\"link\" href=\"?page=$page&sub=0\"> <span class=\"text\"> Volunteer</span></a><br><hr class=\"rule\"> <a class=\"link\" href=\"?page=$page&sub=1\"> <span class=\"text\"> Contribute</span></a><br><hr class=\"rule\"> <a class=\"link\" href=\"?page=$page&sub=2\"> <span class=\"text\"> Minnesota PCR</span></a><br><hr class=\"rule\"> <a class=\"link\" href=\"?page=$page&sub=3\"> <span class=\"text\"> Contact Us</span></a><hr class=\"rule\"> </center> </td> <td bgcolor=\"white\" valign=\"top\"> <div style=\"text-align:center\"> <font color=\"navy\" size=\"16\"> Senate District 52</font> </div> <hr style=\"color:red; background:red; height:5px\"> </td> "; ?> </table>
  15. I have: error reporting: on session variable display: on session start: on at log in it is for a simple log out script.
  16. When you do the following commands to unset a variable, it doesn't completely destroy the variable, but it doesn't use other session ids: session_destroy(); unset($_SESSION['id']); It also does this when you log in on at the log in page without logging out. It took me about an hour to finally figure out that it didn't wipe the value completely. What is the work around for this flaw, or hasn't it been built in yet?
  17. I figured it out with the help of PHPmyadmin 2.10.1 query editor . now I just need to fix it up a little but here is the basic script: $sql = "SELECT `provider`.`cid`, `people`.`id`, `people`.`first_name`, `people`.`last_name` FROM provider, people WHERE cid = id ORDER BY `people`.`id` ASC;"; $result=@mysql_query($sql,$con) or die(death($sql)); while ($row = @mysql_fetch_array($result)) { $cid = $row["cid"]; $first_name = $row["first_name"]; $last_name = $row["last_name"]; echo ("$first_name $last_name<br>");
  18. I'm still confused . How would I create the join with my mysql scripts not changing using PHP, since I will need to do something similar several times ???
  19. That is what I was trying to do, but how would I write it?
  20. The current output is: <select size="1" name="provider" onChange="this.form.provider.value="> <option selected>Select a provider</option><option>1</option><option>3</option></select>
  21. Where would I need to put a MySql statement in the following script (combine the two to get one output statement): /////////////////////////////////////////////////////////////////////////////////// $sql="select cid from provider where pid=\"$id\""; $result=@mysql_query($sql,$con) or die(death($sql)); while ($row = @mysql_fetch_array($result)) { $cid = $row["cid"]; echo("<option>" . $cid . "</option>");$cid . "<br>"; } ///////////////////////////////////////////////////////////////////////////////////// $sql="select * from people where id=\"$cid\";"; $result=@mysql_query($sql,$con) or die(death($sql)); while ($row = @mysql_fetch_array($result)) { echo "$sql<P>"; echo("<option>" . $row["first_name"] . " " . $row["last_name"] . "</option>"); } //////////////////////////////////////////////////////////////////////////////////////////// Whenever I change one little thing it seems to create a syntax error for some reason (provider is a xref table) ??? any advice on how to fix my issue, or code to do it .
×
×
  • 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.