Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-24-2006, 10:03 AM Corrupted Config
Junior Talker

Posts: 2
Trades: 0
Hi,

I have a site that is using php to take orders....when the customer gets to the step2 here: https://wind.securenet-server.net/~iroam/step2.php the text fields have this message :

<br /><b>Notice</b>: Undefined index: first_name in <b>/home/iroam/public_html/step2.php</b> on line <b>371</b><br />

The only changes i made to the config.php file was changing an email address.

please any advise would be great

regards
mike
mikeissa is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-24-2006, 11:22 AM Re: Corrupted Config
cdwhalley.com's Avatar
Skilled Talker

Posts: 75
Trades: 0
It would help if you posted some code...
cdwhalley.com is offline
Reply With Quote
View Public Profile Visit cdwhalley.com's homepage!
 
Old 04-24-2006, 11:28 AM Re: Corrupted Config
Junior Talker

Posts: 2
Trades: 0
Code:
<?php
        //error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
        error_reporting(E_ERROR | E_PARSE | E_NOTICE);
        include('config.php');
        include('lib/functions.php');
        session_start();
        $essid = $_SESSION['essid'];
        if(!$essid OR ($essid != session_id())) {
                header("Location: step1.php");
                exit;
        }
 
        $procesor = isset($_POST['Submit_2']);
        if($procesor) {
                mysql_connect($hostname, $username_mysql, $password_mysql) or $errors[] = "MySQL Error #" . mysql_errno() . ": " . mysql_error();
                mysql_select_db($database) or $errors[] = "MySQL Error #" . mysql_errno() . ": " . mysql_error();

                $first_name = $_POST['first_name'];
                $last_name = $_POST['last_name'];
                $email = $_POST['e-mail'];
                $username = $_POST['username'];
                $password = $_POST['password'];
                $confirm_p = $_POST['confirm_password'];
                $domain = $_POST['domain'];

                IF(!$first_name OR !$last_name OR !$email OR !$username OR !$password OR !$confirm_p OR !$domain)
                        $errors[] = "Please fill all textboxes!";
 
                IF($password != $confirm_p)
                        $errors[] = "Retype your password!"; else IF(ereg('[^A-Za-z0-9_]', $password)) $errors[] = "Invalid Password!";
 
                IF(strlen($domain) < 6) $errors[] = "Domain must contain min. 6 chars!";
                IF(ereg('[^A-Za-z0-9_]', $username)) $errors[] = "Invalid Username!";
                IF(ereg('[^A-Za-z0-9_]', $_POST['domain'])) $errors[] = "Invalid Domain!";
                IF(checkEmail($email) == FALSE) $errors[] = "E-mail entered is not valid.";
 
                $query = "SELECT * FROM $table WHERE username='$username'";
                $result=mysql_query($query);
                $num=mysql_num_rows($result);

         if($num>0) {
                                $errors[] = "Username already in use, please change!";
                                
                        }

               $query2 = "SELECT * FROM $table WHERE domaincheck='$domain'";
                $result2=mysql_query($query2);
                $num2=mysql_num_rows($result2);
                        if($num2>0) {
                                $errors[] = "Domain already in use, please change!";
                        }

                $_SESSION['ddcheck'] = $domain;
                $first_name = $_POST['first_name'];
                $_SESSION['first_name'] = $first_name;
                $last_name = $_POST['last_name'];
                $_SESSION['last_name'] = $last_name;
                $email = $_POST['e-mail'];
                $_SESSION['email'] = $email;
                $username = $_POST['username'];
                $_SESSION['username'] = $username;
                $password = $_POST['password'];
                $_SESSION['password'] = $password;
                $confirm_p = $_POST['confirm_password'];
                $domain = "iroam.biz.".$_POST['domain'];
                $_SESSION['domain'] = $domain;
                $domain_show = $_POST['domain'];
                $_SESSION['domain_show'] = $domain_show;
                
                
 
                if(!$errors) {
                        header("Location: step3.php");
                        exit;
                }
        }
 

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>iRoam.biz: Sign-up</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META
content="wireless, mobile, broadband, wireless internet, hotspot, hotspots, hot spot, hot spots, wifi, wi-fi, wi fi, VPN, 3G, ADSL, isp, Personal Broadband, ipass, global roaming, hotspot roaming,  wireless access points, global access points, hot spot, mobile hotspot, broadband wireless, ipass.com, remote access point, 802.11, 802.11b, WiMax,  mobile computing, unwired, unwire, wireless isp, wireless solutions , international roaming, international internet access , wireless broadband , goremote , gric , xdrive , gotomypc , gotomeeting"
name=keywords>
<META
content="iRoam.biz offers secure Global internet access in over 155 countries worldwide.  --- Single dialer making it simple to use. --- Connect using dial-up, broadband or wireless WiFi. --- Intergrates with your existing VPN and firewall. --- Cost effective. --- Connect your travelling employees using a single account. --- Instant online signup."
name=description>
<META content=ALL name=ROBOTS>
<META content=INDEX,FOLLOW name=ROBOTS><!-- <meta name="revisit-after" content="7 days"> -->
<META http-equiv=expires content=0>
<META http-equiv=pragma content=no-cache>
<META http-equiv=cache-control content=no-cache>
<META http-equiv=Content-Style-Type content=text/css><LINK
href="signup1_files/style.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.2722" name=GENERATOR>
</HEAD>
<BODY style="BACKGROUND-POSITION: 50% top; BACKGROUND-REPEAT: repeat-x"
bottomMargin=0 bgColor=#e6e6e6 leftMargin=0
background=signup1_files/back-body.jpg topMargin=0 rightMargin=0
MARGINHEIGHT="0" MARGINWIDTH="0">
<CENTER>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width=574 border=0>
  <TBODY>
  <TR>
    <TD width=13 background=signup1_files/back-left.jpg height="100%"><IMG
      height=234 src="signup1_files/left.jpg" width=13></TD>
    <TD width=548>
      <TABLE height="100%" cellSpacing=0 cellPadding=0 width=548 border=0>
        <TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
              <TBODY>
              <TR>
                <TD><IMG height=60 alt="" src="signup1_files/y-1.jpg"
                  width=481></TD>
                <TD width=67 background=signup1_files/y-2.jpg height=60
                  ALT=""><DIV style="PADDING-LEFT: 14px; PADDING-TOP: 14px"><A
                  style="COLOR: #8f8f8f; TEXT-DECORATION: none"
                  href="<A href="http://www.iroam.biz/index.html">Home</A">http://www.iroam.biz/index.html">Home</A>
                  <BR><A style="COLOR: #8f8f8f; TEXT-DECORATION: none"
                  href="<A href="https://wind.securenet-server.net/~iroam/customer/">Login</A">https://wind.securenet-server.net/~iroam/customer/">Login</A>
                  </DIV></TD></TR>
              <TR>
                <TD colSpan=2><IMG height=142 alt=""
                  src="signup1_files/y-3.jpg"
        width=548></TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD>
            <TABLE id=table1 cellSpacing=0 cellPadding=0 width=548 border=0>
              <TBODY>
              <TR>
                <TD><A
                  href="<A href="http://www.iroam.biz/service.html"><IMG">http://www.iroam.biz/service.html"><IMG
                  height=32 alt="global internet"
                  src="signup1_files/menu_01.jpg" width=90></A></TD>
                <TD><A
                  href="<A href="http://www.iroam.biz/additions.html"><IMG">http://www.iroam.biz/additions.html"><IMG
                  height=32 alt="internet wifi" src="signup1_files/menu_02.jpg"
                  width=90></A></TD>
                <TD><A
                  href="<A href="http://www.iroam.biz/FAQs.html"><IMG">http://www.iroam.biz/FAQs.html"><IMG
                  height=32 alt="broadband internet provider"
                  src="signup1_files/menu_03.jpg" width=94></A></TD>
                <TD><A
                  href="<A href="http://www.iroam.biz/signup.html"><IMG">http://www.iroam.biz/signup.html"><IMG
                  height=32 alt="broadband internet provider service "
                  src="signup1_files/menu_04.jpg" width=92></A></TD>
                <TD><A
                  href="<A href="http://www.iroam.biz/cgi-bin/mypage.cgi?iroam=true"><IMG">http://www.iroam.biz/cgi-bin/mypage.cgi?iroam=true"><IMG
                  height=32 alt="international roaming "
                  src="signup1_files/menu_05.jpg" width=92></A></TD>
                <TD><A
                  href="<A href="http://www.iroam.biz/contact.html"><IMG">http://www.iroam.biz/contact.html"><IMG
                  height=32 alt="access global internet "
                  src="signup1_files/menu_06.jpg"
            width=90></A></TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD><IMG height=15 src="signup1_files/up-1.jpg" width=548></TD></TR>
        <TR>
          <TD style="PADDING-LEFT: 9px" background=signup1_files/back-1.jpg
          height=373>
            <TABLE height="100%" cellSpacing=0 cellPadding=0 width=530
              border=0><TBODY>
              <TR>
                <TD width=1 bgColor=#a6a6a6 height=23><IMG height=1
                  src="signup1_files/spacer.gif" width=1></TD>
                <TD style="COLOR: #ffffff; PADDING-TOP: 1px"
                background=signup1_files/back-but.jpg height=23><IMG
                  style="MARGIN-TOP: 2px; MARGIN-LEFT: 9px; MARGIN-RIGHT: 2px"
                  height=7 src="signup1_files/b-1.jpg" width=7 align=absMiddle>
                  <STRONG>Roaming sign-up</STRONG> </TD>
                <TD width=1 bgColor=#a6a6a6 height=23><IMG height=1
                  src="signup1_files/spacer.gif" width=1></TD></TR>
              <TR>
                <TD width=1 bgColor=#a6a6a6 height="100%"><IMG height=1
                  src="signup1_files/spacer.gif" width=1></TD>
                <TD width=528>
                  <DIV
                  style="PADDING-RIGHT: 7px; PADDING-LEFT: 11px; PADDING-TOP: 9px"><BR>
                                  <SPAN class=CopySmall><SPAN class=Copy>
                  <P class=CopySmall align=center><BR>
