Jump to content

mrheff

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mrheff's Achievements

Member

Member (2/5)

0

Reputation

  1. i wish, they return the homepage url, not even an ok page, so they go to the root.
  2. hi guys, i got a wee problem, i made a wee shop for my bro, and were nearly done managed to scrape by with some ok coding to a point im fairly happy. now were using a real simple payment system called Ideal its a dutch thing, anyway i have a simple checkout created that works through setting up saome variables in a form on my site and sending the user to that Ideal system (on the press of a buton named pay with ideal), that system then takes over taking the user to their bank site to review and confirm payment.. and then sends me a mail phew glad i got all that out.... what i need to do is intercept the form somehow to empty the cart. any ideas lads and ladies? i just dont want the user to have to empty their arrival on return to the site., like ive refilled their cart so i figure i need to switch the cart to an order save that in me db and empty all rows containing their cartid from the carts/basket db just canney figure it oot cap'n. any ideas would be greatly accepted. ta.
  3. so for those of you who might like to know the way i bodged my way through this problem here goes this part goes in the page you want to see if theres a basket set up or not <? if(isset($_COOKIE['lastVisit'])) { echo "".$basketid.""; } else { print "<meta http-equiv=\"refresh\" content=\"0;URL=cookje.php\">"; echo "one moment please, one of our slaves is just fetching you a basket";// displays as the page stalls to refresh new url } ?> and heres the cookje.php that does the work and wont let me use it the way iwant.. i broke up my orignal so it was only the if clause left in cookje.php, and put the actual else if clause (which is above) in the index as explained earlier.. <? if(isset($_COOKIE['lastVisit'])) { echo "".$basketid.""; } else { print "<meta http-equiv=\"refresh\" content=\"0;URL=cookje.php\">"; echo "one moment please, one of our slaves is just fetching you a basket";// displays as the page stalls to refresh new url } ?> sorry abou the spacing i unashamedly ripped that part and havent formatted it, sorry. so that was rubbish workaround,,, at least it works i suppose, but its still really bugging me why i couldnt just include it, this is my last deperate please, give a man a hand guys, we all know this is a bodge, ad no one wants to be a cowboy, yeeehaaaw, all yours quick-draw-cincinatti-heff
  4. my workaround seems to work ok, but casues a screen flikker on firstload,which is a tad ugly and im sure any gui expert would say "err the user would think something is going wrong ere", alas it will surfice, If any one <em>does</em> have any ideas i'd really appreciate to hear your suggestions i might try to set the cookie earlier on a through page so as the screen does so much flikker as stall as it loads this might look a touch better, Cheers for your time and please just hit me up with any ideas.
  5. maybe i should send it to cookie.php if none is set, then do one of the header location() type deals back to the page once the cookie was set? whatcha wreckon?
  6. ok i ammended that to it, with no ill effects however it still only works whe i acces the file cookie.php but refuses when its included, wierd huh? anybody think there is another way to include thatlets this work??
  7. no joy with that im afraid, thanks though man. here is my full code, the idea is scan for cookie, if no cookie then give variable (ip + key) to make basketid this code works fine when i use it as a page, when i include it like this include (cookie.php); it can pick the cookie up when it is set however it refuses to set it if there is not one preasent, any ideas guys? <?php if(isset($_COOKIE['lastVisit'])) { $last = $_COOKIE['lastVisit']; echo "Welcome back! <br> You last visited on ". $last; echo "".$basketid.""; } else { $Month = 2592000 + time(); //this adds 30 days to the current time $ip = $_SERVER['REMOTE_ADDR']; //get correct ip setcookie(lastVisit, date("F jS - g:i a"), $Month); function createRandomPassword() { $chars = "abcdefghijkmnopqrstuvwxyz023456789"; srand((double)microtime()*1000000); $i = 0; $pass = '' ; while ($i <= 7) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } $key = createRandomPassword(); $ipkey = $ip.$key; setcookie(basketid,"$ipkey" , $Month); echo "hmm weve set up your basket cookie"; } ?> thank ye kindly for your time.
  8. i will give that a bash mate thanks that was reet quick leek.
  9. hi guys im a relative novice and have a had good rummage through previous posts befor begging ahem asking for help, the problem lies herein, im making a small cart system for my bros shop i wrote a review system for it thats okies and got my product catalog all in place and have now moved on to the frontend fun, i figure a cart is pretty simple and plotted away to go ahead relying a table for each user, i didnt want to have them make an account befor buying anything so wanted to generate an id for the cart/basket table entry using their ip and random string of alpha numerics (ensuring the id would not be picked up by someone elses) place this in a cookie so i didnt have to use massive urls etc,i also wanted the site to remember the cookie for a week or so, incase they came back at any point. so i got about making the cookie setting in a statement a lil like this (artists impression) if (isset $_cookie[basketid]) { $yourbasketid = $_cookie[basketid]); } else { echo "ohw your a new user lets create a basket fo you bitch"; setcookie(basketid,$ip.$randomcode,time (bloody ages)) } i got my version of this going ok, since it was self reliant i could test it standalone... i did much to my pleasure hazzaaahhh it was picking me giving my id made by the ip and the rand string, but not giving it to me if if refreshed, then it would show me the basketid i was assigned, untill resetting my cookies, brilliant i thought..... .... but no. when i included the file to my header ready to develop my basket/cart system it would only pick up the variables but not assign them... ... sucky... i could go to the standalone file set the cookies and then pick them up from the page which i included from but never have them be set by the page i needed to the job. I checked all the read a writes, all 777 for testing,, should be fine i thought, my next thought was ok maybe it cant be included so inserted the code into the page from which it was called, no avail so next step is ask the guys here, any thoughts would be much appreciated. hmm my header file is also included, ill try it my index.php and report back // <-- just trried no joy. thanks for your time, heff.
  10. thankyou. this is just what i needed, i see exactly what you mean, in the end i used or - print thankyou for clarifiying what my options where. ill take your advice and do that bit of reading.
  11. So whats the simploest way i could do this, what is the simplest way for me to see if the entry exists then i could do a if (entry is in datbase) headr:duplicate.html else ( all the rest of my script ) do you think that would be viable? I use a simple form that passes on this info ip email and date the table has also got an "in" field this is just used by the confirmation process.
  12. Really odd, it just seems to bypass that part..... and now when i enter a duplicate, it still goes to ok.htm instead error.... odd.
  13. Thankyou, I see your reasoning guys.... my method is rather a botch job.... i think ill still roll with it for now, just because i am comfortable with the current code should i come back to editing. cheers again!
  14. you could get me to do it... im cheap. software is easy to get for free.... torrents, p2p, irc newngroups all those other ways. but you mean like shareware?... try donwload.com and places like that, im sure there are free trials of pro stuff. just pick a pro title and google it.
  15. thanks for a great reply, however ive made my whole site and this is the last little bit Do you know of a way i can just add another line of code stating a redirect if i get back the mysql_error? $result=mysql_query($query) or die(("Error in query:".mysql_error);()); could i do simple if ($result=error) then (go to page)? thanks again for your reply if i have no luck going this way round then ive got another way round, thanks!
×
×
  • 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.