Welcome Guest, Not a member yet? Register   Sign In
sessions not enabled on go daddy server
#11

[eluser]xoRiZ[/eluser]
[quote author="labao" date="1270861025"]My config.php is fine.

no I am not getting any errors at all actually which makes this rather annoying. $vehicle is not null and is being posted via a form then is sent to a controller which will input the var and then I will take that var out on the next page

Quote:$this->session->userdata('session_id')
does in fact give me a variable...[/quote]

The only other thing I can recommend is comparing phpinfo() from your GoDaddy account and your local machine, find the differences and see if any are applicable.


Also; I just used a my GoDaddy account to test the session class, the following code worked fine:

Code:
# controllers/welcome.php
<?php

class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $this->session->set_userdata('test', 'test string');
        $this->load->view('welcome_message');
    }
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */

# views/welcome_message.php

<html>
<head>
<title>Welcome to CodeIgniter</title>

<style type="text/css">

body {
background-color: #fff;
margin: 40px;
font-family: Lucida Grande, Verdana, Sans-serif;
font-size: 14px;
color: #4F5155;
}

a {
color: #003399;
background-color: transparent;
font-weight: normal;
}

h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 16px;
font-weight: bold;
margin: 24px 0 2px 0;
padding: 5px 0 6px 0;
}

code {
font-family: Monaco, Verdana, Sans-serif;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}

</style>
</head>
<body>

<h1>Welcome to CodeIgniter!</h1>
<p>&lt;?php echo $this->session->userdata('test'); ?&gt;</p>
<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>

<p>If you would like to edit this page you'll find it located at:</p>
<code>system/application/views/welcome_message.php</code>

<p>The corresponding controller for this page is found at:</p>
<code>system/application/controllers/welcome.php</code>

<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>


<p><br />Page rendered in {elapsed_time} seconds</p>

&lt;/body&gt;
&lt;/html&gt;


http://www.collectionspy.net
#12

[eluser]labao[/eluser]
I can't seem to find phpinfo() on my local machine or on my server....
#13

[eluser]xoRiZ[/eluser]
[quote author="labao" date="1270863696"]I can't seem to find phpinfo() on my local machine or on my server....[/quote]

Try this:
http://php.net/phpinfo

Code:
&lt;?php phpinfo(); ?&gt;

Stick that in a file, load it in your browser and it will give you information about the PHP configuration and modules.

I find it more likely that the issue revolves around your input and variable management. I would run some debug tests to ensure the variable is being passed through as you expect.

Try putting this after your $vehicle=$this->input->post('vehicle');
Code:
&lt;?php
echo '<pre>';
var_dump($vehicle);
echo '</pre>';
?&gt;

Use that same snippet right before you set your session data also. Make sure they both match the values that you expect.
#14

[eluser]labao[/eluser]
[quote author="labao" date="1270863696"]I can't seem to find phpinfo() on my local machine or on my server....[/quote]

lol oops my mistake sorry guys, I've been at this all night and need sleep
#15

[eluser]labao[/eluser]
ok guys, out of desperation Im just going to show all the code I have. I know some of it might be broken and the logic might seem moronic at best but if you could just take a look and see if anything is really messed up.

my first page is a view page which looks like:

Code:
&lt;?php
phpinfo();

echo '[removed][removed]';
echo '<div class="rentalbacking"><div class="contentformat"><br />Step one: Pick your location<br /><br />

&lt;body&gt;
&lt;FORM name="drop_list" action="'. base_url().'content/nextpage/nextstep" method="POST" &gt;
<p>Pick up Day<br />
<SELECT id="monthpick" name="monthpick">

</SELECT>
<SELECT id="daypick" name="daypick">

</SELECT>


<br /><br />

<p>Drop off Day<br />
<SELECT id="monthdrop" name="monthdrop">

</SELECT>
<SELECT id="daydrop" name="daydrop">

</SELECT><br />
<br />
<br />

';
$query="SELECT * FROM vehicle WHERE avail=''";

/* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */

$result = mysql_query ($query);

echo "<select name='vehicle' value=''>vehicle</option>";
// printing the list box select command

while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
$vn=$nt['vehicle_name'];
$vd=$nt['vehicle_description'];
$vp=$nt['price'];
$v=$vn. ' - ' .$vd .'|' .$vp;

//$arr=array(
//"vn"=> $vn,
//"vd"=> $vd,
//"vp"=> $vp);

echo "<option value='$v'>$vn</option>";

/* Option values are added by looping through the array */

}

