Jump to content

grazzman

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Everything posted by grazzman

  1. yea, the nl2br($user['MyBio']) did the trick... Thanks again, I LOVE THIS FORUM.
  2. Yep, MyBio  text  latin1_swedish_ci  NULL and the echo is just echo $user['MyBio'], form is just a textarea form field
  3. So, This should be a simple one. I have a TextArea on a form. When you submit, it goes to a text field in the Mysql. When I echo the data, it looses all its formating... As in, if I have multiple lines it will echo it as one big line unless I put html code in to the textarea. Is their a way to fix this? Thanks
  4. Ok, here is the full line <td align="center" valign="top"><font size='-2'><?php echo $line['RankTitle'] ; ?></font></td> No matter what I set the size= it will not change the size, it stays at 12, the page default.
  5. Ok, I'm still a noob at the hole php stuff i guess. Im doing a normal echo $line['blabla'] ... That part works fine... but It will not take on any font properties other then the page default settings... So, the page font size is 12, all my echo lines are 12... even with <font size='10px'> around it... Can anyone let me in on what im doing wrong or missing.
  6. Is their a way to do this? SELECT * FROM `User` WHERE RankType = 'Active' OR 'Retired' So that it will show any that have either Active or Retired and none of the others?
  7. So, below is the script I'm trying to use to import a CSV data. the clsuser.php contains my mysql connection information an is working on all my other pages, so im sure its not in their. When I run the script the "mysql_query($sql, $mysql_conn);" in the middle is not working. It keeps showing the error message that I put in their and none of the information is added to the database. If anyone can help and can see what little thing is causing this, it would be a big help. Thanks [code] <?php require_once "clsuser.php"; $a=new Auth($mysql_conn); $csvfile="pm.csv"; $csv=file($csvfile); foreach($csv as $csvline){ $csvdat=QuoteExplode($csvline); $userinfo=array(); $userinfo['Username']=$csvdat[0]; $userinfo['Password']=$csvdat[2]; $userinfo['Email']=$csvdat[10]; $userinfo['FirstName']=$csvdat[8]; $userinfo['Location']=$csvdat[11]; $userinfo['SignupTime']=date("Y-m-d H:i:s", strtotime($csvdat[4])); $userinfo['LastLogin']=date("Y-m-d H:i:s", strtotime($csvdat[3])); $userinfo['RegistrationIP']=ip2long($csvdat[5]); $userinfo['LastName']=$csvdat[9]; $userinfo['BirthDay']=$csvdat[12]; $userinfo['BirthMonth']=$csvdat[13]; $userinfo['BirthYear']=$csvdat[14]; $userinfo['Gender']=$csvdat[15]; $userinfo['Xfire']=$csvdat[16]; $userinfo['GameName']=$csvdat[18]; $userinfo['Recruiter']=$csvdat[20]; $userinfo['LastClan']=$csvdat[21]; $userinfo['Connection']=$csvdat[23]; $userinfo['PCType']=$csvdat[24]; $userinfo['Status']=$csvdat[34]; $userinfo['ForumsID']=$csvdat[35]; $userinfo['Rank']=$csvdat[31]; $userinfo['RankType']=$csvdat[32]; $userinfo['RegTeam']=$csvdat[27]; $userinfo['RegTitle']=$csvdat[30]; $userinfo['CICTeam']=$csvdat[38]; $userinfo['CICTitle']=$csvdat[39]; $userinfo['MPTeam']=$csvdat[26]; $userinfo['MPTitle']=$csvdat[29]; $userinfo['SFTeam']=$csvdat[40]; $userinfo['SFTitle']=$csvdat[41]; $userinfo['CTeam']=$csvdat[25]; $userinfo['CTitle']=$csvdat[28]; $userinfo['AUTHSKEY']=$a->sKeyGenerate($userinfo['Username']); $dbtime=date(DBdateformat); //var_dump($userinfo); //continue; $sql="INSERT INTO User SET Username='" . $userinfo['Username'] . "', Password='" . $userinfo['Password'] . "', Email='" . $userinfo['Email'] . "', FirstName='" . $userinfo['FirstName'] . "', Location='" . $userinfo['Location'] . "', EmailVerified=1, AUTHSKEY='" . $userinfo['AUTHSKEY'] . "', SignupTime='" . $userinfo['SignupTime'] . "', LastLogin='" . $userinfo['LastLogin'] . "', LastName='" . $userinfo['LastName'] . "', BirthDay='" . $userinfo['BirthDay'] . "', BirthMonth='" . $userinfo['BirthMonth'] . "', BirthYear='" . $userinfo['BirthYear'] . "', Gender='" . $userinfo['Gender'] . "', Xfire='" . $userinfo['XFire'] . "', GameName='" . $userinfo['GameName'] . "', Recruiter='" . $userinfo['Recruiter'] . "', LastClan='" . $userinfo['LastClan'] . "', Connection='" . $userinfo['Connection'] . "', PCType='" . $userinfo['PCType'] . "', Status='" . $userinfo['Status'] . "', ForumsID='" . $userinfo['ForumsID'] . "', Rank='" . $userinfo['Rank'] . "', RankType='" . $userinfo['RankType'] . "', RegTeam='" . $userinfo['RegTeam'] . "', RegTitle='" . $userinfo['RegTitle'] . "', CICTeam='" . $userinfo['CICTeam'] . "', CICTitle='" . $userinfo['CICTitle'] . "', MPTeam='" . $userinfo['MPTeam'] . "', MPTitle='" . $userinfo['MPTitle'] . "', SFTeam='" . $userinfo['SFTeam'] . "', SFTitle='" . $userinfo['SFTitle'] . "', CTeam='" . $userinfo['CTeam'] . "', CTitle='" . $userinfo['CTitle'] . "', RegistrationIP=" . $userinfo['RegistrationIP'] . ";"; $qres=mysql_query($sql, $mysql_conn); if (!$qres) echo 'Error inserting user with username '.$userinfo['Username'].'<br />'; else echo 'Inserted user with username '.$userinfo['Username'].'<br />'; } function QuoteExplode($str){ $c=0; $ret=array(); $str="," . trim($str); while($c<strlen($str)){ $so=strpos($str, ",", $c); if ($so===false){ $ret[]=substr($str, $c); return $ret; } $qo=strpos($str, "\"", $c); if ($so<$qo && $so!==false){ } if ($qo!==false && $qo<$so+2){ // Next it is a quote mark $eqo=strpos($str, "\"", $qo+1); if ($eqo===false){ $ret[]=substr($str, $qo+1); return $ret; } $ret[]=substr($str, $qo+1, $eqo-$qo-1); $c=$eqo+1; } else{ $eso=strpos($str, ",", $so+1); if ($eso===false){ $ret[]=substr($str, $so+1); return $ret; } $ret[]=substr($str, $so+1, $eso-$so-1); $c=$eso; } } return $ret; } ?> [/code]
  8. So just put include "http://www.serverstats.com/monitor.php?mon=" . $server ; Do I need to have that in ( ) or anything like that? Also, Thanks, I figured it would be something small and stupid... allways is.
  9. Ok, I need to get the following to work. 1  <?php 2  $server = $_GET['server']; 3  include "http://www.serverstats.com/monitor.php?mon=" + $server ; 4  ?> I know that line 2 is working and pulling 'server' from the URL but I can not get it to append it to the end of the URL on line 3. It just tries to find the value of $server as a local file and ignored the "http://" address in line 3. If any one can help merge this so it will include the URL + $server I would be forever greatful. Thanks
  10. Hey guys. I'm trying to make a javascript grap a random word our of a text file. Their is one word per line in a test.txt file and the javascript just needs to grab one at random and throw it in to a Variable. If anyone has any ideas, im at a loss... thanks
  11. So, im guessing that I can not call a PHP function with Javascript either without Ajax?
  12. Ok, forget the form part.... Can I just set a php $variable to a HTML Textbox? Then I will just make a button that will call the function that has the code to set the value...... Does that make sense? It does not need to be a form, or a post, just something like    $phpVariable = document.getElementById('textbox').value; I know that is Javascript, but I need to merge the gap from JavaScript and PHP..... and I dont even know were to start to look
  13. This should be an easy on.  I have a from in HTML that is inside a Print statment. What I need is when they click on SUBMIT for it to call a PHP Function and to take the value of 2 text boxes and make them into $something for php... I need to do this without the page refreshing or reloading... Any thoughts?
  14. Yea, just need to do some fun replace arrays... :)
  15. Hey guys, I'm using parse_str on some text. My only problem is their is a few something= that are the same... Account=test Account=test2 The line in the php is parse_str($test, $output); So, will it make $output['Account'] and then just add a number or something to it for each? I have tried a few different things, and nothing. I'm not sure if that will even do it. If anyone knows please let me know. I have to use the parse_str function cause their is only about 4 that repeat and about 150 that dont.... Thanks
  16. So, I am pulling a webpage and then stripping it into values. Is their anyway to tell CURL to just dump the text? I'm trying to get a results like what lynx -dump will do where all you get is the text. I know I can strip all the html out, but then their is no order on the page.... if that makes sence... If anyone knows of a curl tag that will just grab the text, I would be very very thankful.
  17. Thanks again.... You guys are the best.
  18. well, that worked, a little to well. Their is more then one form on the page, one near the top and one near the bottom. With the /s its removing everything from the first <form> tag to the last </form> tag on the page where I need it to remove each <form> and leave everthing else... if that makes sense..... I hope... <form> NEED this removed </form> NEED this to stay, with the /s this is removed... <form> NEED this removed</form>
  19. Need some help.... All the code below is working fine but the first 2 lines. I am trying to remove everthing between the FORM tags but its not working.... [code] $patterns[0] = '/<form.+form>/'; $replacements[0] = ' '; $patterns[1] = '/<tr.+?>/'; $replacements[1] = '<br>'; $patterns[2] = '/<td.+?>/'; $replacements[2] = ' '; $patterns[3] = '/:/'; $replacements[3] = '='; $test1 = preg_replace($patterns, $replacements, $result); [/code] results is a html page that I'm getting using a CURL. I need the preg_replace to go from form to form then its being replaced with " ".  The other 2 replace lines work great. Thanks guys...
  20. [size=15pt][color=red]THANK YOU THANK YOU THANK YOU[/color][/size] so, yea, that worked...
  21. I'v decided to throw my monitor out the window.... This is turning into a script that should work, but isent.... Main VARS are below, At the bottomg the javascript starts and I have added to this what ever field prints out...  look for the PHP FREAKS STARTS HERE line near the bottom. I have really tried ever sugestion above and still will not pars this string. The only one that has come close is the substr functions, but it will not stop when it hits the 2nd position.... [code] <?php         session_start() ;         $session_chat = $_SESSION['session_chat'] ;         $sid = ( isset( $_GET['sid'] ) ) ? $_GET['sid'] : "" ;         $requestid = ( isset( $_GET['requestid'] ) ) ? $_GET['requestid'] : "" ;         $sessionid = ( isset( $_GET['sessionid'] ) ) ? $_GET['sessionid'] : "" ;         $userid = ( isset( $_GET['userid'] ) ) ? $_GET['userid'] : "" ;         $action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : "" ;         $accountid = ( isset( $_GET['accountid'] ) ) ? $_GET['accountid'] : "" ;         if ( !file_exists( "web/".$session_chat[$sid]['asp_login']."/".$session_chat[$sid]['asp_login']."-conf-init.php" ) || !file_exists( "web/conf-init.php" ) )         {                 print "<font color=\"#FF0000\">[Configuration Error: config files not found! -$sid] Exiting...</font>" ;                 exit ;         }         include_once("./web/conf-init.php") ;         $DOCUMENT_ROOT = realpath( preg_replace( "/http:/", "", $DOCUMENT_ROOT ) ) ;         include_once("$DOCUMENT_ROOT/web/".$session_chat[$sid]['asp_login']."/".$session_chat[$sid]['asp_login']."-conf-init.php") ;         include_once("$DOCUMENT_ROOT/system.php") ;         include_once("$DOCUMENT_ROOT/lang_packs/$LANG_PACK.php") ;         include_once("$DOCUMENT_ROOT/API/sql.php") ;         include_once("$DOCUMENT_ROOT/API/Chat/update.php") ;         // set frame row properties depending if admin or regular request         $frame_row_properties = "*,100%" ;         if ( $session_chat[$sid]['isadmin'] && $session_chat[$sid]['deptid'] )                 $frame_row_properties = "*,100%" ;         // let's start the poll time         $_SESSION['session_chat'][$sid]['admin_poll_time'] = time() ;         $window_title = preg_replace( "/<(.*)>/", "", $session_chat[$sid]['visitor_name'] ) .": Support Request" ;         // PHP FREAKS STARTS HERE         // The visitor_name part holds the Account and Name ID's... This is being passed to mulitiple computers         // dynamicly to start a chat session between 2 people. All I need is to pars the account and name into         // different fields.         $test = ($session_chat[$sid]['visitor_name']);  //  test equals "<o1153848487>Account=12345 Name=Some Name"         $pos = strpos($test, 'Account=');          $pos2 = strpos($test, 'Name=');         $test1 = substr($test, $pos, $pos2);  // Test1 equals "Account=12345 Name=Some Name"  Takes the Session ID off         $test2 = substr($test, $pos2);  //Test2 equals "Name=Some Name"         str_replace(' ','&',$test1);  // test1 equals "Account=12345 Name=test"         parse_str($string);         ?> <html> <head> <title> <?php echo $window_title  ?> </title> <script language="JavaScript">         alert(<?php echo $test2 ?>);  // Name=Some Name         alert(<?php echo $test1 ?>);  //Account=12345 Name=Some Name         alert(<?php echo $session_chat[$sid]['visitor_name'] ?>;  //<o1153848487>Account=12345 Name=test         alert(<?php echo $account ?>); //BLANK         alert(<?php echo $name ?>); // BLANK </html> [/code]
  22. I love this site.... The one above this does not work, and effigy, Yes I do, but not today.... Here is my code right out of the app... [code]         $test = ($session_chat[$sid]['visitor_name']);  //test = Account-12345    Name-grazzman         $pos = strpos($test, 'Account-');  // returns the start position for Account-         $pos2 = strpos($test, 'Name-');  //returns the start position for Name-         $test1 = substr($test, $pos, $pos2);  //Returns "Account-12345      Name-grazzman"         $test2 = substr($test, $pos2);  //returns "Name-grazzman" [/code] The only problem with this is on $test1 is it not stopping when it hits $pos2 (Name-) it just goes to the end. From what I read on the php Manual page, it should be stopping when it hits the 2nd position string. This is from the php.net page. The 2nd line is what I'm after but it dosent work. Any thoughts... [code] <?php echo substr('abcdef', 1);    // bcdef echo substr('abcdef', 1, 3);  // bcd ?> [/code]
  23. I have a string that looks like this $string = "account=12345 name=grazzman" I need to then take $string and break it apart $account = "12345" $name = "grazzman" I have tried the split and mp_cut stuff, and it all returns a number or wants an array... Is their any way to do this without an array? I hate arrays. All I need is the name of the function that will do this without an array or a true/false/position respons... Thanks
  24. nevermind... its curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
×
×
  • 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.