Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6379677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:10:09+00:00 2026-05-25T02:10:09+00:00

Ok. It seems that I am having some problems with my PHP code, and

  • 0

Ok. It seems that I am having some problems with my PHP code, and it is bugging me. So far, the form half works and half doesn’t. here is the code.

<?php
include "cgi-bin/toplinks.php"; include "cgi-bin/charsheetarrays.php"; include "cgi-bin/dropdown.php"; include "cgi-bin/connect_to_mysql.php";

if (isset($_POST['pccharname'])){
    $playerid=$_SESSION['id'];
    $pccharname=ereg_replace("[^A-Z a-z]", "", $_POST['pccharname']);
    $pcclan=$_POST['pcclan'];
    $pcfamily=$_POST['famnames'];
    $pchonor=$_POST['pchonor'];
    $pcglory=$_POST['pcglory'];
    $pcstatus=$_POST['pcstatus'];
    $pctaint=$_POST['pctaint'];
    $charconcept=ereg_replace("[^A-Z a-z]", "", $_POST['charconcept']);
    $pcmon=$_POST['pcmon'];
    $pcfamilyties=ereg_replace("[^A-Z a-z.:]", "", $_POST['pcfamilyties']);
    $pchistorytext=ereg_replace("[^A-Z a-z.:]", "", $_POST['pchistorytext']);
    $pcbelieftext=ereg_replace("[^A-Z a-z.:]", "", $_POST['pcbelieftext'])
    $pcgoalstext=ereg_replace("[^A-Z a-z.:]", "", $_POST['pcgoalstext']);
    $pchookstext=ereg_replace("[^A-Z a-z.:]", "", $_POST['pchookstext']);
    $pcstatagi=$_POST['pcstatagi'];
    $pcstatint=$_POST['pcstatint'];
    $pcstatref=$_POST['pcstatref'];
    $pcstataware=$_POST['pcstataware'];
    $pcstatstam=$_POST['pcstatstam'];
    $pcstatwill=$_POST['pcstatwill'];
    $pcstatstr=$_POST['pcstatstr'];
    $pcstatpercep=$_POST['pcstatpercep'];
    $pcstatvoid=$_POST['pcstatvoid'];
    $pcinitmodroll=$_POST['pcinitmodroll'];
    $pcinitmodkeep=$_POST['pcinitmodkeep'];
    $pcinitmodbonus=$_POST['pcinitmodbonuse'];
    $pcwoundmod=$_POST['pcwoundmod'];
    $pcarmor=$_POST['pcarmor'];
    $pctnmods=$_POST['pctnmods'];
    $pcadddisadlist=$_POST['pcaddisadlist'];
    $ssstringarr=array (ss1=>$_POST['ss0'],ss2=>$_POST['ss1'],ss3=>$_POST['ss2'],ss4=>$_POST['ss3'],ss5=>$_POST['ss4'],ss6=>$_POST['ss5'],ss7=>$_POST['ss6']);
    $ssstring=implode("~",$ssstringarr);

    for($i=0; $i<36; $i++)
    {
        $n=$i-1;
        $skillnum="skill". $n;
        $emphnum="skill". $n ."emph";
        $ranknum="skill". $n ."rank";
        $skillstringarr= array ();
        $skillemphstringarr= array ();
        $skillrankstringarr= array ();
        $skillstringarr[skillnum] = $_POST[skillnum];
        $skillemphstringarr[emphnum] = $_POST[emphnum];
        $skillrankstringarr[ranknum] = $_POST[ranknum];
    }

    $skillstring=implode("~",$skillstringarr);
    $emphstring=implode("~",$skillemphstringarr);
    $rankstring=implode("~",$skillrankstringarr);
    $pctechs=$_POST['pctechs'];
    $pcspells=$_POST['pcspells'];
    $pckata=$_POST['pckata'];
    $pckiho=$_POST['pckiho'];
    $pcworninv=$_POST['pcworninv'];
    $pcownedinv=$_POST['pcownedinv'];
    $pcnormgen=$_POST['pcnormgen'];
    $pcdamgen=$_POST['pcdamgen'];
    $pcgmnotes=$_POST['pcgmnotes'];
    $servinfolog=$_POST['servinfolog'];
    $pcdatesanc=$_POST['pcdatesanc'];
    $pcwhosanc=$_POST['pcwhosanc'];
    $pclastlogin=$_POST['pclastlogin'];
    $pcxpavail=$_POST['pccp'];

    if (($pccharname=="")||($pcclan=="---")||$famname=="---"||$famname=="Pick A Family"||($pcschool=="---")||($pcschool=="--Crab Schools--")||($pcschool=="--Crab Schools--")||($pcschool=="--Crane Schools--")||($pcschool=="--Dragon Schools--")||($pcschool=="--Lion Schools--")||($pcschool=="--Mantis Schools--")||($pcschool=="--Phoenix Schools--")||($pcschool=="--Scorpion Schools--")||($pcschool=="--Unicorn Schools--")||($pcschool=="--Imperial Schools--")||($pcschool=="--Badger Schools--")||($pcschool=="--Dragonfly Schools--")||($pcschool=="--Hare Schools--")||($pcschool=="--Monkey Schools--")||($pcschool=="--Oriole Schools--")||($pcschool=="--Ox Schools--")||($pcschool=="--Sparrow Schools--")||($pcschool=="--Tortoise Schools--")||($pcschool=="--Monk Schools--")||($pcschool=="--Ronin Schools--")||($pcschool=="--Merchant Schools")||($pcschool=="--Pick A School--"))
    {
        $errormsg = "Please correct your error";
    }else{
    $sql=mysql_query("INSERT INTO pcchars (playerid,pccharid,pccharname,pcclan,pcschool,pchonor,pcglory,pcstatus,pctaint,pchistorytext,pcbelieftext,pcgoalstext,pchookstext,charconcept,pcmon,pcfamilyties,pcstatagi,pcstatint,pcstatref,pcstataware,pcstatstam,pcstatwill,pcstatstr,pcstatpercep,pcstatvoid,pcinitmodroll,pcinitmodkeep,pcinitmodbonus,pcwoundmod,pcarmor,pctnmods,pcaddisadlist,ssstring,skillstring,emphstring,rankstring,pctechs,pcspells,pckata,pckiho,pcworninv,pcownedinv,pcgentry,damgentry,pcgmnotes,servinfolog,pcdatecreate,issanced,pcdatesanc,whosanc,pclastlogin,pcxpavail)VALUES('$playerid','$pccharid','$pccharname','$pcclan','$pcschool','$pchonor','$pcglory','$pcstatus','$pctaint','$pchistorytext','$pcbelieftext','$pcgoalstext','$pchookstext','$charconcept','$pcmon','$pcfamilyties','$pcstatagi','$pcstatint','$pcstatref','$pcstataware','$pcstatstam','$pcstatwill','$pcstatstr','$pcstatpercep','$pcstatvoid','$pcinitmodroll','$pcinitmodkeep','$pcinitmodbonus','$pcwoundmod','$pcarmor','$pctnmods','$pcaddisadlist','$ssstring','$skillstring','$emphstring','$rankstring','$pctechs','$pcspells','$pckata','$pckiho','$pcworninv','$pcownedinv','$pcgentry','$damgentry','$pcgmnotes','$servinfolog','now()','$issanced','$pcdatesanc','$whosanc','$pclastlogin','$pcxpavail')") or die (mysql_error());
    }
}else{
echo "<html><head></head><body>Please <a href='http://fiveringsonline.net/login.php'>Login</a> here. You will have to make your character again, because I haven't set it up to save.</body></html>";
}//close id set
?>