echo "</select>";// Closing of list box
$veh=$result[3];

echo"&lt;input type='hidden' name='description' value='$veh' /&gt;";

$photoquery="SELECT photo,photo_thumb,descrip FROM photo3";
$result = mysql_query ($photoquery) or die (mysql_error());
while($row = mysql_fetch_array($result)){

}
echo'<br /><br /><br />
<button type="submit">next step</button>
&lt;/FORM&gt;
</div>';
echo' <div class="ad1">More info</div>';
echo' <div class="ad2"><a href="'. base_url().'content/offer/offerone">More info</div>';



echo '</div>';
echo' <div class="ad3"></div>';

?&gt;

then the form is submitted into the controller:

Code:
function nextpage()
        {
        $pageID = $this->uri->segment(3);
    $monthpick =$this->input->post('monthpick');
    $monthdrop =$this->input->post('monthdrop');
    $daypick =$this->input->post('daypick');
    $daydrop =$this->input->post('daydrop');
    $vehicle=$this->input->post('vehicle');
    
    $vn = substr($vehicle, 0, strpos($vehicle, '|'));
    
    
    $anything = strlen($vn)+1;
    
    $vd=substr($vehicle, $anything, strpos($vehicle, '|'));
    $vd_len=strlen($vd);
    
    $offset=1;
    $vp = substr($vehicle, strpos($vehicle, '|', $offset)+1, strlen($vehicle));
    $vehicle=$vn;
    $vehicle_p=$vd;
    
    $vehicle


        $this->session->set_userdata('monthpick', $monthpick);
        $this->session->set_userdata('monthdrop', $monthdrop);
        $this->session->set_userdata('daypick', $daypick);
        $this->session->set_userdata('daydrop', $daydrop);
        $this->session->set_userdata('vehicle', $vehicle);
         $this->session->set_userdata('vehicle_p', $vehicle_p);

          $data = array(
         'pageID' => $pageID
         );    
        
        $this->load->view('template',$data);
    }

see next post for more code. also thanks for all the help guys really appreciate it... My professor couldn't even help me.
#16

[eluser]labao[/eluser]
After the data is pushed through the controller it's pushed out here

Quote:&lt;?php
echo '[removed][removed]';
echo '<div class="rentalbacking"><div class="contentformat"><br />Step two: confirm price<br /><br />';
echo '&lt;FORM name="drop_list" action="'. base_url().'master/page/myform_view" method="POST" &gt;';
$query="SELECT vehicle_name,id,price,vehicle_description FROM vehicle";

$month=$this->session->userdata('monthpick');

$month2=$this->session->userdata('monthdrop');

$car=$this->session->userdata('vehicle');

$descrip=$this->session->userdata('vehicle_p');


$day=$this->session->userdata('daypick');

$day2=$this->session->userdata('daydrop');


$date_start = "2010-$month-$day";
$date_end = "2010-$month2-$day2";
$time = $day2 - $day;

if($time == 0){
echo'<p>There was an error, make sure you are renting for atleast one full day</p>';

}else{

$querydate=mysql_query("SELECT * FROM rentaride.order WHERE vehicle_id = '$car' ")
or die (mysql_error());
$mysql_thing = mysql_fetch_array($querydate);

if ($mysql_thing['day_pick_order'] >= $date_start && $mysql_thing['day_drop_order'] <= $date_end){

echo "This vehicle has already been book on that day...";

}else{





echo $month;
echo $car;
echo' <br /> <br />';
echo $month2;
echo $day2-$day;
echo $descrip;

echo'<p>your price is: $';

echo $descrip * ($day2 - $day);
echo' </p>';




$photoquery="SELECT photo,photo_thumb,descrip FROM photo3 WHERE descrip='$car'";
$result = mysql_query ($photoquery) or die (mysql_error());
while($row = mysql_fetch_array($result)){
echo '<img src="http://thedesignslave.com/images/' . $row['photo_thumb'] . '" class="noborder" />';

}

echo'</p><button type="submit">next step</button>&lt;/FORM&gt;';
}
}
echo'</div>';
echo '</div>';
?&gt;

and it does get to this point... the data seems to be popping out remotely up until this page...

after the user has agreed to the price it then goes to master/page controller then into this view:
#17

[eluser]labao[/eluser]
Code:
&lt;?php
//$car=$this->session->userdata('vehicle');

echo '&lt;FORM name="drop_list" action="'. base_url().'myform/frm/myform_view" method="POST" &gt;';


