Jump to content

IamSuchANoob

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by IamSuchANoob

  1. Thank you for the answer. I have never done this (PDF->XLSX->CSV). Could you tell me, if this output can be used before I am going to figure out how? ;;;;;;;;;;Rehvide valiku tabel;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mark;;Mudel;;;Mootor;;;;;;;Laius Kõrgus ZR;;"R """;;LI;SI;XL e4txc4;;;;;;;;;;;;;;;;;;;;;;;;
  2. Hello! So, I have a .pdf file which contains information on car tyre parameters (which tyre fits where). The mission is to have that data to show up on a website for the user to be able to search/view it. There is around 30 000 entries and before I go and start copying them one by one into my HTML tables or database I would like to know if you guys got any ideas if I can somehow fasten that process (or do it in another way?). Even better, if you know any kind of API or something that I can just add to website ( example : http://www.michelin.co.uk/ ) that would be great. I don't want to iframe-lame it. Thank you & have an awesome day!
  3. Was probably mailserver... works like a charm on another host. Close please.
  4. I got this piece of code from a free template and I followed all the instructions that came with it, everything seems fine but mail doesn't go trough. HTML: <!--Start Contact form --> <form name="enq" method="post" action="email/" onsubmit="return validation();"> <fieldset> <input type="text" name="name" id="name" value="" class="input-block-level" placeholder="Name.." /> <input type="text" name="email" id="email" value="" class="input-block-level" placeholder="Email.." /> <textarea rows="11" name="message" id="message" class="input-block-level" placeholder="Message.."></textarea> <div class="actions"> <input type="submit" value="Send!" name="submit" id="submitButton" class="btn btn-info pull-right" title="Send!" /> </div> </fieldset> </form> <!--End Contact form --> PHP: <?php if(isset($_POST['submit'])) { $name = $_POST['name']; $email = $_POST['email']; $query = $_POST['message']; $email_from = $name.'<'.$email.'>'; $to="email@sample.com"; $subject="Enquiry!"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: ".$email_from."\r\n"; $message=" Name: $name <br> Email-Id: $email <br> Message: $query "; if(mail($to,$subject,$message,$headers)) header("Location:../contact.php?msg=Successful Submission! Thankyou for contacting us."); else header("Location:../contact.php?msg=Error To send Email !"); //contact:-your-email@your-domain.com } ?> JavaScript function validation() { var contactname=document.enq.name.value; var name_exp=/^[A-Za-z\s]+$/; if(contactname=='') { alert("Name Field Should Not Be Empty!"); document.enq.name.focus(); return false; } else if(!contactname.match(name_exp)) { alert("Invalid Name field!"); document.enq.name.focus(); return false; } var email=document.enq.email.value; //var email_exp=/^[A-Za-z0-9\.-_\$]+@[A-Za-z]+\.[a-z]{2,4}$/; var email_exp=/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; if(email=='') { alert("Please Enter Email-Id!"); document.enq.email.focus(); return false; } else if(!email.match(email_exp)) { alert("Invalid Email ID !"); document.enq.email.focus(); return false; } var message=document.enq.message.value; if(message=='') { alert("Query Field Should Not Be Empty!"); document.enq.message.focus(); return false; } return true; } I don't get any errors but mail doesn't simply go trough, checked spam etc.
  5. //This page should not be accessed directly. Need to submit the form. echo "error; you need to submit the form!";
  6. Yeah, I try to send the user after sending in the form to the page thx.php (just image). I tried the ob_start(); solution but I don't like workarounds. (for example, with ob_start(); the HTML doesn't show up properly for example in RoundCube client).
  7. Hey! I have a problem, I have a PHP script which sends mail from a html form. Weird is, it works great on another host. error: Warning: Cannot modify header information - headers already sent by (output started at /home/sbsbitum/public_html/process2.php:5) in /home/sbsbitum/public_html/process2.php on line 60 php: <?php if(!isset($_POST['submit'])) { //This page should not be accessed directly. Need to submit the form. echo "error; you need to submit the form!"; } $name = $_POST['cformname']; $email = $_POST['cformemail']; $message = $_POST['cformmessage']; //Validate first if(empty($name)||empty($email)) { echo "Name and email are mandatory!"; exit; } if(IsInjected($email)) { echo "Bad email value!"; exit; } $to = 'info@test.com';// to email address // subject $subject = 'Message from homepage.'; // message $body = ' <html> <head> <title>Viesti</title> </head> <body> <img src=""> <table rules="all" style="border-color: #666;" cellpadding="10"> <tr style="background:" #eee;><td><strong>Nimi:</strong></td><td>'.$name.'</td></tr> <tr><td<strong>Email:</td<strong><td>'.$email.'</td></tr> <tr><td<strong>Viesti:</td<strong><td>'.$message.'</td></tr> </table> </body> </html> '; $headers .='MIME-Version: 1.0' . "\r\n"; $headers .='Content-type: text/html; charset=utf-8' . "\r\n"; // Additional headers $headers .= 'From: sender '.$email.' ' . "\r\n"; // Mail it mail($to, $subject, $body, $headers); //done. redirect to thank-you page. header('Location: lehed/thx.php'); // Function to validate against any email injection attempts function IsInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } function filter($data) { $data = trim(htmlentities(strip_tags($data))); if (get_magic_quotes_gpc()) { $data = stripslashes($data); } return $data; } ?>
  8. I am trying to figure out how to include a picture in the mail I send in PHP, any help is welcome! Code: <?php if(!isset($_POST['submit'])) { //This page should not be accessed directly. Need to submit the form. echo "error; you need to submit the form!"; } $name = $_POST['cformname']; $email = $_POST['cformemail']; $message = $_POST['cformmessage']; //Validate first if(empty($name)||empty($email)) { echo "Name and email are mandatory!"; exit; } if(IsInjected($email)) { echo "Bad email value!"; exit; } $email_from = 'info@test.com'; $email_subject = "Message from homepage!"; $email_body = "New message from user: $name.\n". "name:$name\n". "email:$email\n". "message:$message\n". " '<img src="http://css-tricks.com/examples/WebsiteChangeRequestForm/images/wcrf-header.png" alt="Website Change Request" />';n". $to = "info@test.com";//<== update the email address $headers = "From: $email_from \r\n"; $headers .= "Reply-To: $email \r\n"; //Send the email! mail($to,$email_subject,$email_body,$headers); //done. redirect to thank-you page. header('Location: pages/thankyou.php'); // Function to validate against any email injection attempts function IsInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } function filter($data) { $data = trim(htmlentities(strip_tags($data))); if (get_magic_quotes_gpc()) { $data = stripslashes($data); } return $data; } ?>
  9. The html loads at localhost, structure is same 100%. The page itself loads put no pics or info, just text: Empty
  10. Its a page 'Downloads'. Works great at localhost but doesnt show up @ web hosting. <?php define('IN_PHPBB', true); $page = !isset($_GET["page"]) ? "None" : $_GET['page']; $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); page_header('Downloads'); if(strcmp($page,"org") == 0) { $template->set_filenames(array('body' => 'download/org.html',)); } else if(strcmp($page,"audi") == 0) { $template->set_filenames(array('body' => 'download/audi.html',)); } else if(strcmp($page,"bmw") == 0) { $template->set_filenames(array('body' => 'download/bmw.html',)); } else if(strcmp($page,"vw") == 0) { $template->set_filenames(array('body' => 'download/vw.html',)); } else if(strcmp($page,"nissan") == 0) { $template->set_filenames(array('body' => 'download/nissan.html',)); } else if(strcmp($page,"opel") == 0) { $template->set_filenames(array('body' => 'download/opel.html',)); } else if(strcmp($page,"ford") == 0) { $template->set_filenames(array('body' => 'download/ford.html',)); } else if(strcmp($page,"chevrolet") == 0) { $template->set_filenames(array('body' => 'download/chevrolet.html',)); } else if(strcmp($page,"other") == 0) { $template->set_filenames(array('body' => 'download/other.html',)); } else { $template->set_filenames(array('body' => 'download/org.html',)); } make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); page_footer(); ?> and the html: <table class="tablebg" cellspacing="1" width="100%"> <tr> <th>BMW</th> </tr> <tr class="row1"> <td align="center" style="padding:5px 5px 5px 5px;"> <center> <hr width="60%" size="3" /> <table width="70%"> <tr> <td width="10%"><a href="http://www.upload.ee/image/1626514/325i_2.jpg" target = "_blank"> <img src="http://www.upload.ee/thumb/1626514/325i_2.jpg" border="0"/></a> <a href="http://www.upload.ee/image/1626518/325i_3.jpg"> <img src="http://www.upload.ee/thumb/1626518/325i_3.jpg" border="0"/></a> <td width="0%"><a href="http://www.upload.ee/image/1626519/325i_1.jpg" target = "_blank"> <img src="http://www.upload.ee/thumb/1626519/325i_1.jpg" border="0"/></a> <a href="http://www.upload.ee/image/1626521/325i_4.jpg" target = "_blank"> <img src="http://www.upload.ee/thumb/1626521/325i_4.jpg" border="0"/></a></td></td> <td><b><font color="white">Name:</font></b> 1996 BMW 325i e36 Convertible</br> <b><font color="white">Original Author:</font></b> ikey07</br> <b><font color="white">Size:</font></b> 3.89MB</br></br> <b><font color="white">Description:</font></b></br> Tunable in WAA</br> 2 Body kits included</br> 1. BMW M e36 series + Hood Vents</br> 2. BMW M e46 series + Masked Lights</br> New 2 M series wheels e36/e46</br> Realistic heavy damaged model</br> Model accuracy as real car 96%</br> Openable petrolcap</br> If you replace this car as BF Injection, the front fan is working ( spining )</br></br> <a href="http://ikey07.c-rp.net/viewtopic.php?f=6&t=2"><b><font color="white">Comments</font></b></a></br> </br> <ul id="nav"> <a class="downl" href="http://ikey07.c-rp.net/download/1996_BMW_325i_e36.rar" title="Download"><span>{L_DOWN}</span></a> </div> </br> </td> </tr> </table> <hr width="60%" size="3" /> </center> </td> </tr> </table> <br />
  11. I am sure this is a simple fix and I am total beginner but thanks to these forums learn alot Here is the code: http://$host/forgot.php?doReset=Reset&VeriCode=$new_code And when I click the link in email I get the following error The requested URL /forgot.php?doReset=Reset&VeriCode=60dea138b76c71acccfe34d4fab3e004 was not found on this server. If someone needs the full code to help, please PM me.
  12. How could I implement strcasecmp? function checkPwd($x,$y) { //Checks if strings are empty if(empty($x) || empty($y) ) { //Strings were empty return false; } else if(strlen($x) < 4 || strlen($y) < 4) { //String length too short return false; } else if(strcasecmp($x,$y) != 0) { //Strings do not match return false; } else { //Password Determined valid return true; } } This does not work, if the MD5 is uppercase, it says incorrect PW.
  13. Okay, I didnt explain myself good enough. The password encryption from application is uppercase. I suppose the problem is within application, not the code. Example. md5 Encryption for 'hi' is: 49f68a5c8493ec2c0bf489821c21fc3b and from our application it comes as: 49F68A5C849EC2C0BF489821C21FC3B So there comes the problem, php does not think its the same PW. P.S Sorry for saying it was PW not the encryption itself
  14. awkward. the code simply doesnt recognize the uppercase PWs. I checked in DB, if I convert the PW lowercase, everything is ok.
  15. Problem - application produces MD5 PWs which are uppercase, code checks lowercase. Question- How to use uppercase check? function checkPwd($x,$y) { //Checks if strings are empty if(empty($x) || empty($y) ) { //Strings were empty return false; } else if(strlen($x) < 4 || strlen($y) < 4) { //String length too short return false; } else if(strcmp($x,$y) != 0) { //Strings do not match return false; } else { //Password Determined valid return true; } } Question 2: Do I have to change it anywhere else, like PW generation? function GenPwd($length = 7) { $password = ""; $possible = "0123456789bcdfghjkmnpqrstvwxyz"; //no vowels $i = 0; while ($i < $length) { $char = substr($possible, mt_rand(0, strlen($possible)-1), 1); if (!strstr($password, $char)) { $password .= $char; $i++; } } return $password; } function GenKey($length = 7) { $password = ""; $possible = "0123456789abcdefghijkmnopqrstuvwxyz"; $i = 0; while ($i < $length) { $char = substr($possible, mt_rand(0, strlen($possible)-1), 1); if (!strstr($password, $char)) { $password .= $char; $i++; } } return $password; } Thank you for reading
  16. I have way more tables than that, as this is only users. Every other works fine. Did you try editing or adding values into it? And what version is your mysql?
  17. Mod_Security 2.5.9 enabled MySQL client version: 5.0.51a PHP extension: mysqli CREATE TABLE IF NOT EXISTS `users` ( `user_name` varchar(200) NOT NULL DEFAULT 'None', `pwd` varchar(220) NOT NULL DEFAULT 'None', `Level` int(11) NOT NULL DEFAULT '0', `user_level` tinyint(4) NOT NULL DEFAULT '0', `PlayerDefaultSkin` int(11) NOT NULL DEFAULT '26', `PlayerMoney` int(11) NOT NULL DEFAULT '4500', `Local` int(11) NOT NULL DEFAULT '9999', `Zone` int(11) NOT NULL DEFAULT '9999', `House` int(11) NOT NULL DEFAULT '9999', `Team` int(11) NOT NULL DEFAULT '1', `MoneyInBank` int(11) NOT NULL DEFAULT '0', `HaveBankAccount` int(11) NOT NULL DEFAULT '0', `approved` int(1) NOT NULL DEFAULT '0', `Gender` varchar(50) NOT NULL DEFAULT 'None', `Age` int(11) NOT NULL DEFAULT '0', `Country` varchar(24) NOT NULL DEFAULT 'None', `PhoneBox` int(11) NOT NULL DEFAULT '0', `TraceName` varchar(200) NOT NULL DEFAULT 'None', `Job` int(11) NOT NULL DEFAULT '0', `PostSkill` int(11) NOT NULL DEFAULT '0', `Armour` float NOT NULL DEFAULT '0', `Tickets` int(11) NOT NULL DEFAULT '0', `MaxCars` int(11) NOT NULL DEFAULT '2', `Busniness` int(11) NOT NULL DEFAULT '0', `Government` int(11) NOT NULL DEFAULT '0', `Faction` int(11) NOT NULL DEFAULT '0', `Interior` int(11) NOT NULL DEFAULT '0', `DutySkin` int(11) NOT NULL DEFAULT '0', `Rank` int(11) NOT NULL DEFAULT '0', `RankName` varchar(24) NOT NULL DEFAULT 'None', `PlaneLic` int(11) NOT NULL DEFAULT '0', `WantedPoints` int(11) NOT NULL DEFAULT '0', `WantedLevel` int(11) NOT NULL DEFAULT '0', `Jail` int(11) NOT NULL DEFAULT '0', `JailTime` int(11) NOT NULL DEFAULT '0', `File` varchar(24) NOT NULL DEFAULT 'None', `Arrests` int(11) NOT NULL DEFAULT '0', `LastTicket` varchar(256) NOT NULL DEFAULT 'None', `CrimesCom` int(11) NOT NULL DEFAULT '0', `Kills` int(11) NOT NULL DEFAULT '0', `Hobby` varchar(200) NOT NULL DEFAULT '0', `DefaultSpawn` int(11) NOT NULL DEFAULT '0', `Motel` int(11) NOT NULL DEFAULT '0', `Hotel` int(11) NOT NULL DEFAULT '0', `Number` int(11) NOT NULL DEFAULT '0', `Pocket1` int(11) NOT NULL DEFAULT '0', `Pocket2` int(11) NOT NULL DEFAULT '0', `Pocket3` int(11) NOT NULL DEFAULT '0', `Pocket4` varchar(24) NOT NULL DEFAULT 'None', `Pocket5` int(11) NOT NULL DEFAULT '0', `GunLic` int(11) NOT NULL DEFAULT '0', `Scripter` int(11) NOT NULL DEFAULT '0', `Points` int(11) NOT NULL DEFAULT '0', `PointsNeed` int(11) NOT NULL DEFAULT '8', `PayCheck` int(11) NOT NULL DEFAULT '0', `Salary` int(11) NOT NULL DEFAULT '0', `banned` int(1) NOT NULL DEFAULT '0', `PWSkill` int(11) NOT NULL DEFAULT '0', `SPWSkill` int(11) NOT NULL DEFAULT '0', `DPWSkill` int(11) NOT NULL DEFAULT '0', `SHWSkill` int(11) NOT NULL DEFAULT '0', `MPWSkill` int(11) NOT NULL DEFAULT '0', `AKWSkill` int(11) NOT NULL DEFAULT '0', `M4WSkill` int(11) NOT NULL DEFAULT '0', `SNWSkill` int(11) NOT NULL DEFAULT '0', `Condom` int(11) NOT NULL DEFAULT '0', `FightStyle` int(11) NOT NULL DEFAULT '6', `GunParts` int(11) NOT NULL DEFAULT '0', `Drugs` int(11) NOT NULL DEFAULT '0', `CarLic` int(5) NOT NULL DEFAULT '0', `MoneyAvailable` int(11) NOT NULL DEFAULT '0', `Deposit` int(11) NOT NULL DEFAULT '0', `DepositTime` int(11) NOT NULL DEFAULT '0', `DepositValue` float NOT NULL DEFAULT '0', `Withdraw` int(11) NOT NULL DEFAULT '0', `DepositPassed` int(11) NOT NULL DEFAULT '0', `BikeLic` int(5) NOT NULL DEFAULT '0', `HeavyLic` int(5) NOT NULL DEFAULT '0', `BoatLic` int(5) NOT NULL DEFAULT '0', `Company` int(11) NOT NULL DEFAULT '0', `RacesWin` int(11) NOT NULL DEFAULT '0', `Garage` int(11) NOT NULL DEFAULT '0', `AfterMedic` int(11) NOT NULL DEFAULT '0', `Hospital` int(11) NOT NULL DEFAULT '0', `Phone` varchar(24) NOT NULL DEFAULT 'None', `PType` int(11) NOT NULL DEFAULT '0', `PCredit` int(11) NOT NULL DEFAULT '0', `PAfterPay` int(11) NOT NULL DEFAULT '0', `GoodCop` int(11) NOT NULL DEFAULT '0', `BadCop` int(11) NOT NULL DEFAULT '0', `CanRobGas` int(11) NOT NULL DEFAULT '0', `CanRobBank` int(11) NOT NULL DEFAULT '0', `HackSkill` int(11) NOT NULL DEFAULT '0', `Mod` int(5) NOT NULL DEFAULT '0', `CrashX` float NOT NULL DEFAULT '0', `CrashY` float NOT NULL DEFAULT '0', `CrashZ` float NOT NULL DEFAULT '0', `CrashVW` int(11) NOT NULL DEFAULT '0', `CrashInt` int(11) NOT NULL DEFAULT '0', `Duty` int(5) NOT NULL DEFAULT '0', `EnterID` int(11) NOT NULL DEFAULT '9999', `Crashed` int(11) NOT NULL DEFAULT '0', `PlayerSes` int(11) NOT NULL DEFAULT '0', `CrashDis` int(11) NOT NULL DEFAULT '1', `DutyArmour` float NOT NULL DEFAULT '0', `Gold` int(11) NOT NULL DEFAULT '0', `FlighTime` int(11) NOT NULL DEFAULT '0', `GPowder` int(11) NOT NULL DEFAULT '0', `Metal` int(11) NOT NULL DEFAULT '0', `GReady` int(11) NOT NULL DEFAULT '0', `SerVer` int(11) NOT NULL DEFAULT '0', `LastIP` varchar(24) NOT NULL DEFAULT 'None', `Priest` int(11) NOT NULL DEFAULT '0', `Married` varchar(24) NOT NULL DEFAULT 'None', `MarHouse` int(11) NOT NULL DEFAULT '0', `RPSkill` int(11) NOT NULL DEFAULT '0', `Mask` int(11) NOT NULL DEFAULT '0', `PetrolCan` int(11) NOT NULL DEFAULT '0', `Tut` int(11) NOT NULL DEFAULT '0', `TempReg` int(11) NOT NULL DEFAULT '0', `Weed` int(11) NOT NULL DEFAULT '0', `Seeds` int(11) NOT NULL DEFAULT '0', `MarReady` int(11) NOT NULL DEFAULT '0', `MarAmount` int(11) NOT NULL DEFAULT '0', `Paper` int(11) NOT NULL DEFAULT '0', `Lighter` int(11) NOT NULL DEFAULT '0', `Cigar` int(11) NOT NULL DEFAULT '0', `AdminCode` varchar(150) NOT NULL DEFAULT 'None', `Helmet` int(11) NOT NULL DEFAULT '0', `PlayerHealth` float NOT NULL DEFAULT '100', `TimeInJob` int(11) NOT NULL DEFAULT '0', `TmpFaction` int(11) NOT NULL DEFAULT '0', `Resign` int(11) NOT NULL DEFAULT '0', `Helper` int(11) NOT NULL DEFAULT '0', `SkinProLap` int(11) NOT NULL DEFAULT '0', `SkinVictim` int(11) NOT NULL DEFAULT '0', `SkinSub` int(11) NOT NULL DEFAULT '0', `SkinZip` int(11) NOT NULL DEFAULT '0', `SkinBin` int(11) NOT NULL DEFAULT '0', `SkinDid` int(11) NOT NULL DEFAULT '0', `LastLogin` varchar(24) NOT NULL DEFAULT 'None', `Bag` int(11) NOT NULL DEFAULT '0', `Rope` int(11) NOT NULL DEFAULT '0', `Pizza` int(11) NOT NULL DEFAULT '0', `Icecream` int(11) NOT NULL DEFAULT '0', `Hotdog` int(11) NOT NULL DEFAULT '0', `Sprunk` int(11) NOT NULL DEFAULT '0', `Apples` int(11) NOT NULL DEFAULT '0', `Berries` int(11) NOT NULL DEFAULT '0', `OPrison` varchar(128) NOT NULL DEFAULT '0', `id` int(11) NOT NULL AUTO_INCREMENT, `RingName` varchar(32) NOT NULL DEFAULT 'None', `RangeIP` varchar(64) NOT NULL DEFAULT 'None', `md5_id` varchar(200) NOT NULL DEFAULT 'None', `user_email` varchar(200) NOT NULL DEFAULT 'None', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1841 ; Simply after creating it, trying to view structure or entries of the table I get errors in phpmyadmin. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
  18. Fixed. <img src="skins/<?php echo $row_settings ['PlayerDefaultSkin']; ?>.png">
  19. http://hello.net/UCPbeta/skins/.png
  20. Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/crpnet/domains/c-rp.net/public_html/UCPbeta/myaccount.php on line 53 Here is how the query looks right now: mysql_query("UPDATE users SET `Hobby` = '$data[Hobby]', `Phone` = '$data[Phone]', `Gender` = '$data[Gender]', `Level` = '$data[Level]', `AdminLevel` = '$data[user_level]', `Job` = '$data[Job]', `Country` = '$data[Country]', `MoneyInBank` = '$data[MoneyInBank]', `Age` = '$data[Age]', `PlayerMoney` = '$data[PlayerMoney]', $PlayerDefaultSkin = $data['PlayerDefaultSkin']; WHERE id='$_SESSION[user_id]' ") or die(mysql_error()); I think query works, it does output 240 as neccesary, problem is somewhere in here <img src="skins/<?php echo $PlayerDefaultSkin; ?>.png"> but then again, what do I know?
  21. Hi. idea: View image from /skins/ folder. The id for the image is taken from mysql DB field called PlayerDefaultSkin So, lets say a user has 240 in the field in database and in /skins/ folder I have image called 240.png What I want is to php read from PlayerDefaultSkin field and view the image from /skins/ Right now I have this: query to update: `PlayerDefaultSkin` = $data[PlayerDefaultSkin]' and the output code <img src="skins/<?php echo '$PlayerDefaultSkin' ?>.png"> which simply doesnt work and is probably very wrong. So can anyone help me with this?
  22. Hi all! I am very new to php and mysql world so I could need some help. I found this UCP php code to control a database, where we could find various userinfo. I edited it and for unknown reasons everything else works except the change password. Here is the NewPassword.php: <html> <body> <form action="Newpass.php" method="post"> <b><font size="4" color="#000080">Change your password! </font></b> <p>Old password <input type="password" name="P1" size="20" /> </p> <p>New Password <input type="password" name="P2" size="20" /></p> <p>Confirm New Password <input type="password" name="P3" size="20" /></p> <p> <input type="submit" /> <input type="reset" /> </p> <a href="Logged.php"">Go back</a> </form> </body> </html> And here is the Newpass.php <?php session_start(); $pass1 = $_POST["P1"]; $pass2 = $_POST["P2"]; $pass3 = $_POST["P3"]; $escpass1 = mysql_real_escape_string($pass3); $escpass2 = mysql_real_escape_string($pass3); $escpass3 = mysql_real_escape_string($pass3); $user = $_SESSION['Username']; if(!isset($_SESSION['Username'])) { echo('You are not logged in!'); echo '<a href="index.php"">Go back</a>'; die; } $escuser = mysql_real_escape_string($user); include("database.php"); $query = "SELECT * FROM playerinfo WHERE user = '$escuser'"; $result = mysql_query($query); $row = mysql_fetch_row($result); if (!$con) { die('Could not connect: ' . mysql_error()); } $username_exist = mysql_num_rows($result); if($username_exist == 0) { echo('That username does not exist'); echo '<a href="NewPassword.php"">Go back</a>'; die; } if($escpass1 !== $row[1]) { echo("Wrong old password!"); echo '<a href="New Password.php"">Go back</a>'; die; } if($escpass2 !== $escpass3) { echo("Your new passwords do not match!"); echo '<a href="NewPassword.php"">Go back</a>'; die; } $query = "UPDATE playerinfo SET password = '$escpass3' WHERE user= '$escuser'"; $result = mysql_query($query); echo 'Password Changed!'; $_SESSION['Password'] = $escpass3; echo '<a href="Logged.php"">Go back</a>'; ?> And database.php <?php $con = mysql_connect("edit","edit","edit"); mysql_select_db("edit"); //Remember that if you are using a external source, change the login info (mysql_connect(server[],user[],pass[]); ?> I edited the user/pw for obvious reasons. So the problem itself: Whatever I insert in password box I get this in return: Warning: mysql_real_escape_string(): Access denied for user ''@'localhost' (using password: NO) in /home/crpnet/domains/c-rp.net/public_html/blankUCP/Newpass.php on line 6 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/crpnet/domains/c-rp.net/public_html/blankUCP/Newpass.php on line 6 Warning: mysql_real_escape_string(): Access denied for user 'crpnet'@'localhost' (using password: NO) in /home/crpnet/domains/c-rp.net/public_html/blankUCP/Newpass.php on line 7 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/crpnet/domains/c-rp.net/public_html/blankUCP/Newpass.php on line 7 Warning: mysql_real_escape_string(): Access denied for user 'crpnet'@'localhost' (using password: NO) in /home/crpnet/domains/c-rp.net/public_html/blankUCP/Newpass.php on line 8 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/crpnet/domains/c-rp.net/public_html/blankUCP/Newpass.php on line 8 Warning: mysql_real_escape_string(): Access denied for user 'crpnet'@'localhost' (using password: NO) in /home/crpnet/domains/c-rp.net/public_html/blankUCP/Newpass.php on line 16 Warning: mysql_real_escape_string(): A link to the server could not be established in /home/crpnet/domains/c-rp.net/public_html/blankUCP/Newpass.php on line 16 That username does not existGo back
×
×
  • 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.