jakebur01
Members-
Posts
885 -
Joined
-
Last visited
Everything posted by jakebur01
-
I tried session_write_close() and it didn't work, I still had session id's in all my links below session_write_close() . I also tried session_destroy() and all it did was wipe out everything that I had in my cart. There has to be a function out there that will turn the session off for part of a page without destroying the session or loosing anything.
-
I have been looking for something that will allow me to use a session only for part of a couple of pages. Example: I use session_start() at the top of all my pages, but on the categories page and home page I only want the session_start() to apply to the cart quanity and amount and not apply to all the rest of the links on the homepage. In other words, is their any way to turn off 'so to speak' the session after do_html_header() ? I don't want to destroy the session, I just want the session_start() to apply to only part of the page. session_start(); $catid = $_GET['catid']; $name = get_category_name($catid); do_html_header($name); $book_array = get_books($catid); display_books($book_array);
-
no problem.. Thank you..
-
I am getting 15 percent of the item and adding it back to the item to get the Retail Price. But when I hit an item around 1,000 it acts crazy and displays something like this: # Walk-In Store Price: 2.30 # Your Internet Price: $2,799.00 It works fine when under 1,000 dollars. Here is the code: $phyprice = number_format($book['price'], 2); $$phyprice =str_replace(',','',$phyprice); $phypriceone = $phyprice * .15; $phypricetwo = $phypriceone + $phyprice; $phypricetwo = number_format($phypricetwo, 2); echo '<td><ul>'; echo '<li><b>Type:</b> '; echo $book['author']; echo '</li><li><b>Item:</b> '; echo $book['isbn']; echo '</li><li><b>Description:</b> '; echo $book['description']; echo '</li><li><strike>Walk-In Store Price:</strike> '; echo "<strike> $phypricetwo</strike>"; echo '</li><li><b>Your Internet Price:</b> '; $samicans = number_format($book['price'], 2); echo '$'; echo "<b>$samicans</b>";
-
My host won't change that cause he says my cart won't work after that. But, none of his carts display the sessionid in the url. It just doesn't add up.
-
<?php include ('book_sc_fns.php'); // The shopping cart needs sessions, so start one session_start(); do_html_header('Welcome'); // echo '<font color = #FF0000> <p><b>Select a category below or a brand from above.</b></p></font>'; ?> <?php echo "<TABLE BORDER=1 bgcolor=#FFFFFF bordercolor=RED bordercolorlight=#33CCFF bordercolordark=RED CELLSPACING=1 ALIGN=left>"; echo "<tr><td>"; echo "<b>Please select a category below</b>"; // get categories out of database $cat_array = get_categories(); // display as links to cat pages display_categories($cat_array); echo "</tr></td>"; echo "</table>"; ?> <?php // if logged in as admin, show add, delete, edit cat links if(isset($_SESSION['admin_user'])) { display_button('admin.php', 'admin-menu', 'Admin Menu'); } do_html_footer(); ?>
-
hey I have problems with my php session id popping up in the url on mac computers and on pc's after you clean out you cache. And on whois.sc .com the session id's appear in the address bar as well. The other guys who have shopping carts that are using sessions that are on the same server do not have this problem. Does anyone know of what I am doing that could be causing this? All am doing is using sessionstart() and $_SESSION[''] .
-
I was having similar issues when trying to do a 10 percent discount on all of my items. I believe the comma was the problem in that situation as well.
-
That was it. It works really well now. Thank you all.
-
it's a shopping cart. I think your right though. I will see if i can't find something that will remove unwanted charactors.
-
hey my little shipping calculation has been working fine recently. But, I noticed that when you carts total is 3,534.99 it returns 5.99 for some odd reason. Could someone help me perfect this? function calculate_shipping_cost() { // return 20.00; $t_number = number_format($_SESSION['total_price'],2); if ($t_number >= 0.01 and $t_number <= 14.99) { return 5.99; } else if ($t_number >= 15.00 and $t_number <= 29.99) { return 8.99; } else if ($t_number >= 30.00 and $t_number <= 49.99) { return 10.99; } else if ($t_number >= 50.00 and $t_number <= 74.99) { return 12.99; } else if ($t_number >= 75.00 and $t_number <= 99.99) { return 14.99; } else if ($t_number >= 100.00 and $t_number <= 149.99) { return 16.99; } else if ($t_number >= 150.00 and $t_number <= 199.99) { return 18.99; } else if ($t_number >= 200.00 and $t_number <= 299.99) { return 21.99; } else if ($t_number >= 300.00 and $t_number <= 5000.00) { return 28.99; } else { return 10.00; } }
-
I will check it out. Thank you.
-
will i have to change anything in my sites code like[setcookie()] or anything like that. or will sessionstart() automatically store the session on the users computer for me?
-
Will this affect the functioning of my site in any way? Will I just include that htaaccess file on all of my pages or what?
-
hey, sometimes the phpsession id pops up after the url occasionally. It comes and goes, especially after you wipe out you cache. Is there any way to prevent this from happening? <?php include ('book_sc_fns.php'); // The shopping cart needs sessions, so start one session_start(); do_html_header('Welcome to !'); // echo '<font color = #FF0000> <p><b>Select a category below or a brand from above.</b></p></font>'; ?> <?php echo "<TABLE BORDER=1 bgcolor=#FFFFFF bordercolor=RED bordercolorlight=#33CCFF bordercolordark=RED CELLSPACING=1 ALIGN=left>"; echo "<tr><td>"; echo "<b>Please select a category below</b>"; // get categories out of database $cat_array = get_categories(); // display as links to cat pages display_categories($cat_array); echo "</tr></td>"; echo "</table>"; ?> <?php // if logged in as admin, show add, delete, edit cat links if(isset($_SESSION['admin_user'])) { display_button('admin.php', 'admin-menu', 'Admin Menu'); } do_html_footer(); ?>
-
session_start() ruining search engine indexing
jakebur01 replied to jakebur01's topic in PHP Coding Help
Well, What would be the best thing for me to do to prevent search engines from try to index hyperlinks with sessions attached to them? -
session_start() ruining search engine indexing
jakebur01 replied to jakebur01's topic in PHP Coding Help
My question is: Should I switch over to using only cookies? -
hey guys. I need some help. Google is trying to index my pages with session id's attached to them. Ex. = show_cat.php?catid=P70&PHPSESSID=aeg3klbcaeoirjerfodfifs And I don't know if this is right but I put these to lines in my robots.txt but it still didn't work. Disallow: /*?PHPSESSID= Disallow: /*?*PHPSESSID= I am using session_start(); at the beginning of all my pages. What do I need to do? I will be toast if I don't change something. `Jake
-
what if they are in the same database and I just have the tables named differently? The table I screwed up is "books" and the backup table is "item". I deleted all the columns from "item" except the "isbn" column and the "catid" column. Which is the part number and category code. I am wanting to take the catid from table "item" and put it in table "books" where the "isbn" matches up.
-
hey, I was doing an update and accidentally gave all my products categories a 0 value. So I want to take the category code "catid" from my old table and update it into my new table where it matches the product number. How could I do this?
-
oh man it worked! Thank you.
-
PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
-
ha.. I couldn't get that to work either. I even tried it like this: <?php $db = mysql_connect("", "", ""); mysql_select_db("", $db); $result = mysql_query("SELECT * FROM books WHERE catid <> TBP", $db); while($myrow = mysql_fetch_array($result)) { $catid = $myrow['catid']; $title = $myrow['isbn'].' '.$myrow['description'].' '.$myrow['title'].' '.$myrow['author']; $url = "show_cat.php?catid=$catid"; echo "<small"; ?> <a href="<?php echo $url; ?>"><?php echo $title; ?></a><br /> <?php echo"</small>"; echo "<br />"; } I don't want any of the rows where TBP is catid. Basically... I've tried Where catid <> and i tried where catid != ... Any suggestions?
-
hey when I add the "WHERE catid != TBP " in I get this error: PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in heres the code: $result=mysqli_query($db, "SELECT isbn, description, catid, title, author ". "FROM books ". "WHERE catid != TBP ". "order by isbn asc ". "limit $offset,$limit" ); any ideas??
-
this is whats confusing me. I am having trouble making each row active. The table pulls up no problem. echo "<a href=\"show_cat.php?catid=".$myrow['catid']."\">"; here is more of the code: echo "<TABLE align=center>"; while ($myrow=mysqli_fetch_array($result)) { echo"<tr>"; echo "<a href=\"show_cat.php?catid=".$myrow[catid]."\">"; echo"<TD ALIGN=center><small>"; echo $myrow["isbn"]; echo"</small></td><TD ALIGN=center><small>"; echo $myrow["catid"]; echo"</small></td><TD ALIGN=center><small>"; echo $myrow["description"]; echo"</small></td><TD ALIGN=center><small>"; echo $myrow["title"]; echo"</small></td><TD ALIGN=center><small>"; echo $myrow["author"]; echo"</small></td>"; echo"</a>"; echo"</tr>"; } echo "</table>";