PHP - Code Not Showing Anything
hello team,
can you please look at this code snippet and tell me why it is showing the following data this way? <?php # jeff Exp $ include("app.php"); $page->set("title", "Business & Commerical"); $what = $page->getvar("what"); $type = $page->getvar("type"); $dt = new xDataTable('width="500"'); $form = new Form(); if($what == "submit") $html->set("readonly", true); $dt->header($_types{$type} . " Quote"); $form->get_contact_form(true); When I run it, it shows like this: set("title", "Business & Commerical"); $what = $page->getvar("what"); $type = $page->getvar("type"); $dt = new xDataTable('width="500"'); $form = new Form(); if($what == "submit") $html->set("readonly", true); $dt->header($_types{$type} . " Quote"); $form->get_contact_form(true); switch ($type) { case "comp": $dt->left("Business Type:"); $dt->cell($html->select("business_type", $_business_type, 1, "", $page->getvar("business_type"), "(select)")); $dt->left("Federal Tax ID:"); $dt->cell($html->textfield("tax_id", $page->getvar("tax_id"), 12)); $dt->left("If Individual, Owner SSN#:"); $dt->cell($html->textfield("ssn", $page->getvar("ssn"), 12)); $dt->cell("Spouse SSN#:"); $dt->cell($html->textfield("spouse_ssn", $page->getvar("spouse_ssn"), 12)); just a small sample. What am I doing wrong? Thanks alot in advance Similar TutorialsThis is the script i am using i two areas , but the goal is not the same :( Code: <div class='allDeal'> <div class='date'><?php echo app()->locale->dateFormatter->formatDateTime( utime($data->start,false),'medium',false); ?></div> <div class='content'> <div class='name'><?php echo CHtml::link($data->name,url('/deal/view',array('url'=>$data->url))); ?></div> <div class='clearfix prepend-top'> <div class='column data'> <div class='stats txt-center'> <span class='num'><?php echo $data->stats && $data->stats->bought?$data->stats->bought:'0'; ?></span><br /> <?php echo $this->t('Coupons Bought'); ?> </div> <div class='info prepend-top'> <div class='row price'> <label><?php echo $this->t('Price').':'; ?></label> <?php echo m('payment')->format($data->price); ?> </div> <div class='row'> <label><?php echo $this->t('Value').':'; ?></label> <?php echo m('payment')->format($data->value); ?> </div> <div class='row'> <label><?php echo $this->t('Savings').':'; ?></label> <?php echo m('payment')->format($data->value-$data->price); ?> </div> </div> </div> <div class='column last image'><?php if($data->imageBin) echo CHtml::link( CHtml::image(app()->storage->bin($data->imageBin)->getFileUrl('original')), url('/deal/view',array('url'=>$data->url)) ); ?></div> </div> </div> </div><?php if($index && ($index+1)%2==0) { ?><div class='clearfix'></div><?php } Only change: div class='allDeal' to div class='recentDeal' This is the good: http://kupon.woano.lv/deal/recent and the same code in other place looks ugly :( http://kupon.woano.lv/deal/all What i am doing wrong This is the code that I am using to make a page that is kind of like an administration area for a CMS system. When the page is loading all I get is a blank page. When I remove all of the back code before the HTML code is sent. The page shows up fine. I have looked over and over the code trying to see if I missed a colon or something and I see nothing. I hope that this explains everything well enough and I would appreciate any help. Code: [Select] <?php $today = date("l, F j, Y"); $host =''; $username = ''; $dbname =''; $dbpassword = ''; $table = ''; $table2 = ''; $connection = mysql_connect($host, $username, $dbpassword) or die (mysql_error()); $db = mysql_select_db ($dbname, $connection) or die (mysql_error()); $sql = "SELECT * FROM $table WHERE username = '$_POST[username]' AND password = password('$_POST[password]')"; $result = mysql_query($sql, $connection) or die(mysql_error()); $num = mysql_num_rows($result); while ($row = mysql_fetch_array($result)) { $f_name = $row['f_name']; $l_name = $row['l_name']; $username = $row['username']; } if ($num != 0) { $_SESSION[auth] = "yes"; $msg = "Welcome $f_name "; } //else { //header("Location: index.php"); //exit; //} $get_count = "SELECT count(id) FROM $table2"; $get_count_res = mysql_query($get_count, $connection) or die (mysql_error()); $count = mysql_result($get_count_res, 0, "count(id)") or die (mysql_error()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="css/reset.css" media="screen" /> <link rel="stylesheet" type="text/css" href="css/admin.css" media="screen" /> <title>Administration Area</title> </head> <body> <div id="wrapper"> <?php include('includes/header.php'); ?> <div id="content"> <div class="message"><?php echo "$msg"; ?> <a href="logout.php">Logout</a><span style="float:right; "><?php echo "$today"; ?></span></div> <div class="admin"> <span class="top">Administration</span> <ul> <li><A href="show_add.php">Add a Ad</A></li> <li><a href="pick_modify.php">Modify a Add</a></li> <li>Delete Ad</li> <li><a href="user/index.php">Add a User</a></li> <li><a href="user/pick_user.php">Delete a User</a></li> <li><a href="#">View Database Records</a></li> <li><a href="php_info.php">PHP info</a></li> <li><a href="make_backup.php">Backup Database</a> </li> <li><a href="https://p3nlmysqladm001.secureserver.net/nl50/529/index.php?lang=en-utf-8&token=db052d2ddafce3f6ba841cfe0a6c224a">View Database</a> </li> </ul> </div> <div class="misc"><span class="top">miscellaneous</span>Classified Ads online <?php echo "$count"; ?></div> </div> <!--End #content--> <?php include('includes/footer.php'); ?> </div> <!-- End #wrapper --> </body> </html> Hi, I am hoping I have posted my current problem in the right part of this forum. As it relates to the php code, I presume this is the right place, although it also relates to a mysql database I have too. Ok, here is my problem.... I have two websites, one is a non members site and one is a paid members area site. I had a directory style script made for the non members site and want to use the same script within the members site. I paid for the script to be made and set up, which cost me quite a bit, hence the reason I am copying it all over to my other site too. The script displays thumbnials from the database, 4 across and 3 down (total of 12 thumbs per page), each linking to a URL and each thumb has a title. On the left of the webpage is categories, which when clicked, shows thumbs relating to that specific category, or all etc. The CMS forms allow us to add categories etc. Ok, now my problem is this.. I backed up the original database and created a new database on the members site where I also want this functionality. I copied all the scripts over then chenged the content of the database. On the members site I only want it to display three categories, All, Photos and Videos. So this is quite simple compared to the first site. All seemed to display fine, until I moved all the scripts into the members folder (which is accessed via ccbill). The page displays ok, but it just states "No updates found" as in, no content in the database is found. The base url in the configuration script is set to the top domain, but I have renamed the folders where the thumbs are saved to members/thumbs, but still it isnt working. I also want to change the folder name from its original name of www.domain.com/sites to the new domain.com/updates but nothing works when I try to change it. If anyone can help me out with this, I would be extremely grateful, as the workings of this script are all there, and it seems pointless having to spend hundreds on a new script to be made when the functionality is already there, but just not working right. Thanks so much! This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=330251.0 http://www.compareandchoose.com.au/video_games?shopingfor=US&shopingfor=US http://www.compareandchoose.com.au/video_games?shopingfor=AU&shopingfor=US http://www.compareandchoose.com.au/video_games?shopingfor=UK&shopingfor=US http://www.compareandchoose.com.au/video_games?shopingfor=US&shopingfor=UK http://www.compareandchoose.com.au/video_games?shopingfor=AU&shopingfor=UK http://www.compareandchoose.com.au/video_games?shopingfor=UK&shopingfor=UK http://www.compareandchoose.com.au/video_games?shopingfor=US&shopingfor=AU http://www.compareandchoose.com.au/video_games?shopingfor=AU&shopingfor=AU http://www.compareandchoose.com.au/video_games?shopingfor=UK&shopingfor=AU when it should only show http://www.compareandchoose.com.au/video_games?shopingfor=US http://www.compareandchoose.com.au/video_games?shopingfor=AU http://www.compareandchoose.com.au/video_games?shopingfor=UK why its appending all combinations I am not sure Please find my 3 page code files it usesHi Professionals I have been doing a site check with MOZ tools and it is showing duplicate page content for all my shopping pages Basically I have a site where you can compare products for either the UK,US or AU But it is showing the above results in MOZ I have tried everything to figure this out, but because it was not written by me I cannot pin point it Please find attached the 3 pages it utilises Attached Files check_form.php 433bytes 5 downloads shopping_video_games.php 3.17KB 6 downloads video_games.php 3.2KB 5 downloads I am pretty new to PHP and am trying to create a simple (so I assumed) page to takes data from one html page(works fine) and updates a MYSQL Database. I am getting no error message, but the connect string down to the end of the body section is showing up as plain text in my browser window. I do not know how to correct this. I have tried using two different types of connect strings and have verified my names from the HTML page are the same as listed within the php page. Suggestions on what I need to look for to correct would be great. I have looked online, but so far all I am getting is how to connect, or how to create a comment, so I thought I would try here. Thank you for any assistance I may get!! - Amy - Code: [Select] <body><font color="006600"> <div style="background-color:#f9f9dd;"> <fieldset> <h1>Asset Entry Results</h1> <?php // create short variable names $tag=$_POST['tag']; $serial=$_POST['serial']; $category=$_POST['category']; $status=$_POST['status']; $branch=$_POST['branch']; $comments=$_POST['comments']; if (!$tag || !$serial || !$category || !$status || !$branch) { echo "You have not entered all the required details.<br />" ."Please go back and try again."; exit; } if (!get_magic_quotes_gpc()) { $tag = addslashes($tag); $serial = addslashes($serial); $category = addslashes($category); $status = addslashes($status); $branch = addslashes($branch); $comments = addslashes($comments); } //@ $db = new mysqli('localhost', 'id', 'pw', 'inventory'); $db = DBI->connect("dbi:mysql:inventory:localhost","id","pw") or die("couldnt connect to database"); $query = "insert into assets values ('".$serial."', '".$tag."', '".$branch."', '".$status."', '".$category."', '".$comments."')"; $result = $db->query($query); if ($result) { echo $db->affected_rows." asset inserted into Inventory."; } else { echo "An error has occurred. The item was not added."; } $db->close(); ?> </fieldset> </div> </body> This happens from time to time and it really drives me crazy. I cannot get the problem to reproduce, although I have plenty of evidence that it is happening. I have a php page that pulls in some database from mssql formats it in a nice table then send via email to a 3rd party. All of that works great. What happens is in some of the emails the first column will show the table cell information for the next column. See example: Code: [Select] Mascaw Mar. 8, 2012 - 6:15 pm Ronnie Johnson Newtown Pike<td width="150"> Mar. 8, 2012 - 6:15 pm Todd Doe Hall of Justice Mar. 8, 2012 - 6:15 pm Carol French I had this problem before with another emailing system and found that wrapping the email to 900 before sending it out fixed it. I wrapped this with $message = wordwrap($message, 900, "\n", true);() but it doesn't seem to make a difference. Anyone ran into this before? Any help would be greatly appreciated! Thanks I decided to redo the individual roster page I have on my site and came up with this. <?php if(isset($_GET['username']) && $_GET['username'] != '') { $username = $_GET['username']; $query = "SELECT bio.username AS username, bio.charactername AS charactername, bio.id AS id, bio.style_id AS style FROM `efed_bio` AS bio ON bio.id = ebw.bio_id WHERE bio.username = '$username'"; if(!$result = mysql_query($query)) while ($row = mysql_fetch_assoc($result)) { $fieldarray=array('id','username','charactername','style'); foreach ($fieldarray as $fieldlabel) { if (isset($row[$fieldlabel])) { $$fieldlabel=$row[$fieldlabel]; $$fieldlabel=cleanquerydata($$fieldlabel); } } } } ?> <h1><?php echo $charactername; ?>'s Biography</h1> <?php echo getBioMenu($style,$username); ?> <? //If the GET page variable is biography, display the biography page if ($page == 'biography') { echo getBiopgrahy($style,$id); } //Or if the GET page variable is gallery, display the gallery page elseif ($page == 'gallery') { echo getGallery($style,$id); } //If the GET page variable is news, display the news page elseif ($page == 'news') { echo getNews($$id); } //If the GET page variable is segments, display the segments page elseif ($page == 'segments') { echo getBioSegments($id,S); } //If the GET page variable is matches, display the matches page elseif ($page == 'matches') { echo getBioSegments($id,M); } elseif ($page == 'chronology') { echo getChronology($id); } //Otherwise display the bio else { echo getBio($style,$id); } ?> The list of characters are listed he http://kansasoutlawwrestling.com/roster An example of someone's individual roster page is located he http://kansasoutlawwrestling.com/bio?username=oriel Hi: Can someone tell me why the code below is not displaying any data. It's suppose to write the calendar dates and event info, but nothing is showing up. No errors, either .. ?? Code: [Select] <td width="50" <?=hiLightEvt($month,$i,$year);?>> <?php if(isset($_GET['full'])){ $result = mysql_query($sql); $row = mysql_fetch_assoc($result); echo $row['calName']; }else{ $sql="select calID, calDate, calName, calDesc from calTbl where calDate = '" . $month . '/' . $day . '/' . $year . "'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo $row['calName']; ?> <a href="<?=$_SERVER['PHP_SELF'] . '?month='. $month . '&day=' . $i . '&year=' . $year;?>&v=1"><?=$row['calDate'];?></a> <?php } } ?> </td> Help, please .... i have the following code: <?php session_start(); include "connect.php"; $queryFinished = mysql_query("SELECT * FROM `finished` ORDER BY auctionID DESC LIMIT 10;") or die(mysql_error()); $queryAdmin = mysql_query("SELECT maxClosed FROM `admin`;") or die(mysql_error()); //echo $queryAuctionID." = Auction ID<br />"; $username = mysql_fetch_assoc($queryFinished); $queryShip = mysql_query("SELECT * FROM ships WHERE typeName='$username[itemName]';") or die(mysql_error()); $getShip = mysql_fetch_assoc($queryShip); $shipID = $getShip[typeID]; echo "<img src='http://image.eveonline.com/Character/".$username[charid]."_32.jpg'> <span class='eveyellow'>".$username[username]."</span> has won a <img src='/images/types/shiptypes_png/32_32/".$shipID.".png'/> ".$username[itemName]." with ticket number #".$username[ticketNumber]."<br />"; ?> it basically lists the most recent auctions that have won, but even though i set the query to LIMIT by 10 it still only shows the 1? is something above sticking out to anyone? i know it looks messy but im still learning. hi all I have a table which i have got results from a database. My question If i want to display the details of a particular row. How do I do that? Thanks Rgds I am working on building a code that will check the results returned from and xml pull to see if they match the database and print back pass or fail on the screen, it works for the first result but then fails to display anything else. any help on where I went wrong would be helpful. Code: [Select] <?php function pass($name, $level) { $sql1 = "SELECT * FROM `reqskills` WHERE `level` > 0 and `name` = '$name'"; $result1 = mysql_query($sql1); while($row1 = mysql_fetch_array($result1)) { if($level >= $row1['level']) { echo "Pass"; } Else { echo "Fail"; } } } $API = "address removed"; $xml = simplexml_load_file($API); $sql = "SELECT * FROM `reqskills` WHERE `level` > 0"; $result = mysql_query($sql); echo "<table width=100%"; echo "<tr><td>Skill</td><td>Level</td><td>Pass</td></tr>"; while($row = mysql_fetch_array($result)) { ?> <tr> <td><?php echo $row['name'] ?></td> <td><?php echo $row['level'] ?></td> <td><?php foreach ($xml->result->rowset[0] as $value) { $typeID = $value['typeID']; $sql = "select * from `invTypes` WHERE `typeID` = $typeID"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { echo pass($row['typeName'],$value['level']); }} echo "</td></tr>"; } echo"</table>"; ?> Hi guys
I am using the code below to show distinct months using one query then for each month I am trying to show a list of fixtures for the month, the problem I have is only one month is showing.
where am i going wrong?
<?php //find distinct months $sql="SELECT DISTINCT MONTH( match_date ) AS MONTH FROM tbl_fixtures WHERE season_id =$current_season UNION SELECT DISTINCT MONTH( match_date ) AS MONTH FROM tbl_gp WHERE season_id =$current_season"; $result=mysqli_query($dbConn, $sql); if(mysqli_num_rows($result)>0){ while($row=mysqli_fetch_assoc($result)){ $month=$row['MONTH']; echo '<div class="fixtureMonth"> <h2>'.$months[$month].'</h2> </div> <div class="fixtures">'; //find fixtures for month $sql="SELECT Opposition, match_date, competition, tbl_clubs.club_name AS club, image, HomeAway, team, opposition_points, points FROM tbl_fixtures INNER JOIN tbl_clubs ON tbl_fixtures.club = tbl_clubs.club_id WHERE season_id =$current_season and MONTH(match_date)=$month UNION SELECT Opposition, match_date, \"SGP\" AS competition, \"SGP\" AS club, \"sgp.png\" AS image, \"\" as HomeAway, \"\" as team, \"\" as opposition_points, points FROM tbl_gp WHERE season_id =$current_season and MONTH(match_date)=$month ORDER BY match_date"; $result=mysqli_query($dbConn,$sql)or die(mysqli_error($dbConn)); if(mysqli_num_rows($result)==0){ echo no_fixtures_found; } else{ echo '<table class="fixturesTable">'; while($row=mysqli_fetch_assoc($result)){ echo'<tr> <td>'.date("d-M-Y",strtotime($row['match_date'])).'</td> <td><img src="'.$shopConfig['url'].'images/'.$row['image'].'"/></td> <td>'.$row['Opposition'].'</td> <td>'.$row['HomeAway'].'</td> <td><b>'.$row['team'].'</b>-'.$row['opposition_points'].'</td> <td>'.$row['team'].'</td> </tr>'; } echo '</table>'; } echo '</div>'; } } ?> Hey all, Been coding another script for my website which allows me to update a users Rank, allthough, when I try and view the page its giving me a White Blank Page. I carn't accually see whats wrong in my Script... <?php session_start(); include ("../includes/config.php"); include ("../includes/function.php"); logincheck(); ini_set ('display_errors', 1); error_reporting (E_ALL); $username = $_SESSION['username']; // Owner Script - Change Users Rank $userlevel = mysql_query ("SELECT * FROM users WHERE username = '$username' LIMIT 1") or die ("Error Finding Right Users " . mysql_error()); $levelright = mysql_fetch_object($userlevel); // If userlevel isn't 5, move them on... if ($levelright->userlevel == "1" || $levelright->userlevel == "2" || $levelright->userlevel == "3" || $levelright->userlevel == "4"){ header ("Location: 404.php"); die(); } // Start Change Rank... if (strip_tags($_POST['changerank'])){ $name = $_POST['name']; $userchange = $_POST['userchange']; $real = mysql_query ("SELECT * FROM users WHERE username = '$userchange' LIMIT 1"); $number = mysql_num_rows($real); if ($number != "1"){ echo ("$userchange, is NOT registered! - Simple Words : No Such User!"); } if ($name == 1){ $reprand = rand(100, 50000); mysql_query ("UPDATE users SET rank = 'Learner Driver (1)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 1 if ($name == 2){ $reprand = rand(50000, 200000); mysql_query ("UPDATE users SET rank = 'Passed Driver (2)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 2 if ($name == 3){ $reprand = rand(200000, 500000); mysql_query ("UPDATE users SET rank = 'New Driver (3)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 3 if ($name == 4){ $reprand = rand(500000, 2500000); mysql_query ("UPDATE users SET rank = 'Speeding Driver (4)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 4 if ($name == 5){ $reprand = rand(2500000, 7000000); mysql_query ("UPDATE users SET rank = 'Skilled Driver (5)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 5 if ($name == 6){ $reprand = rand(7000000, 20000000); mysql_query ("UPDATE users SET rank = 'Maniac Driver (6)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 6 if ($name == 7){ $reprand = rand(20000000, 45000000); mysql_query ("UPDATE users SET rank = 'Wanted Racer (7)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 7 if ($name == 8){ $reprand = rand(45000000, 90000000); mysql_query ("UPDATE users SET rank = 'Pro Driver (8)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 8 if ($name == 9){ $reprand = rand(90000000, 115000000); mysql_query ("UPDATE users SET rank = 'Supreme Racer (9)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 9 if ($name == 10){ $reprand = rand(115000000, 150000000); mysql_query ("UPDATE users SET rank = 'Super Supreme Racer (10)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 10 if ($name == 11){ $reprand = rand(150000000, 210000000); mysql_query ("UPDATE users SET rank = 'Show Off Driver (11)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 11 if ($name == 12){ $reprand = rand(210000000, 280000000); mysql_query ("UPDATE users SET rank = 'Extreme Show Off Driver (12)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 12 if ($name == 13){ $reprand = rand(280000000, 350000000); mysql_query ("UPDATE users SET rank = 'Trained Driver (13)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 13 if ($name == 14){ $reprand = rand(350000000, 430000000); mysql_query ("UPDATE users SET rank = 'Super Trained Driver (14)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 13 if ($name == 15){ $reprand = rand(430000000, 520000000); mysql_query ("UPDATE users SET rank = 'Legendry Racer (15)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 15 if ($name == 16){ $reprand = rand(520000000, 600000000); mysql_query ("UPDATE users SET rank = 'Most Legendry Racer (16)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 16 if ($name == 17){ $reprand = rand(600000000, 1000000000); mysql_query ("UPDATE users SET rank = 'Official SD Legend (17)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 17 if ($name == 18){ $reprand = rand(1000000000, 1000000010); mysql_query ("UPDATE users SET rank = 'Hidden Rank! (18)' AND rep = '$reprand' WHERE username = '$userchange'") or die ("Error Updating rank " . mysql_error()); } // Name 18 echo ("Successfully updated $userchange Rank!"); mysql_query("INSERT INTO `inbox` ( `id` , `to` , `from` , `message` , `date` , `read` , `saved` , `event_id` ) VALUES ( '', '$userchange', 'System', 'Your Rank has now been changed!', '$date', '0', '0', '0')") or die ("Error updating there inbox!" . mysql_error()); } // Rank Change if (strip_tags($_POST['selectname'])){ $writenname = $_POST['nameinput']; $rankinput = $_POST['rankinput']; $repinput = $_POST['repinput']; $findme = mysql_query ("SELECT * FROM users WHERE username = '$writenname' LIMIT 1") or die ("Error Searching Names " . mysql_error()); $found = mysql_num_rows($findme); if ($found != "1"){ echo ("$writenname, isn't Registered! - Simple Terms : No Such User"); }else{ mysql_query ("UPDATE users SET rank = '$rankinput' AND rep = '$repinput' WHERE username= '$writenname'") or die ("Error Updating Rank + Rep " . mysql_error()); echo ("$writenname Rank has now been changed!"); mysql_query("INSERT INTO `inbox` ( `id` , `to` , `from` , `message` , `date` , `read` , `saved` , `event_id` ) VALUES ( '', '$writenname', 'System', 'Your Rank has now been changed!', '$date', '0', '0', '0')") or die ("Error updating there inbox!" . mysql_error()); } // Found? } // Post selectname ?> <html> <head> <title>Change Users Rank</title> </head> <body class='body'> <form action='' method='POST' name='Change Rank'> <table width='40%' border='1' cellpadding='0' cellspacing='0' class='table' align='center'> <tr> <td class='header' align='center' colspan='2'>Change Users Rank?</td> </tr> <tr> <td class='omg' align='center'>This will change the users Current Rank!</td> </tr> <tr> <td align='right'>Username:</td><td><input type='text' name='userchange' class='input'></td> </tr> <tr> <td><select name='name' size='1' class='dropbox'> <option value="1">Learner Driver (1)</option> <option value="2">Passed Driver (2)</option> <option value="3">New Driver (3)</option> <option value="4">Speeding Driver (4)</option> <option value="5">Skilled Driver (5)</option> <option value="6">Maniac Driver (6)</option> <option value="7">Wanted Racer (7)</option> <option value="8">Pro Driver (8)</option> <option value="9">Supreme Racer (9)</option> <option value="10">Super Supreme Racer (10)</option> <option value="11">Show Off Driver (11)</option> <option value="12">Extreme Show Off Driver (12)</option> <option value="13">Trained Driver (13)</option> <option value="14">Super Trained Driver (14)</option> <option value="15">Legendry Racer (15)</option> <option value="16">Most Legendry Racer (16)</option> <option value="17">Official SD Legend (17)</option> <option value="18">Hidden Rank! (18)</option></td> </tr> <tr> <td class='omg' align='center' colspan='2'><input type='submit' name='changerank' class='button'></td> </tr> </table> <br /> <table width='40%' border='1' cellpadding='0' cellspacing='0' class='table' align='center'> <tr> <td class='header' align='center' colspan='2'>Change Rank?</td> </tr> <tr> <td class='omg' align='center'>This will change the <strong>posted</strong> users Rank and Rep!</td> </tr> <tr> <td align='right'>Username:</td><td><input type='text' name='nameinput' class='input'></td> </tr> <tr> <td align='right'>Rank:</td><td><input type='text' name='rankinput' class='input'></td> </tr> <tr> <td align='right'>Rep:</td><td><input type='text' name='repinput' class='input'></td> </tr> <tr> <td align='center' colspan='2'><input type='submit' name='selectname' class='button'></td> </tr> </table> </form> </body> </html> Anyone able to see where I'm going wrong? Thanks Hi, I just connect to my server through ftp. i want to edit php.ini file. which is placed in /etc/php.ini "etc" folder. but i'm unable to see etc folder. there are only two folders one is cgi-bin and other is www. can anyone help me to find out etc folder. i've check to show hidden files in filezilla. Thanks Hi People. Here is a form that is supposed to read from my database. My primary key is called "index" and I have about 300 records in the database. I wanted to be able to view the records but when I load this page the "php" part is empty. I simply get given a blank form. I know it is connecting to the DB OK because I changed one letter in the password and then got a "can't connect to the database error" just to test it out. Code: [Select] <?php $host = 'localhost'; $usr = "the_db_user"; $password = 'not_shared_on_forum'; $db_name = 'stranded'; function cr($string){ $clean_string = str_replace("rn","<BR>",$string); return $clean_string; } //$id = 11; if (!isset($id)) $id = $_GET['id']; mysql_connect ("$host","$usr","$password") or die ('Error During Connect:<br>'.mysql_error()); mysql_select_db ("$db_name") or die ('Error Selecting DB:<br>'.mysql_error()); $read_query = "select * from HelperFormData where index = '$id'"; $results = mysql_query($read_query); $rs = mysql_fetch_array($results); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body,td,th { font-size: 12px; } --> </style></head> <body> Surname: <? echo $rs["surname"]; ?> <table width="500" border="1" bordercolor = "#2c2cf6" textcolor = "#2c2cf6"cellspacing="1" cellpadding="2"> <tr> <td colspan="5">Record number: <? echo $rs["index"]; ?></td> </tr> <tr> <td width="120" bgcolor = #E6F8EB>Surname</td> <td width="120" bgcolor = #E6F8EB>First Name</td> <td width="120" bgcolor = #E6F8EB>phone1</td> <td width="120" bgcolor = #E6F8EB>phone2</td> <td width="120" bgcolor = #E6F8EB>Location</td> </tr> <tr> <td bgcolor = #E6F8EB textcolor = #AC1636><strong><? echo $rs["surname"]; ?></strong></td> <td bgcolor = #E6F8EB><strong><? echo $rs["firstname"]; ?></strong></td> <td bgcolor = #E6F8EB><strong><? echo $rs["phone1"]; ?></strong></td> <td bgcolor = #E6F8EB><strong><? echo $rs["phone2"]; ?></strong></td> <td bgcolor = #E6F8EB><strong><? echo $rs["location"]; ?></strong></td> </tr> <tr> <td bgcolor = #dbeff8>Qualifications</td> <td bgcolor = #dbeff8>Expertise</td> <td bgcolor = #dbeff8>Assistance</td> <td bgcolor = #dbeff8>Languages</td> <td bgcolor = #dbeff8>E-Mail</td> </tr> <tr> <td bgcolor = #dbeff8><strong><? echo $rs["qualifications"]; ?></strong></td> <td bgcolor = #dbeff8><strong><? echo $rs["expertise"]; ?></strong></td> <td bgcolor = #dbeff8><strong><? echo $rs["assistance"]; ?></strong></td> <td bgcolor = #dbeff8><strong><? echo $rs["languages"]; ?></strong></td> <td bgcolor = #dbeff8><strong><? echo $rs["e_mail"]; ?></strong></td> </tr> <tr> <td bgcolor = #E6F8EB>Consent</td> <td bgcolor = #E6F8EB>Published</td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> </tr> <tr> <td bgcolor = #E6F8EB><strong><? echo $rs["consent"]; ?></strong></td> <td bgcolor = #E6F8EB><strong><? echo $rs["radio_callsign"]; ?></strong></td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> <td bgcolor = #E6F8EB> </td> </tr> <tr> <td colspan="5"><p>Comments:<br /> <strong><? echo $rs["comments"]; ?></strong></td> </tr> </table> </body> </html> </html> Hi Friends, I have form in that i am sending some values using POST method. But i cant able to get values using $_POST['var'] or $_REQEUST['var'] Data is not coming in IE6, But it is coming in firefox and other browsers even in IE8. What may be problem? any settings i have to make for IE6. ? Any suggestions Hi all, I have a simple upload form which is just to upload an image to a folder, this all works fine apart from one bit, once the image has been submitted then a box appears thanking the user for their upload and a close box link, then the original form also appears! I dont want this to appear once I file has been uploaded. I thought my below code would achieve that with an if statement but it is not working: <?php session_start(); $user_id = $_SESSION['user_id']; if (file_exists($user_id.'.'.$extension)) { define ("MAX_SIZE","100"); function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } $errors=0; if(isset($_POST['Submit'])) { $image=$_FILES['image']['name']; if ($image) { $filename = stripslashes($_FILES['image']['name']); $extension = getExtension($filename); $extension = strtolower($extension); if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { echo '<h1>Unknown extension!</h1>'; $errors=1; } else { $size=filesize($_FILES['image']['tmp_name']); if ($size > MAX_SIZE*1024) { echo '<h1>You have exceeded the size limit!</h1>'; $errors=1; } $image_name=$user_id.'.'.$extension; $newname="romimages/".$image_name; $copied = copy($_FILES['image']['tmp_name'], $newname); if (!$copied) { echo '<h1>Copy unsuccessfull!</h1>'; $errors=1; }}}} if(isset($_POST['Submit']) && !$errors) { ?> <link href="../Styles/form_dark.css" rel="stylesheet" type="text/css" /> <form class="dark" action="" method="post" > <ol> <li> <fieldset> <legend>Rom Logo Uploaded!</legend> <p> </p> <ol> <li> <label for="">Your image has been uploaded, you can now close this window</label> </li> </ol> </fieldset> </li> </ol> <br> <input type="submit" value="Close" name="submit" onClick="return parent.parent.GB_hide()" > </p> </form> <?php } } else { ?> <link href="../Styles/form_dark.css" rel="stylesheet" type="text/css" /> <form method="post" enctype="multipart/form-data" action="" class="dark"> <ol> <li> <input type="file" name="image" width="45px"> </li><br> <br> <li> <input name="Submit" type="submit" value="Upload image"> </form> <?php } ?> thanks |