<p class="style1">Billing contact details
</p>
<p> Please enter the account holders details. This is the person responsible for paying the bill. This person is also the default user in the account (You can add and remove users shortly.) </p>
<FORM action="<?php ECHO $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
<table width="493" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="86" height="22" align="right" valign="middle">Frist name </td>
    <td width="10">&nbsp;</td>
    <td width="184" valign="top" class="style1"><input name="first_name" type="text" class="style1" id="first_name" value="<?=$_SESSION['first_name'];?>"></td>
    <td width="213"></td>
    </tr>
  <tr>
    <td height="27" align="right" valign="middle">Last name </td>
    <td></td>
    <td valign="top" class="style1"><input name="last_name" type="text" class="style1" id="last_name" value="<?=$_SESSION['last_name'];?>"></td>
    <td valign="top"><?php IF(isset($errors)) echo "Please fix this...";?></td>
  </tr>
  <tr>
    <td height="22" align="right" valign="middle">E-Mail</td>
    <td>&nbsp;</td>
    <td valign="top" class="style1"><input name="e-mail" type="text" class="style1" id="e-mail" value="<?=$_SESSION['email'];?>"></td>
    <td rowspan="4" valign="top" class="style3"><div class="style3">
              <?php
            IF(isset($errors)){
                FOR($i=0;$i<sizeof($errors);$i++) {
                        ECHO $errors[$i]."<BR>";
                   }
        }
        ?>
    </div></td>
  </tr>
  <tr>
    <td height="22" align="right" valign="middle">Username</td>
    <td>&nbsp;</td>
    <td valign="top" class="style1"><input name="username" type="text" class="style1" id="username" value="<?=$_SESSION['username'];?>"></td>
    </tr>
  <tr>
    <td height="22" align="right" valign="middle">Password</td>
    <td>&nbsp;</td>
    <td valign="top" class="style1"><input name="password" type="password" class="style1" id="password"></td>
    </tr>
  <tr>
    <td height="22" align="right" valign="middle">Confirm Password</td>
    <td>&nbsp;</td>
    <td valign="top" class="style1"><input name="confirm_password" type="password" class="style1" id="confirm_password"></td>
    </tr>
  <tr>
    <td height="22" align="right" valign="middle">Domain</td>
    <td>&nbsp;</td>
    <td valign="top" class="style1"><span class="style3">iroam.biz.</span><input name="domain" type="text" class="style3" id="domain" value="<?=$_SESSION['domain_show'];?>" size="12" maxlength="12"></td>
    <td rowspan="2" valign="top"> Enter a word that descripts this account,<br>
