-
Posts
837 -
Joined
-
Last visited
Everything posted by samshel
-
Need to tweak the code! Please help now! php mysql, thanks in advance
samshel replied to atrocious's topic in PHP Coding Help
<?php $con = mysql_connect("host" , "database" , "pw"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("databasename", $con); //when clicked on particular application link, IGN for that record will be passed by GET method to this page. $applicationID = $_GET['ign']; //Code here to show form and text box to adde comments... form should submit to this page itself... // assumption form has a submit button called btnAddSubmit and textbox called txtComments, //add a field called admin_comments in table... // also make sure u pass the ign to the form action URL example...form action should be // thispage.php?ign=<?php echo $_GET['ign'] ?> if(isset($_POST['btnAddSubmit']) && trim($_POST['txtComments']) != "") { $result = mysql_query("UPDATE application SET `admin_comments` = '". mysql_real_escape_string($_POST['txtComments']) ."' WHERE `IGN` = '".$_GET['ign']."'"); } //to see particular application, $result = mysql_query("SELECT * FROM application WHERE `IGN` = '".$ign."'"); echo "<table border='1'> <tr> <th>In Game Name</th> <th>Comments:</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ign'] . "</td>"; echo "<td>" . $row['comment'] . "</td>"; echo "<td>" . $row['admin_comment'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> something like this... BTW i am a guy -
please post if u have already tried some code...
-
works for me if i hard code the variables. means there may be a problem with URL.. please view source ur page in IE and post the the part with a href and img
-
what is the JS error is it showing?
-
this is a JS problem..please post in appropriate forum.
-
u r already generating an alphanumeric key when the user posts the announcement.. you can use the same. in the PHP script u will link with cath-all do the following: sudo code //connect to datbase //Use the TO email field to extract aplhanumeric key...us can use explode() for this.. //fire query to fetch user email address from datbase using this alphanumeric key. //send mail. is this what r u trying to do? if not please excuse me...
-
Try Java script...PHP is server side.. if u already have all the information u need in ur page (Quantity & Cost), u dont need to go to server to calculate something... Use Javascript to do that.
-
[SOLVED] comma screwing up calculations over 1,000
samshel replied to jakebur01's topic in PHP Coding Help
i think it is better option not to write the prices with commas in the first place in the file which u r loading..ofcourse u should have control of that script.. if u want to do it here, u will have to loop through all rows using for loop, format the price properly and use INSERT...so u can no more use LOAD FILE this is again as per my knowledge..there can be better ways. -
[SOLVED] comma screwing up calculations over 1,000
samshel replied to jakebur01's topic in PHP Coding Help
yes u should...simple way ereg_replace("," , "", "1,000"); TIP: never use/store number with thousad seperators in DATABASE or doing operations. Thousand seperators should be used only for displaying... -
[SOLVED] is this kind of an elseif statement ok
samshel replied to maztrin's topic in PHP Coding Help
<?php echo "GET...."; var_dump($_GET); echo "POST...."; var_dump($_POST); this will show u if variables are passed properly to the page or not.. -
[SOLVED] is this kind of an elseif statement ok
samshel replied to maztrin's topic in PHP Coding Help
r u sending topic variable via GET i.e. URL ? -
Need to tweak the code! Please help now! php mysql, thanks in advance
samshel replied to atrocious's topic in PHP Coding Help
prepare a form first...just like u did for inserting asking only for IGN number with field name as ign..submit the form to your page above..and add the following code: <?php $con = mysql_connect("host" , "database" , "pw"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("databasename", $con); $ign = mysql_real_escape_string($_POST['ign']); $result = mysql_query("SELECT * FROM application WHERE `IGN` = '".$ign."'"); echo "<table border='1'> <tr> <th>In Game Name</th> <th>Comments:</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ign'] . "</td>"; echo "<td>" . $row['comment'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> -
mktime(0, 0, 1, date("n"), date("j") , date("Y"));//Start of day 12:01 AM mktime(23, 59, 59, date("n"), date("j") , date("Y"));//Start of day 11:59:59 PM
-
[SOLVED] Include - issue with folder location of include file
samshel replied to jej1216's topic in PHP Coding Help
include("../includes/db.php");//relative path OR include("/var/www/html/www.sitename.com/includes/db.php");//relative path OR -
[SOLVED] Variable Not Assigning in Class Constructor
samshel replied to dimkasmir's topic in PHP Coding Help
sorry ! i am not aware of a work around for this ! but that flag is specially defined to block such thing, so my assumption is it will be difficult to fo a workaround...but may be i am wrong. -
[SOLVED] Variable Not Assigning in Class Constructor
samshel replied to dimkasmir's topic in PHP Coding Help
u want to read a URL? -
[SOLVED] Variable Not Assigning in Class Constructor
samshel replied to dimkasmir's topic in PHP Coding Help
i think u r using PHP4... try this.. class geocoin { var $tracknum; function geocoin($track) { $this->tracknum = $track; } function returnTrackNum() { return $this->tracknum; } -
[SOLVED] Variable Not Assigning in Class Constructor
samshel replied to dimkasmir's topic in PHP Coding Help
class geocoin { var $tracknum; function __construct($track) { $this->tracknum = $track; } function returnTrackNum() { return $this->tracknum; } try this.. -
[SOLVED] Variable Not Assigning in Class Constructor
samshel replied to dimkasmir's topic in PHP Coding Help
class geocoin { private $tracknum; function __construct($track) { $this->tracknum = $track; } function returnTrackNum() { return $this->tracknum; } oops ..forgot the $ sign... -
he means $name is different than $_POST['name']. $name is a variable u have defined, $_POST['name'] is a value which will come after u submit a form.
-
[SOLVED] Variable Not Assigning in Class Constructor
samshel replied to dimkasmir's topic in PHP Coding Help
define tracknum as member variable class geocoin { private tracknum; function __construct($track) { $this->tracknum = $track; } function returnTrackNum() { return $this->tracknum; } -
Need to tweak the code! Please help now! php mysql, thanks in advance
samshel replied to atrocious's topic in PHP Coding Help
it should display only IGN and comment as per ur code.. check in phpmyadmin if the values are stored correctly, may be all data is in one field -
$validSecurityCode = md5($_POST['Spam_Code']) == $_SESSION['key']; echo $validSecurityCode; print security code on submitted page and check if it is correctly displayed.
-
Need to tweak the code! Please help now! php mysql, thanks in advance
samshel replied to atrocious's topic in PHP Coding Help
u need to filter on the username or a key like IGN..but next question would be how do we know which person is seeing the page.. you can put a login functionality in ur system and map the users with the IGN. u should get plenty of help on login in this forum.