Now, for pchistory and the skill,rank, and emph array implodes, i get nothing. also, nothing from adsdissads.
now, history and adsdisads are textareas, so, they should technically work.

i understand my for loop my be crap, considering it is passing values around like noone’s business.

so, ultimately, i am looking for a bit of help to get this working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:10:09+00:00Added an answer on May 25, 2026 at 2:10 am

    Your variables are not referenced correctly:

    $skillstringarr[skillnum] = $_POST[skillnum];
    $skillemphstringarr[emphnum] = $_POST[emphnum];
    $skillrankstringarr[ranknum] = $_POST[ranknum];
    

    They should be:

    $skillstringarr[$skillnum] = $_POST[s$killnum];
    $skillemphstringarr[$emphnum] = $_POST[$emphnum];
    $skillrankstringarr[$ranknum] = $_POST[$ranknum];
    

    Also note that you are reinitializing your arrays with each loop:

    $skillstringarr= array ();
    $skillemphstringarr= array ();
    $skillrankstringarr= array ();
    

    You should do this once, before the loop, to avoid obliterating data.

    Unrelated to the current issue, but relevant nonetheless: Please heed the comments regarding SQL injection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some problems with the php script below that I'm currently working on.
I'm having some trouble with a SQL Server 2005 database that seems like it's
I am having problems with the google maps API V3. It seems that every
I'm having some issues with a jQuery AJAX call. My code works fine when
I'm started having problems with the encoding, it seems that somehow Notepad++ changed the
After having looked at each of these two projects, it seems that both are
My coworkers and I were having a discussion about this yesterday. It seems that
I am having a heck of time with something that seems rather straightforward but
I am having a strange issue that I can't seem to resolve. Here is
I'm trying to parse some HTML with DOM in PHP, but I'm having some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.