Jump to content

Tripic

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Posts posted by Tripic

  1. ok first things first heres the var dump from my controller

     

    array(2) { ["title"]=> string(13) "My Blog Title" [0]=> array(4) { ["title"]=> string(4) "Test" ["body"]=> string(5) "Test1" ["date"]=> string(19) "0000-00-00 00:00:00" ["author"]=> string(1) "1" } }

     

    heres the error i get when i try to go through the view file

     

    A PHP Error was encountered

    Severity: Warning

     

    Message: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 2

     

    Filename: libraries/Parser.php

     

    Line Number: 161

     

    the code for the cotroller

     

    <?php

     

    class Blog extends Controller {

    function Blog(){

    parent::Controller();

    //$this->load->scaffolding('blog_entries');

    }

    function index(){

    $this->load->helper('html');

    $this->load->library('parser');

    $this->load->library('ion_auth');

    $data ['title'] = "My Blog Title";

            $dbdata ['query'] = $this->db->get('blog_entries');

            foreach($dbdata['query']->result() as $row) { $data[] = array('title' => $row->title, 'body' => $row->body, 'date' => $row->date, 'author' => $row->author); }

          // var_dump($data);

          $this->parser->parse('blog_view', $data);

     

    }

    }

     

    ?>

     

    the code for the view file

     

    <head>

    <?

    echo link_tag('awesomewinds.css');

    $this->load->helper('url');

    ?>

    <? echo $title ?>

     

     

     

    </head>

    <body>

    <table width="940" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#DDE9F7">

    <tr>

    <td>

    <table width="940" border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td colspan="8" width="940"><div class="header"></div></td>

    </tr>

    <tr>

    <td width="237"><div class="frametopleft"></div></td>

    <td width="100"><div class="menubookstore"><a href="#"></a></div></td>

    <td width="99"><div class="menuart"><a href="#"></a></div></td>

    <td width="74"><div class="menublog"><a href="#"></a></div></td>

    <td width="91"><div class="menulinks"><a href="#"></a></div></td>

    <td width="108"><div class="menucontactus"><a href="#"></a></div></td>

    <td width="109"><div class="menufun"><a href="#"></a></div></td>

    <td width="124"><div class="frametopright"></div></td>

    </tr>

    <tr>

    <td colspan="8">

    <table width="940" border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td width="30"><div class="backgroundleft"></div></td>

    <td width="168">

    <table width="168" border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td width="168"><div class="leftmenu1"></div></td>

    </tr>

    <tr>

    <td width="168"><div class="leftmenu2"><a href="#"></a></div></td>

    </tr>

    <tr>

    <td width="168"><div class="leftmenu3"><a href="#"></a></div></td>

    </tr>

    <tr>

    <td width="168"><div class="leftmenu4"><a href="#"></a></div></td>

    </tr>

    <tr>

    <td width="168"><div class="leftmenu5"><a href="#"></a></div></td>

    </tr>

    <tr>

    <td width="168"><div class="leftmenu6"></div></td>

    </tr>

    </table>

    </td>

    <td width="577"><div class="backgroundmiddle"><br><br>

     

     

     

     

    </div></td>

    <td width="139">

    <table width="139" border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td width="139"><div class="rightmenu1"></div></td>

    </tr>

    <tr>

    <td width="139"><div class="rightmenu2"><a href="http://www.awesome-winds.com/proto/index.php/auth/login"></a></div></td>

    </tr>

    <tr>

    <td width="139"><div class="rightmenu3"><a href="http://www.awesome-winds.com/proto/index.php/auth/create_user"></a></div></td>

    </tr>

    <tr>

    <td width="139"><div class="rightmenu4"><a href="#"></a></div></td>

    </tr>

    <tr>

    <td width="139"><div class="rightmenu5"></div></td>

    </tr>

    <tr>

    <td>

    <table width="139" border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td width="31"><div class="rightmenu6"></div></td>

    <td width="86"><img src="http://www.awesome-winds.com/random.php" width="85" height="84" border="0">  </td>

    <td width="22"><div class="rightmenu7"></div></td>

    </tr>

    </table>

    </td>

    </tr>

    <tr>

    <td width="139"><div class="rightmenu8"></div></td>

    </tr>

    </table>

    </td>

    <td width="26"><div class="backgroundright"></div></td>

    </tr>

    </table>

    </td>

    </tr>

    </table>

           

    </td>

    </tr>

     

    </table>

    </body>

  2. Hello. Today I was about to create something like small login script. So, I made a script and its sucesfully working, BUT. The file that should NOT be able to access with instantly typing in address bar link, opens like it doesn't reqs login. So can anybody script me something for that? Thanks.  :shrug:

    what do you mean redirect  if your just trying to get the login script to redirect to a new page try using the header function  but if its a login script i would assume your sending failures to one url and sucessful logins to another

  3. Ok the $query is defined in the first code i put up i think but here it is anyways i am using a new one now but if you think this was better i have it backed up my new one is below it doesnt work

     

    $query="INSERT INTO users (user_id, user_name, user_pass, user_type, Member_Since)VALUES ('NULL','".$user_username."','".$user_pass."','".$user_type."','NULL')";	$queryb="INSERT INTO user_info (user_infoid, user_first_name, user_last_name, user_street_address, user_state, user_zip, user_phone, user_fax, user_email_address, user_city, user_apartment_number)VALUES ('NULL','".$user_first_name."','".$user_last_name."','".$user_street."','".$user_state."','".$user_zip."','".$user_phone."','".$user_fax."','".$user_email."','".$user_city."','".$user_apt."')";	
    

     

     

    yes i need the id from users to post in user info and i rewrote the code but it is still only posting to users  and not user_info  I will post my new code and upload the file as well i cant figure out where im going wrong

     

    <?php
    
    
    $user_email = $_POST['user_email']; 
    $user_emailv = $_POST['user_emailv'];
    $user_pass = $_POST['user_passv'];
    $user_passv = $_POST['user_pass'];
    $user_first_name = $_POST['user_first_name'];
    $user_last_name = $_POST['user_last_name'];
    $user_street = $_POST['user_street_address'];
    $user_apt = $_POST['user_apartment_number'];
    $user_city = $_POST['user_city'];
    $user_state = $_POST['user_state'];
    $user_zip = $_POST['user_zip'];
    $user_phone = $_POST['user_phone'];
    $user_fax = $_POST['user_fax'];
    $user_username = $_POST['user_esername'];
    $user_type = $_POST['type'];
    ?>
    <?php
    if($user_email != $user_emailv){ 
    	echo 'Verification Email  does not match Email Please Use your Browsers Back button to fix this ';
    	return;
    }
    if($user_pass != $user_passv){
    	echo 'Your passwords Do not match Please Use your Browsers Back button to fix this ';
    	return;
    }
    ?>
    
    
    <?php require_once('Connections/live.php'); 
    $live;
    mysql_select_db ($database_live);
    // Insert Data into User Table of database
    mysql_query("INSERT INTO users (user_id, user_name, user_pass, user_type, Member_Since)VALUES ('NULL','".$user_username."','".$user_pass."','".$user_type."','NULL');");
    // End of User Table Insert 
    $id = mysql_insert_id();//Get the id of the last record inserted to the database 
    // Insert Data into User Information Table of database 
    mysql_query("INSERT INTO user_info (user_infoid, user_first_name, user_last_name, user_street_address, user_state, user_zip, user_phone, user_fax, user_email_address, user_city, user_apartment_number, user_id)VALUES ('NULL','".$user_first_name."','".$user_last_name."','".$user_street."','".$user_state."','".$user_zip."','".$user_phone."','".$user_fax."','".$user_email."','".$user_city."','".$user_apt."','".$id."');");
    // End of User Information Table Insert
    mysql_close();
    header("location: ./index.php");
    ?>
    
    

     

    [attachment deleted by admin]

  4. Ok here goes I cleaned up my code some what still not the best in the world but easier to understand i think the first table post fine but nothing post to the second table at all the first table is users the second is user_info any ideahs or sugestions are greatley apreciated

     

    <?php
    
    
    $user_email = $_POST['user_email']; 
    $user_emailv = $_POST['user_emailv'];
    $user_pass = $_POST['user_passv'];
    $user_passv = $_POST['user_pass'];
    $user_first_name = $_POST['user_first_name'];
    $user_last_name = $_POST['user_last_name'];
    $user_street = $_POST['user_street_address'];
    $user_apt = $_POST['user_apartment_number'];
    $user_city = $_POST['user_city'];
    $user_state = $_POST['user_state'];
    $user_zip = $_POST['user_zip'];
    $user_phone = $_POST['user_phone'];
    $user_fax = $_POST['user_fax'];
    $user_username = $_POST['user_esername'];
    $user_type = $_POST['type'];
    ?>
    <?php
    if($user_email != $user_emailv){ 
    	echo 'Verification Email  does not match Email Please Use your Browsers Back button to fix this ';
    	return;
    }
    if($user_pass != $user_passv){
    	echo 'Your passwords Do not match Please Use your Browsers Back button to fix this ';
    	return;
    }
    ?>
    
    
    <?php require_once('Connections/live.php'); 
    $live;
    mysql_select_db ($database_live);
    // Insert Data into User Table of database
    mysql_query("INSERT INTO users (user_id, user_name, user_pass, user_type, Member_Since)VALUES ('NULL','".$user_username."','".$user_pass."','".$user_type."','NULL');");
    // End of User Table Insert 
    $id = mysql_insert_id();//Get the id of the last record inserted to the database 
    // Insert Data into User Information Table of database 
    mysql_query("INSERT INTO user_info (user_infoid, user_first_name, user_last_name, user_street_address, user_state, user_zip, user_phone, user_fax, user_email_address, user_city, user_apartment_number, user_id)VALUES ('NULL','".$user_first_name."','".$user_last_name."','".$user_street."','".$user_state."','".$user_zip."','".$user_phone."','".$user_fax."','".$user_email."','".$user_city."','".$user_apt."','".$id."');");
    // End of User Information Table Insert
    mysql_close();
    header("location: ./index.php");
    ?>
    

  5. HAve you checked your database to make sure the corosponding id exist I have had a problem with that before when i kept playing with my table and then deleting it then when i went to setup the dynamic page the first 12 ids where used up and deleted

  6. Ok I tried that but now its not adding anything to the database at all I know im missing something really stupid here but i cant figure out whati am missing i have atached 3 files live.php is the conection file i know theres no pass its not ready for publication im working on it on a linux server isetup on my network createemployee.php is the actual form that the data comes from and createemp.php is the file that should be doing what i want it to but i cant seem to get it to work. Ohh and thanks for the return; ideah i should have known that but for some reason compleley forgot about it guess thats what happens after 5 years of no real programing

     

    [attachment deleted by admin]

  7. Ok this is my lates attempt but now its not posting anything at all prior to this if i tried to run one then use mysql close(); it would only run the first of the 2 i cant figure out where i am going wrong Please help

     

    if  ($user_email == $user_emailv){
    if ($user_pass == $user_passv){
    $live;
    mysql_select_db ($database_live);
    $sql ="INSERT INTO users (user_id, user_name, user_pass, user_type, Member_Since)VALUES ('NULL','".$user_username."','".$user_pass."','".$user_type."','NULL')";
    if( isset($user_first_name) )
    {
      #  get the user id  
      $user_id = mysql_insert_id( $conn );
    $sql .="INSERT INTO user_info (user_infoid, user_first_name, user_last_name, user_street_address, user_state, user_zip, user_phone, user_fax, user_email_address, user_city, user_apartment_number, user_id)VALUES ('NULL','".$user_first_name."','".$user_last_name."','".$user_street."','".$user_state."','".$user_zip."','".$user_phone."','".$user_fax."','".$user_email."','".$user_city."','".$user_apt."','".$user_id."')";
      $result = mysql_query( $sql,$conn );
    }
    mysql_free_result( $result );	
    
    mysql_close();
    
    echo "Did it work";
    }
    else{
    echo "Your passwords do not match";
    }
    }
    else{
    echo "Your email adreeses do not match";
    }
    ?>
    

  8. Ok So heres what i am trying to do. I am creating a system that will have four diferent user groups each usergroup will have there own sign up page. Now the USer login information for each group will all go under one table users but the rest of the information for each group will go to a different table for each group  for example

     

    • username
    • userid
    • userpassword
    • usertype

    will all go into user table while userfirstname etc goes into table user_info for some reason i cant seem to get my insert statment to write to both at the same time can anyone tell me what im doing wrong

     

    <?php require_once('Connections/live.php'); ?>
    <?php
    $user_email = $_POST['user_email']; 
    $user_emailv = $_POST['user_emailv'];
    $user_pass = $_POST['user_passv'];
    $user_passv = $_POST['user_pass'];
    $user_first_name = $_POST['user_first_name'];
    $user_last_name = $_POST['user_last_name'];
    $user_street = $_POST['user_street_address'];
    $user_apt = $_POST['user_apartment_number'];
    $user_city = $_POST['user_city'];
    $user_state = $_POST['user_state'];
    $user_zip = $_POST['user_zip'];
    $user_phone = $_POST['user_phone'];
    $user_fax = $_POST['user_fax'];
    $user_username = $_POST['user_esername'];
    $user_type = $_POST['type'];
    ?>
    <?php
    if  ($user_email == $user_emailv){
    if ($user_pass == $user_passv){
    $live;
    mysql_select_db ($database_live);
    $query="INSERT INTO users (user_id, user_name, user_pass, user_type, Member_Since)VALUES ('NULL','".$user_username."','".$user_pass."','".$user_type."','NULL')";
    $queryb="INSERT INTO user_info (user_infoid, user_first_name, user_last_name, user_street_address, user_state, user_zip, user_phone, user_fax, user_email_address, user_city, user_apartment_number)VALUES ('NULL','".$user_first_name."','".$user_last_name."','".$user_street."','".$user_state."','".$user_zip."','".$user_phone."','".$user_fax."','".$user_email."','".$user_city."','".$user_apt."')";
    mysql_query($query) or trigger_error(mysql_error(),E_USER_ERROR);
    mysql_query($queryb) or trigger_error(mysql_error(),E_USER_ERROR);
    echo "Did it work";
    }
    else{
    echo "Your passwords do not match";
    }
    }
    else{
    echo "Your email adreeses do not match";
    }
    ?>
    
    

  9. ok right now its poping up the module name for each menu item so the module name keeps coming up over and over i only want it to sho up once hers a pic so you can see what its doing now
    [URL=http://img236.imageshack.us/my.php?image=example1nm4.jpg][IMG]http://img236.imageshack.us/img236/5189/example1nm4.th.jpg[/img][/URL]

    heres the modified vertion of your code that i adapted to get it to work like this
    [code]
    <?php require_once('../Connections/TEst.php'); ?>
    <?php
    mysql_select_db($database_TEst, $TEst);
    ?>
    <?php
        // connect to db.
        $sql = "
            SELECT
                brg_modules.Module_Name AS mname,
                brg_menu.title AS cname,
    brg_menu.icon AS cimg,
    brg_menu.url AS curl
            FROM
                brg_modules,brg_menu
            WHERE
                brg_modules.id = brg_menu.module;";

        if ($result = mysql_query($sql)) {
            if (mysql_num_rows($result)) {
                $mname = '';
                while ($row = mysql_fetch_assoc($result)) {
                    if ($row['mname'] != $mname) {
                        $mname = $row['mname'];
    $cname = $row['cname'];
    $curl = $row['curl'];
                        echo "<table><tr><td>$mname</td></tr>";
                    } 
                    echo "<tr><td><ahref='$curl'>$cname</a></td></tr><tr><td>&nbsp;</td></tr></table>";
                } 
            } 
        }  else {
          echo "Query failed ".mysql_error();
        }
    ?>[/code]
  10. How are you aproaching this is it all on one page ie you select apple from the drop down box and it populates the feilds so you can edit and update or do you have a list some place with the items where you click on the item name ie lick on apples and it brings you to a page to edit apples. Im just a bit lost here is your problem populating the drop down box or poulating the fields after you have chosen what you want to edit
  11. Ok so heres the problem and im still fairley new to php.
    Im trying to build a completley dynamic menu system for my website using two tables
    thae parent table being Modules and the child table being menu basically what i want to do
    is for evry module that is set to be a menu and on the side of the page i tell it to it creates a table  as follows
    [table]
    [tr][td]Module Name[/td][/tr]
    [tr][td]$menu here[/td][/tr]
    [tr][td][/td][/tr][/table]

    now basically I want it to take each module and create that table to where it has the module name ie. Header at
    the top of the table and all menu items that are a child to that module in the second row . then i want th single blank row just for style purpouse before it moves on to do the same thing with the next module. Im assuming the best way to do this is with an array and all though i have a basic understanding of what the array does i havent got a clue how to use it and reading the php bible to figure it out is just confusing me so im hoping some one can show me a simple example that i can work off of or if im wrong and going about this all wrong smack me around a bit and get me set strait. any help is greatley apreciated.. Tripic
×
×
  • 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.