-
Posts
557 -
Joined
-
Last visited
Never
Everything posted by unidox
-
Here: <?php echo "<h2>Send Message</h2><p> <form action=\"mail2.php?action=sendmsg\" method=\"post\"> <input type=\"radio\" name=\"type\" value=\"1\" class=\"text_box\"> Email<br /> <input type=\"radio\" name=\"type\" value=\"2\" checked class=\"text_box\"> Private Message<br /> To<br /> <input type=\"text\" name=\"to\" class=\"text_box\"><p> From<br /> <select name=\"from\" size=\"1\" class=\"text_box\">"; $sql = mysql_query("SELECT * FROM `members` WHERE site = '$Z' ORDER BY `username` = '" . mysql_escape_string($username) . "' ASC"); while($row = mysql_fetch_array($sql)) { $us = $row["username"]; print "<option value=\"" . $us . "\">" . $us . "</option> <option value=\"" . $us . "@eaglelegend.com\">" . $us . "@eaglelegend.com</option>"; } print "</select><p> Subject<br /> <input type=\"text\" name=\"subject\" size=\"30\" class=\"text_box\"><p> Message<br /> <textarea rows=\"6\" cols=\"60\" nowrap name=\"message\" class=\"text_box\"></textarea><p> <input type=\"submit\" value=\" Send Message \" class=\"text_box\"></form>"; ?> You didnt need the ending }
-
[SOLVED] How do I pull out the highest value in MySQL?
unidox replied to Klance's topic in PHP Coding Help
That will work. -
Here, I cleaned up your code: <? echo "<h2>Send Message</h2><p> <form action=\"mail2.php?action=sendmsg\" method=\"post\"> <input type=\"radio\" name=\"type\" value=\"1\" class=\"text_box\"> Email<br /> <input type='radio' name='type' value='2' checked class='text_box'> Private Message<br /> To<br /> <input type=\"text\" name=\"to\" class=\"text_box\"><p> From<br /> <select name=\"from\" size=\"1\" class=\"text_box\">"; $sql = mysql_query("SELECT * FROM `members` WHERE site = '$Z' ORDER BY `username` = '" . mysql_escape_string($username) . "' ASC"); while($row = mysql_fetch_array($sql)) { $us = $row["username"]; print "<option value=\"" . $us . "\">" . $us . "</option> <option value=\"" . $us . "@eaglelegend.com\">" . $us . "@eaglelegend.com</option>"; } print "</select><p>"; ?>
-
Try this: print "<h2>Send Message</h2><p> <form action='/mail2.php?action=sendmsg' method='post'> <input type='radio' name='type' value='1' class='text_box'> Email<br> <input type='radio' name='type' value='2' checked class='text_box'> Private Message<br> To<br> <input type='text' name='to' class='text_box'><p> From<br> <select name='from' size='1' class='text_box'>"; <?php $sql = mysql_query("SELECT * FROM `members` WHERE `site`=\"$Z\" ORDER BY `username`='".mysql_escape_string($username). ASC"); while($row = mysql_fetch_array($sql)) { $us = $row["username"]; print "<option value=" . $us . ">" . $us . "</option> <option value=\"" . $us . "@eaglelegend.com\">" . $us . "@eaglelegend.com</option>"; } ?> print "</select><p>";
-
Well I have figured out you cant use ORDER BY and LIMIT in the same query. Anyone know an alternative?
-
You need a public smtp server, google it.
-
Can we see html and php code?
-
I keep getting not a valid mysql resource. Here is my code: $q = mysql_query("SELECT * FROM `pcp_users` ORDER BY 'user_id' DESC WHERE level >= '$lvl' AND level != '1' AND username != '$user' AND conf = '1' LIMIT $start, $limit");
-
Apache HTTP Web Server. Google for tutorials, you can also try WAMP
-
Try moving session_start() to the top of the login script.
-
Got it to work: $url = "site.com?key=" . SITE_LIC . "&ref=" . $_SERVER["HTTP_REFERER"] . ""; $lic = fopen($url, "r"); $lic = fgets($lic, 4096); define('LIC_CHECK', $lic); if (LIC_CHECK != 1) { header("Location: http://www.site.com/index.php?p=lic_invalid"); exit(); }
-
here: <?php print "<table width='100%' class='tbl-border'>\n"; print "<tr><th class='tbl2'>Date</th><th class='tbl2'>Home Team</th><th class='tbl2'>Score</th><th class='tbl2'>Visiting Team</th><th class='tbl2'>Score</th>"; if ($show_fields) print "<th class='tbl2'>Field</th>\n"; $queryscores="SELECT sportsdb_wins.winid, sportsdb_wins.windate, sportsdb_wins.wintime, sportsdb_wins.game_date, sportsdb_wins.game_time, sportsdb_wins.rf, sportsdb_wins.ra, sportsdb_wins.wincomments, sportsdb_wins.field, sportsdb_wins.winortie, sportsdb_teams2.teamname AS winningteam, sportsdb_teams.teamname AS losingteam FROM sportsdb_wins, sportsdb_teams AS sportsdb_teams2, sportsdb_teams, sportsdb_divs WHERE sportsdb_teams.teamdiv = sportsdb_divs.divid AND sportsdb_divs.conference = $confid AND sportsdb_teams2.teamid = sportsdb_wins.winner AND sportsdb_teams.teamid = sportsdb_wins.loser AND sportsdb_wins.winortie != 3"; // Sort by team if specified if (isset($_POST['teamtosort']) && $_POST['teamtosort'] != 'all') { $teamtosort = intval($_POST['teamtosort']); $queryscores .= " AND (sportsdb_wins.winner = $teamtosort OR sportsdb_wins.loser = $teamtosort)"; } $queryscores .= " ORDER BY wintime ASC"; $resultscores=mysql_query($queryscores); $numscores=mysql_numrows($resultscores); while ($scores = mysql_fetch_array($resultscores, MYSQL_ASSOC)) { if ($scores['confid'] > '11') { $windateheader=$scores['windate']; $windateformatted=date("l, F j",$windateheader); $time = date('g:i a',$scores['wintime']); $time = ($time == "12:00 am")? "<font color='#ff0000'>TBA</font>" : $time; print "<tr><td class='tbl1'>$windateformatted</td><td class='tbl1'>{$scores['winningteam']}</td>"; print "<td class='tbl1' align='center'><b>{$scores['rf']}</b></td> <td class='tbl1'>{$scores['losingteam']}</td>"; print "<td class='tbl1' align='center'><b>{$scores['ra']}</b></td>"; if ($show_fields) print "<td class='tbl1'>{$scores['field']}</td>"; if ($scores['winortie'] == 2 || $scores['winortie'] == 5) print " (ff)"; print "</td></tr>\n"; } } echo "</table>\n"; ?>
-
I have this code: $url = "site.com?key=" . SITE_LIC . "&ref=" . $_SERVER["HTTP_REFERER"] . ""; $lic = fopen($url, "r"); $lic = fgets($lic, 4096); if ($lic == 1) { echo "Verified"; } else { echo "Suspended"; } If I echo $lic it says 1, but if I use the if statement, it keeps saying suspended. Whats wrong?
-
Ok, I was also wondering what does -> do? I have seen in some scripts people have ->. Like $db->query
-
What is the @ in php used for? Like @mysql_connect
-
I have a database, and I was wondering how do I backup using a php script? I dont just want it to be a table, but the whole db. So if they want to re-add something then they can look in the backup and enter the SQL in a php script.
-
Unsure how to get form input for redirection
unidox replied to jim.davidson's topic in PHP Coding Help
Use css have background-image: url(); -
I normally have the html/css design on index.php and use: if ($_GET['page']) { include($_GET['page']); } else { echo "This is the main page"; } But I have seen some sites use index.php and then like about.php. I was wondering do they have the design on each of the pages or are they using post or something. Thanks
-
Include the config, and then use define()
-
I have: $_SERVER["HTTP_REFERER"] and $lic, and what I am trying to do is do a search like, search for www. in $_SERVER["HTTP_REFERER"]. How would I do that?
-
I did that and echo fopen does Resource id #3. Whats wrong
-
I have a script on Server 1, and another script on Server 2. What I want is to have lic.php on server 1 and use get to check to see if the license is valid. Like: $lic = $_GET['lic']; $url = $_SERVER["HTTP_REFERER"]; $q = mysql_query("SELECT * FROM `db` WHERE lic = '$lic'"); if (mysql_num_rows($q) == 1) { echo "1"; //lic is valid } else { echo "0"; //lic is invalid } I was just wondering how I would have server 2 use get to activate the script on server 1. Thanks