Jump to content

Doublea

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Doublea's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi guys, I think I may be losing my marbles over this form I've put together. I'm trying to get my code to post the following to a database but my MySQL and PHP isn't that good, so wondering if any one could possibly suggest what I could do? Here is my code: <?php // we check if everything is filled in if(empty($_POST['fname']) || empty($_POST['lname']) || empty($_POST['email'])) { die(msg(0,"All the fields are required")); } // is the sex selected? if(!(int)$_POST['sex-select']) { die(msg(0,"You have to select your sex")); } // is the birthday selected? if(!(int)$_POST['day'] || !(int)$_POST['month'] || !(int)$_POST['year']) { die(msg(0,"You have to fill in your birthday")); } // is the email valid? if(!(preg_match("/^[\.A-z0-9_\-\+]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $_POST['email']))) die(msg(0,"You haven't provided a valid email")); // I think here is where I need to put something to get the data into a table! echo msg(1,"registered.html"); function msg($status,$txt) { return '{"status":'.$status.',"txt":"'.$txt.'"}'; } ?> How do I get the $_POST['day'] and $_POST['month'], $_POST['year'] etc into a table? It should be so easy but my head is hurting from trying lots of things and tutorials online. Any thoughts my PHP Freaks?
  2. No, as I was hesitant to do so without coming up with a proper strategy for tackling my issue! I'm sure what I will attempt to code isn't that difficult but it's reassuring to get some advice for some of the guys on here. Any thoughts?
  3. Hi guys, I want to create a simple database and use PHP to output the database to certain positions on a HTML page. I am basically trying to recreate this: http://bit.ly/dX4byI I want to have a form where the event info is selected from drop down box such as: Venue and Date then the the rest of the form data (event name, artists, opening times) will go into the right box depending on this. Does anyone have any pointers? Am I even going about this the right way?!
  4. Thanks jcbones. Thing is, I'm still getting attending three times. I think I need to move down one level in the array. $movies['data'] as $user would be the numbered arrays [0],[1],[2] not inside of those numbered arrays. Hence why it is showing attending three times. How can I get down one level? Thanks!
  5. Cool thanks for the code - so it now shows attending three times, but I need to show only for one event id which is 'id'. So I need to search for '107510232628186' in the array and then check if the 'rsvp_status' of this is attending and show this. Any pointers?
  6. Hi guys, I'm trying to search an array to show if a user is attending an event ID and output "You are attending this event". I need to search the array 'data', then all the numbers, then check if the 'id' matches and if they 'attending' or 'not attending'. I have figured out how to search the array using: <?php echo ((in_array('107510232628186', $movies['data'][]['id']))? 'You are attending the event' : 'You are not attending the event'); ?> but it only outputs an error as I don't know how to search all the middle numbered arrays. Here is my array: Array ( [data] => Array ( [0] => Array ( [name] => Test2 [id] => 137233316308949 [rsvp_status] => attending ) [1] => Array ( [name] => Party Animals [id] => 107510232628186 [rsvp_status] => attending ) [2] => Array ( [name] => Ibiza Opening Party @ EDEN [TICKETS] [id] => 111456325542560 [rsvp_status] => attending ) ) Think I'm probably missing a trick here, as it seems like it should be simple! Hope someone can help
  7. Hi guys, I'm currently trying to send some text when a button is clicked via PHP without using a form. I've managed to send text from a form and get that sent using post method: <form name="" action="<?=$config['baseurl']?>" method="post"> <label for="eventbox">Facebook Events</label> <br /> <textarea id="eventbox" name="tt" cols="50" rows="5">I am attending Cadenza - 4th July and signed up via Ibizatalk.com</textarea> <br /> <input type="submit" name="eventbox" value="Attend Event on Facebook" /> </form> and then my PHP: if (isset($_POST['tt'])){ try { $statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> $_POST['tt'], 'cb' => '')); } catch (FacebookApiException $e) { d($e); } } So currently I have it posting 'tt' but I need it to not post the form content but just post text. How can I send text that isn't in a form? Thanks guys, really need your help!
  8. Thanks gwolgamott - however it is still showing as soon as I go onto the page. I need it to be only visible once the button has been clicked but at the moment it is showing constantly? http://www.wecantbehave.com/facebooktest/index.php is the link to see. Any options?
  9. Hi guys, Hope everyone is well! I'm currently using Facebook Connect for a feature on our site. I am trying to show the text 'You are not logged in' if you are not logged in when you click on 'Attend this event' button. I have figured out how to show that i you are logged in and you click on the button it shows "You are now attending this event". The code for this is: <?php if (isset($attendEvent)) { ?> <br /> <b style="color: red">Your now attending the event! <?=$attendEvent['/127573637277755/attending']?></b> <?php } ?> I am trying to add code so that when you click the button and you are not logged in it it says 'You are not logged in' instead of 'Your now attending this event!' Can anyone help with this? I tried else function but it showed up as soon as you landed on the page not after you clicked on the button. 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.