?&gt;
<h3>Please complete the form below. Fields marked with an asterisk are required</h3>
<p>

        <label for="first_name">First Name <span class="required">*</span></label>
        &lt;?php echo form_error('first_name'); ?&gt;
        <br />&lt;input id="first_name" type="text" name="first_name" value="&lt;?php echo set_value('first_name'); ?&gt;"  /&gt;&lt;br />



        <label for="last_nane">Last Name</label>
        &lt;?php echo form_error('last_name'); ?&gt;
        <br />&lt;input id="last_na,e" type="text" name="last_name" value="&lt;?php echo set_value('last_name'); ?&gt;"  /&gt;&lt;br />



        <label for="shipping_street_address">Street Address <span class="required">*</span></label>
        &lt;?php echo form_error('shipping_street_address'); ?&gt;
        <br />&lt;input id="shipping_street_address" type="text" name="shipping_street_address" value="&lt;?php echo set_value('shipping_street_address'); ?&gt;"  /&gt;&lt;br />



        <label for="city">City <span class="required">*</span></label>
        &lt;?php echo form_error('city'); ?&gt;
        <br />&lt;input id="city" type="text" name="city" value="&lt;?php echo set_value('city'); ?&gt;"  /&gt;&lt;br />




        <label for="special_insructions">Special Insructions</label>
    &lt;?php echo form_error('special_insructions'); ?&gt;
    <br />
                            
    &lt;?php echo form_textarea( array( 'name' => 'special_insructions', 'rows' => '5', 'cols' => '40', 'value' => set_value('special_insructions') ) )?&gt;<br />


        <label for="telephone">Telephone <span class="required">*</span></label>
        &lt;?php echo form_error('telephone'); ?&gt;
        <br />&lt;input id="telephone" type="text" name="telephone" value="&lt;?php echo set_value('telephone'); ?&gt;"  /&gt;&lt;br />



        <label for="alternate_telephone">Alternate telephone</label>
        &lt;?php echo form_error('alternate_telephone'); ?&gt;
        <br />&lt;input id="alternate_telephone" type="text" name="alternate_telephone" value="&lt;?php echo set_value('alternate_telephone'); ?&gt;"  /&gt;&lt;br />



        <label for="email">Email <span class="required">*</span></label>
        &lt;?php echo form_error('email'); ?&gt;
        <br />&lt;input id="email" type="text" name="email" value="&lt;?php echo set_value('email'); ?&gt;"  /&gt;&lt;br />


        <label for="email_confirm">Email Confirm <span class="required">*</span></label>
        &lt;?php echo form_error('email_confirm'); ?&gt;
        <br />&lt;input id="email_confirm" type="text" name="email_confirm" value="&lt;?php echo set_value('email_confirm'); ?&gt;"  /&gt;&lt;br />

        &lt;?php echo' <button type="submit">next step</button>
&lt;/FORM&gt;'; ?&gt;<br />


&lt;?php echo form_close(); ?&gt;
#18

[eluser]labao[/eluser]
which then gets dumped into this controller:

Quote:&lt;?php



class Myform extends Controller {

function Myform()
{
parent::Controller();
$this->load->library('form_validation');
$this->load->database();
$this->load->helper('form');
$this->load->helper('url');
$this->load->model('myform_model');
}
function frm()
{


$data = array();
$this->form_validation->set_rules('first_name','First Name','required|trim');
$this->form_validation->set_rules('last_name','Last Name','required|trim');
$this->form_validation->set_rules('shipping_street_address','Shipping Street Address','required|trim');
$this->form_validation->set_rules('city','City','required|trim');
$this->form_validation->set_rules('special_insructions','Special Insructions','');
$this->form_validation->set_rules('telephone','Telephone','required|trim|min_length[10]');
$this->form_validation->set_rules('alternate_telephone','Alternate telephone','');
$this->form_validation->set_rules('email','Email','required|trim|valid_email|matches[email_confirm]');
$this->form_validation->set_rules('email_confirm','Email Confirm','required|trim|valid_email');
$this->form_validation->set_error_delimiters('<br /><span class="error">', '</span>');

if ($this->form_validation->run() == FALSE) // validation hasn'\t been passed



{




$pageID = $this->uri->segment(3);
$data = array(
'pageID' => $pageID
);
$this->load->view('template',$data);
}
else // passed validation proceed to post success logic
{
// build array for the model
$session_id = $this->session->userdata('session_id');
$form_data = array(
'first_name' => strtoupper(set_value('first_name')),
'last_name' => strtoupper(set_value('last_name')),
'address' => strtoupper(set_value('shipping_street_address')),
'city' => strtoupper(set_value('city')),
'message' => set_value('special_insructions'),
'tel' => set_value('telephone'),
'alt_tel' => set_value('alternate_telephone'),
'email' => set_value('email'),
'email_confirm' => set_value('email_confirm'),
'sessionid' => $session_id,
'car_id' => set_value('vehicle')
);


// run insert model to write data to db

if ($this->myform_model->save_form($form_data) == TRUE)
{
redirect('myform/success'); // or whatever logic needs to occur
}
else
{
echo 'An error occurred saving your information. Please try again later';
// Or whatever error handling is necessary
}
}
}
function success()
{
redirect('master/page/verify');
}
}
?&gt;

