Jump to content

backie

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

backie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well from a quick glance at the api docs it would be a case of something like (Pretty sure there is a premade function to do this just can't think of it. <?php preg_match_all("~([a-z]+)=([a-z0-9]+)~",$Result,$Matches); $Results = array(); for ($i = 0; $i < sizeof($Matches[0]);$i++){ $Results[$Matches[1][$i]] = $Matches[2][$i]; } ?> $Results will return an array see below based upon $Results = "test=result&dkas=4h324jh"; Hope that's some help. Array ( [test] => result [dkas] => 4h324jh )
  2. Well then what you do is check and see if the user agent isn't internet explorer and then print out the two textareas.
  3. Well I am not seeing a curl_execute call so, mabye do that and then format the return data?
  4. try <?php if ( preg_match("~MSIE~isU",$_SERVER['HTTP_USER_AGENT']) ){ print "Is internet explorer!"; } elseif ( preg_match("~Firefox~isU",$_SERVER['HTTP_USER_AGENT']) ){ print "Is firefox"; } ?> If you want to find out the browser for design purposes better of checking what the render engine is, that way modifications of firefox still render the same.
  5. From a quick glance try removing the "?" from the post data. I'll read the api docs and see if I notice anything else.
  6. Heres just a few simple ways. <?php function show_text(){ ?> A pile of text here, <b>including html</b>. <?php } ?> <?php require_once 'text.php'; show_text(); ?> Problem with this approach is that the content's are instantly shown when you call the function, not useful for templates or whatnot. Easier to format the text the way you want tho. <?php $SomeText = "Have some text here"; ?> <?php require_once 'text.php'; print $SomeText; ?> Hard to format text but it only shown when you want, better for use of templates. Or you could just read the data from a text file like.. <?php $handle = fopen("text.txt", "r"); $SomeText = fread($handle, filesize($filename)); fclose($handle); print $SomeText; ?>
  7. Since you're talking about AJAX and claim not to know much about working with php or javascript. I would suggest you look into jQuery's AJAX functionality, real easy to get to grips with and the use of json_encode() php function. They make my life alot easier. Quick examples // With the jquery lib already included in the page. $(document).ready(function() { $("#frm_submit").click(function(){ $.get("/ajax.php", function(data){ if (data.Code == 200){ alert(data.Message); } else { alert("It broke"); } },"json"); }); }); }); <?php $Array = array( "code" => 200, "message" => "Test", "array" => array(1,2,3,4) ); echo json_encode($Array); ?>
  8. backie

    SSL

    A php script will work just the same on https or http. If you wish to stop http usage you could try checking $_SERVER['SERVER_PORT'] to see if it is the correct port. So far I have never had to change a script/app to be used on SSL
  9. Well you should be running start_session() on index.php and before the html headers.
  10. Umm while loop in the email? Only while loop I seen near the email was just before it where it was getting email address that weren't gussing used. while ($email_data = mysql_fetch_array($email_result)){ $to = $email_data['email']; $subject = "Upcoming Arkansas Regional Events"; $headers = "FROM: [email protected]"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n"; //$headers .= 'BCC: '$email' "\n"; $upcoming = "<html><body><h1>Upcoming Events for the Arkansas Regional Calendar</h1> <p style=\"text-align:center;\">You can find more information at <a href=\"http://www.arscna.org/activities\">Activities</a><br /> The following is only a list of the events that have been added to the Arkansas Regional Calendar. <br /> If you are aware of an event that is not on this list please click the activities link above and add any NA event to our calendar.<br /> Please let other addicts know that they can be put on this email list by registering their email address at the <br /> following link <a href=\"http://www.arscna.org/service/mailingList/\">Mailing List</a>. </p> <ul>$calendar</ul> <p>If you wish to be removed from this list you may click this link <a href=\"http://www.arscna.org/service/mailingList/\">Unsubscribe</a> and update<br /> your profile to be unsubscribed.<br /> Thank You for leting us serve you.<br /> Website Subcommittee</p>"; mail($to,$subject,$upcoming,$headers); } may be what your wanting.
  11. There is also a security reason aswell. If you allow people to upload files with names they wish they maybe able to overwrite previous files. (Filename = "../../../../etc/passwd") If you allow them to upload any old type of file they could upload a copy of a php shell and then just type in the url and do whatever they want with your web page. (Depending on your set up) Personally I use "{$FileID}{$FileNameHash}.{$FileType}" as my file naming system.
  12. In theory the second one is easier, but it can allow for invalid emails to be validated which could lead to all sorts of problems depending on what you use the email address for. It did point out to me I forgot "$" at the end of my regex example.
  13. Use regex. Something like preg_match("/[a-z0-9_\-\.]+\@thextremezik\.com/i",$EmailVar); should do the trick.
  14. I am pretty sure the default method for forms is GET. So it would be in the $_GET['train'] and $_REQUEST['train'] but not $_POST['train'].
  15. To save a file into your database? Depends what database system you use. I use MySQL so I know how to do it in MySQL you create a column with the type being BLOB and following to deal with the comication with mysql and php http://uk2.php.net/manual/en/pdo.lobs.php
×
×
  • 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.