Jump to content

denhamd2

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by denhamd2

  1. im a bit of a newbie so would it be possible ot tel me how do set that up?
  2. i'm looking not to use a database, a simple text file if possible anyone know how to go abot coding this?
  3. my problem is I want exactly 50% of my traffic to be redirected to 1 page and exactly 50% to the other. With the random redirector it isn't totally accurate, everytime i refresh sometimes it goes to the same page 2 or 3 times in a row before going to the alternate page. i was thinking if i could have a counter of some sorts, it could get the hit number for each customer and all the odd numbered hits go to 1 page and all the even numbered hits go to the other page. Do you follow?
  4. Hi, I'm trying to set up a simple A/B test using PHP. I tried just using a random script, where it goes to either page1 or page 2 randomly through the redirector page. However i notice it doesn't give a 50/50 split, ie attempt 1 it went to google, attempt 2 it went to google, attempt 3 it went to yahoo. i need for instance a counter where all the even numbers go to google and all the odd numbers go to yahoo, that would be the most accurate way i could think of without having to use a database (which I want to stay away from). therefore, is there a way i could maybe have a counter stored in a text file where it increments for every visit and all the odd numbered hits go to one page and all the even numbered hits go to another. would anyone know how to do this?
  5. Hi, I have a set up a booking form with 2 calendars for 2 houses: http://www.aholidayinspain.net/booking/index-booker.php It basically collects the dates selected, goes to a confirmation page where it just echos the dates and then on the third page it inserts it into the database tables, house 1's table is called "bookings" and house 2's table is called "house2bookings". However, when you try to book a date for 1 of the houses it actually inserts the date into both of the tables because it just inserts all the session variables we have collected into both. Is there any way I can separate the house 2 bookings from the house 1 ones and then insert them into the separate tables? Bear in mind that all house 2 variable names start with "house2" on the form on page 1. Here is my PHP code: <?php // Get all the session variables stored in the previous page: $un_neces_varible = array('contactsubmit'); foreach($_SESSION['DATA'] as $v) { if(!in_array($key,$un_neces_varible)){ mysql_query("INSERT INTO bookings (date, theuserid) VALUES('$v','$recentuser') ") or die(mysql_error()); } } ?> <?php // Get all the session variables stored in the previous page: $un_neces_varible = array('contactsubmit'); foreach($_SESSION['DATA'] as $v) { if(!in_array($key,$un_neces_varible)){ mysql_query("INSERT INTO house2bookings (house2date, house2theuserid) VALUES('$v','$recentuser') ") or die(mysql_error()); } } ?>
  6. that doesn't seem to work any ideas?
  7. Hi, I have HTML stored in a variable $html Buried in there is a link with the anchor text as New York therefore in the $html variable somewhere is <a href="somelink">New York</a> Is there any way using pattern matching that would let me get the link used to link to the text New York? There is a few links with the text New York but I only want to get the link from the first one. Been agonising over this for ages so if anyone could help it would really save my life. Thanks in advance
  8. Hi guys, I've not done a shopping cart before so I'm not sure what the story is with credit cards. I've collected all the user's personal info and products purchased as variables, do I just do the same with the credit card info (as $_POST variables to keep them hidden)? Is this sufficient? I'm not planning on emailing the info to the store owner just letting them login to an admin area to collect it. Is this secure enough or what should I do differently? What's the deal with security certificates? What do they actually do and are they expensive? Any help you could provide on this would be great. Thanks in advance
  9. bit of a problem, its taking 25042007 and formatting it as Sunday, January 4th 2009... any ideas as to why this could be? EDIT: sorted this now - i had to change month, day, year to day, month, year [european style date formatting]
  10. its stored as a string. going on clown[NOR]'s post above how would I then format the date as Tuesday, January 1st 2007?
  11. hi, I have the date in the format 01012007 stored in the variable $mydate is there any way I can echo this in the format Monday, 1st January 2007? I was told using mkdir get timestamp for this 01012007 Then use date function to change date format... I'm a bit of a newbie so would anyone know how to do this? Thanks in advance
  12. thanks mate finally quick question, I have the date in the format 01012007 stored in the variable $mydate is there any way I can echo this in the format Monday, 1st January 2007?
  13. please see my updated post above. as you can see its echoing out all the dates in the month as $mydate, but basically I'm looking for it not to echo if that date exists as a row "date" in the table "bookings"
  14. doesn't seem to be working? here's my existing code: //sets the first day of the month to 1 $day_num = 1; //count up the days, untill we've done all of them in the month while ( $day_num <= $days_in_month ) { $myday_num = str_pad($day_num, 2, "0", STR_PAD_LEFT); $mydate = $myday_num.$month.$year; echo $mydate; $day_num++; $day_count++; //Make sure we start a new row every week if ($day_count > 7) { echo "</tr><tr>"; $day_count = 1; } } as you can see, $mydate is in a while loop, maybe putting your code in the while loop is what's knocking it out?
  15. thanks, sounds like a good way of doing it. just wondering how I might be able to put the dates in the array? basically I know I want to select all the rows from the "date" field in the "bookings" table and insert them into the array but I haven't got a clue as for how I'd code this. Any help would be much appreciated...
  16. Hi, I have a variable $mydate which loops for all the days of a month (in a while loop), so therefore for April its: 01042007 02042007 03042007, etc... I also have a MySQL table "bookings", which contains the field "date". This field is populated with rows of dates, with the same format as those in $mydate (eg. 01042007) Is there any way to not echo $mydate if it exists as one of the entries in the "date" field in the database? Many thanks in advance
  17. this is the code I'm trying to use, but it just prints out all userid's, i just want it to print out the most recent one. Any ideas on how to change this code to make it work? $result = mysql_query("SELECT * FROM users ORDER BY userid ASC"); while($row = mysql_fetch_array($result)) { echo $row['userid']; }
  18. Hi, I have a table users in my MySQL database I'm looking to select the most recently entered user record (they are indexed by the userid auto incrementing field) then I would like to echo this userid any ideas on the PHP/MySQL code for this? Many thanks in advance
  19. Hi, In my first page I passed variables to my second page and I stored them as session variables of the same name in my 2nd page. However in my 3rd page I want to echo all the session variables I stored in the 2nd page. Any idea on how to do this? Here is my code in the 2nd page for storing the session variables... <?php // This will set all your get varibles to session with same name in get $un_nec_varible = array('monthsubmit','anyother'); if(isset($_GET)){ foreach($_GET as $key => $value){ if(!in_array($key,$un_nec_varible)){ $_SESSION["DATA"][$key] = $value; echo "<li>".$value."</li>"; } } } ?>
  20. something strange happens, it just echos the word Array any ideas?
  21. getting the error msg for each of the variables: Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/aholiday/public_html/calendar/index2.php on line 9
  22. sorry mate just edited my above message, any ideas on that?
×
×
  • 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.