eg company name or surname </td>
  </tr>
  <tr align="center" valign="bottom">
    <td height="9"></td>
    <td></td>
    <td></td>
    </tr>
  <tr align="center" valign="bottom">
    <td height="26" colspan="3" valign="top"><input name="Cancel_2" type="reset" class="button" id="Cancel_2" value="Cancel">      <input name="Submit_2" type="submit" class="button" id="Submit_2" value="Next"></td>
    <td>&nbsp;</td>
  </tr>
</table>
</FORM>
                                  </P></SPAN>
                  <P></P></SPAN></DIV></TD>
                <TD width=1 bgColor=#a6a6a6 height="100%"><IMG height=1
                  src="signup1_files/spacer.gif" width=1></TD></TR>
              <TR>
                <TD bgColor=#a6a6a6 colSpan=3><IMG height=1
                  src="signup1_files/spacer.gif"
        width=1></TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD style="BACKGROUND-POSITION: 50% top; BACKGROUND-REPEAT: no-repeat"
          background=signup1_files/end-1.jpg bgColor=#cdcdcd height="100%">
            <DIV style="PADDING-LEFT: 22px; PADDING-TOP: 27px"><A
            style="COLOR: #4a75ae"
            href="<A href="http://www.iroam.biz/service.html">Product</A>&nbsp;&nbsp;|&nbsp">http://www.iroam.biz/service.html">Product</A>&nbsp;&nbsp;|&nbsp;
            <A style="COLOR: #4a75ae"
            href="<A href="http://www.iroam.biz/additions.html">Additions</A>&nbsp;&nbsp;|&nbsp;&nbsp">http://www.iroam.biz/additions.html">Additions</A>&nbsp;&nbsp;|&nbsp;&nbsp;
            <A style="COLOR: #4a75ae"
            href="http://www.iroam.biz/FAQs.html">Faq's</A>
            |&nbsp; &nbsp;<A style="COLOR: #4a75ae"
            href="<A href="http://www.iroam.biz/signup.html">Sign-up</A>&nbsp;&nbsp;|&nbsp;&nbsp">http://www.iroam.biz/signup.html">Sign-up</A>&nbsp;&nbsp;|&nbsp;&nbsp;
            <A style="COLOR: #4a75ae"
            href="<A href="http://www.iroam.biz/cgi-bin/mypage.cgi?iroam=true">My">http://www.iroam.biz/cgi-bin/mypage.cgi?iroam=true">My
            Page</A>&nbsp;| &nbsp;<a target=_blank style="color:#4A75AE" href="http://www.iroam.biz/cgi-bin/tell.cgi" onclick="window.open('http://www.iroam.biz/cgi-bin/tell.cgi?referer='+escape(window.location.href),'','width=360,height=360,status=1');return false;">Tell a
            Friend</A>&nbsp;&nbsp;| &nbsp;<A style="COLOR: #4a75ae"
            href="<A href="http://www.iroam.biz/contact.html">Contacts</A">http://www.iroam.biz/contact.html">Contacts</A>
            |&nbsp; <A style="COLOR: #4a75ae"
            href="javascript:window.external.AddFavorite('http://www.iRoam.biz',%20'iPass%20Global%20internet%20access%20-%20155%20countries%20worldwide.')">Bookmark</A>&nbsp;&nbsp;|&nbsp;
            <A style="COLOR: #4a75ae"
            href="<A href="http://search.freefind.com/find.html?id=32001633&amp;m=0&amp;p=0">Site">http://search.freefind.com/find.html?id=32001633&amp;m=0&amp;p=0">Site
            map</A>
            <DIV style="COLOR: #8c8c8c; PADDING-TOP: 10px">iRoam.biz © 2005 | <A
            style="COLOR: #8c8c8c"
            href="<A href="http://www.iroam.biz/privacy.html">Privacy">http://www.iroam.biz/privacy.html">Privacy
            Policy</A></DIV></DIV></TD></TR></TBODY></TABLE></TD>
    <TD width=13 background=signup1_files/back-right.jpg><IMG height=234
      src="signup1_files/right.jpg"
width=13></TD></TR></TBODY></TABLE></CENTER></BODY></HTML>

Last edited by Christopher; 04-25-2006 at 12:07 AM.. Reason: Please use the [code][/code] tags to preserve whitespace
mikeissa is offline
Reply With Quote
View Public Profile
 
Old 04-26-2006, 11:20 AM Re: Corrupted Config
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
remove E_NOTICE from your error_reporting method. It will then go away.

Also to more of a coding geek check check and check again. A good script should be bulky with checks.

I.E
PHP Code:
isset($_POST['first_name']) ?  $first_name $_POST['first_name'] : '';
isset( 
$_POST['last_name']) ? $last_name $_POST['last_name'] : ''
This then will kill off your NOTICE messages allowing you to code cleanly. Remember your script will always complain about variables that you perform an action on when there is no such variable.

Of course once you do something with your script thjat message will disapear because your variable at that stage exists. Prior to that there is no such variable as $_POST['first_name'] so when you try to perform some action upon it it will complain loudly.

Remember check check and check again. Its a sign of good coding.

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Reply     « Reply to Corrupted Config
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51582 seconds with 12 queries