NOTE that the user info DOES get dumped into the database because it's not using the userdata

from there, the controller needs to go to this view:
#19

[eluser]labao[/eluser]
Code:
&lt;?php


echo '<h2>confirm order...</h2>';
echo '<h3>Before finalizing your order please read and acknowledge the following terms and conditions:</h3>';


  
echo '<p>I wish to abandon my purchase</p>';
echo '<a href="' . base_url() . 'content/cancel/">';
echo '<img src="' .  base_url(). 'images/cancel.png" class="noborder" /></a><br />';
echo '<p>I wish to continue with my purchase</p>';
echo '<a href="' . base_url() . 'content/order_insert/success/">';
echo '<img src="' .  base_url(). 'credit_cards.png" class="noborder" /></a><br />';


$session_id = $this->session->userdata('session_id');


$infoquery="SELECT * FROM myform WHERE sessionid='$session_id'";

    $mysql_stuff = mysql_query($infoquery);
$row=mysql_fetch_row($mysql_stuff);
$firstname= stripslashes($row[1]);
$lastname= stripslashes($row[2]);
$address= stripslashes($row[3]);
$phone= stripslashes($row[6]);
$email= stripslashes($row[8]);

  
  echo'First name: ';
  echo $firstname;
  echo '<br />';
  echo'Last name: ';
  echo $lastname;
  echo '<br />';
   echo'Adress: ';
  echo $address;
  echo '<br />';
  echo'Phone#: ';
  echo $phone;
  echo '<br />';
  echo'email: ';
  echo $email;
  echo '<br />';
  
  
  $month=$this->session->userdata('monthpick');
  echo $month;
  $month2=$this->session->userdata('monthdrop');
   $car=$this->session->userdata('vehicle');
   echo $car;
  echo' <br /> <br />';
  $descrip=$this->session->userdata('vehicle_p');
  
  echo $month2;
  $day=$this->session->userdata('daypick');
  
  $day2=$this->session->userdata('daydrop');
  echo $day2-$day;
  echo $descrip;
  
echo'<p>your price is: $';

echo' </p>';



?&gt;

the information regarding the order should display here but because userdata is being lost, it displays nothing and doesn't throw an error.
#20

[eluser]labao[/eluser]
and then from there it goes into the last controller which inserts the order into the table

Code:
function order_insert()
    {
    $subject = "Rentaride Order Confirmed";
    
        $pageID = $this->uri->segment(3);
    
     $month=$this->session->userdata('monthpick');
    
     $car=$this->session->userdata('vehicle');
  
     $day=$this->session->userdata('daypick');
  
   $day2=$this->session->userdata('daydrop');
  
   $session_id = $this->session->userdata('session_id');
   $price=$this->session->userdata('vehicle_p');
  
   $cost = ($day2-$day)*$price;
  
   $date_start = "2010-$month-$day";
    $date_end = "2010-$month-$day2";
    
    

    
    
    $query="INSERT INTO rentaride.order VALUES (NULL,'$session_id','$car','$cost','$month','$date_start','$date_end') ";
    
    $mysql_stuff = mysql_query($query);
    
    $mailquery="SELECT * FROM rentaride.myform WHERE session_id = '$session_id'";

    $mysql_stuff2 = mysql_query($mailquery);
    $email = $mailquery['email'];
    $message="sup dude";
    $from="lorne";
    $headers="from: $from";
    
    mail($email,$subject,$message,$from,$headers);
    
    
    

    
    
     $data = array(
         'pageID' => $pageID
         );    
        
        $this->load->view('template',$data);
    }

the code is still working locally and I have tried everything that everyone has previously suggested... my config file is just fine, all the database tables and columns are there.

Thanks a ton to everyone here who has tried...




Theme © iAndrew 2016 - Forum software by © MyBB