PHP - Open A Access Form With Php
Hi all,
I have been working on this and maybe you guys can help. All I need to do is be able to open a access form with php. I have tried a couple of diffrent things but nothing is working. What I have right now is $app = new COM("Access.Application"); $app->OpenCurrentDatabase("C:\Documents and Settings\Ian\Desktop\TestData.accdb"); $app->Application->Run("OpenAccForm"); //$app->DoCmd->OpenForm("Test Data"); //$app->Visible = "Yes"; print "Loaded Access, version {$app->Visible}\n"; Any help is appreciated. Right now It opens access but is not viable. I know it is opening access because it is in the processes tab in task manager. Similar TutorialsHello, A named field in an html form e.g. <input type="text" name="time"> is accessed as $_GET['time'] or $_POST['time'] by the processing script. What about an unnamed field like the one below: <input type="text" value="" id="1" /> How do I harvest this field's input as a variable from my php processing script? Thanks in advance I want to perform a php process initiated by AJAX according to the method described in http://www.w3schools.com/PHP/php_ajax_database.asp with this line Code: [Select] xmlhttp.open("GET","getuser.php?q="+str,true); the php process in getuser.php is initiated. But how I can restrict direct access to getuser.php? If someone visit getuser.php?q=something; the process will be started for "something". I want to run the getuser.php process only and only when it is initiated from my main page. I have an index.php file which includes my form and code to move the user's uploaded file to s3. My HTML form calls a js function sendEmails() which makes an AJAX request to another php script dbSystem() to validate the emails input and add it to a database. Everything is working except that the php code in my index.php file (at the very bottom) does not execute. It's supposed to execute when the user uploads a file and presses submit but it doesn't go into the if statement. I tried putting the $fileName = basename($_FILES["fileName"]["name"]) statement before the if statement but I get an undefined index error. I put my a comment in my code to show which if statement I am talking about. This is my HTML code in index.php: <form action="javascript:void(0)" method="POST" id="files" enctype="multipart/form-data"> <label class="col-md-4 col-form-label text-md-right">Select File: <span class="text-danger">*</span></label> <input type="file" id="userFile" name="fileName" style="cursor: pointer; max-width: 170px;" onchange="enableBtn()"> <label class="col-md-4 col-form-label text-md-right">Authorized Users: <span class="text-danger">*</span></label> <input placeholder="Enter e-mail(s) here..." id="req" autocomplete="off"/> <button id="submitBtn" name="submitBtn" class="<?php echo SUBMIT_BUTTON_STYLE; ?>" onclick="return sendEmails()" disabled>Submit</button> </form> This is my php code in index.php: <?php $conn = new mysqli($servername, $username, $password, $db); $sql = "SELECT sender_id, sender_email, receiver_emails, receiver_ids, file_name from filedrop_logs"; $result = mysqli_query($conn, $sql); if ($result) { echo "<div class='outputDiv'>"; echo "<table id='sharedOthers'>"; echo "<thead><tr class='headings'>"; echo "<th class='files'>Files</th>"; echo "<th class='users'>Users</th>"; echo "</tr></thead>"; while ($row = mysqli_fetch_assoc($result)) { $receiverEmails = $row['receiver_emails']; $fileName = $row['file_name']; echo "<tbody id='bodyOthers'>"; echo "<tr id='rowOthers'>"; echo "<td>$fileName<br>"; $objects = getListofObjects('FileDrop'); foreach ($objects as $object) { $file = $object['Key']; $splits = explode('/', $file); if (end($splits) !== '') { $presignedUrl = getPresignedUrlForPrivateFile($object['Key'], '+20 minutes'); $link = '<a href="'.$presignedUrl.'">Download</a>'; echo $link; } } echo " <a href=''>Delete</a></td>"; echo "<td>$receiverEmails</td>"; echo "</tr></tbody>"; } echo "</table></div>"; } ?> <?php //the if statement below doesn't execute if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES["fileName"])) { $fileName = basename($_FILES["fileName"]["name"]); $error = $_FILES["fileName"]["error"]; $tmpName = $_FILES["fileName"]["tmp_name"]; if (isset(fileName) && $fileName != '' && $tmpName != '' && sys_get_temp_dir()) { $separator = DIRECTORY_SEPARATOR; $newDir = sys_get_temp_dir() . $separator . "FileDrop" . microtime(true); if (!file_exists($newDir)) { mkdir($newDir, 0777, true); // creates temp FileDrop directory $tempFilePath = $newDir . $separator . $fileName; // creates temp file inside FileDrop directory if (move_uploaded_file($tmpName, $tempFilePath)) { // moves file to tmp folder $s3FileName = "FileDrop" . substr($newDir, 4) . $separator . $fileName; $result = putFileToS3($s3FileName, $tempFilePath, 'public-read'); deleteDir($newDir); } } } } ?> This is my js code in case you want to see it: function sendEmails() { var fileData = $('#userFile').prop('files')[0]; var formData = new FormData(); formData.append('tags', JSON.stringify(tags)); formData.append('fileName', fileData); $.ajax({ type: "POST", url: "../FileDrop/dbSystem.php", processData: false, contentType: false, data: formData, success: function(result) { result = JSON.parse(result); if (result.validity === "valid emails") { location.reload(); resetInputs(); //IMPORTANT $(".outputDiv").show(); } else { var tagsBrackets = result.emails.toString().replace(/[\[\]']+/g,''); var tagsQuotes = tagsBrackets.replace(/['"]+/g, ''); var tagsInvalid = tagsQuotes.replace(/,/g, ", "); $('#alertModal').modal({show:true}); document.getElementById('invalid').textContent = tagsInvalid; } } }); return false; } I've been stuck on this for so long, so I'd really appreciate the help!! I have a sign up form to send the activation code to the new user via email.My question is how to restrict the user who is not a member using activation form page in PHP unless their use a sign up form first?
here is my sign up form and activation form:
sign up form
<style type="text/css"> <!-- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12; } .style5 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; } .style7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } --> </style> <form name="form1" method="post" action="email-activation-script.php"> <div align="center"> <p class="style5"> Form Registration </p> <table width="35%" border="0"> <tr> <td class="style7">Username</td> <td class="style7">:</td> <td class="style1"><span class="style7"> <label> <input name="username" type="text" id="username"> </label> </span></td> </tr> <tr> <td class="style7"> Email </td> <td class="style7">:</td> <td class="style1"><span class="style7"> <label> <input name="email" type="text" id="email"> </label> </span></td> </tr> <tr> <td class="style7">Password</td> <td class="style7">:</td> <td class="style1"><span class="style7"> <label> <input name="password" type="password" id="password"> </label> </span></td> </tr> <tr> <td class="style7"> </td> <td class="style7"> </td> <td class="style1"><span class="style7"> <label> <input type="submit" name="Submit" value="Register"> <input type="reset" name="Submit2" value="Cancel"> </label> </span></td> </tr> </table> </div> </form> activation form: <form name="form1" method="post" action="check-activation-script.php"> <div align="center"> <table width="35%" border="0"> <tr> <td>Username</td> <td>:</td> <td><label> <input name="username" type="text" id="username"> </label></td> </tr> <tr> <td>Activation Code </td> <td><label>:</label></td> <td><input name="activation_code" type="text" id="activation_code"></td> </tr> <tr> <td> </td> <td> </td> <td><label> <input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Cancel"> </label></td> </tr> </table> </div> </form> So I'm doing a project and I need to make a successful login form, where it checks in MS Access if the username and password are correct, and if they are the user is taken to a new page. If they are wrong, a message comes up and they stay on the same page. The user should first just see a blank form, but after submit is pressed, it should check if the username and password are correct. IF they are should be taken to a new page. It's been a while since I used php last, so I wasn't quite sure how to tackle this issue. I was wondering if someone could please help me? here is my code. Code: [Select] <html> <head> <style type="text/css"> </style> </head> <body style="text-align:center"> <div id='title'> </div> <?php print_r ($_POST) ; if (isset($_POST['submit'])) { if(isset($_POST['username'])){ $username= $_POST['username'] ; } if(isset($_POST['password'])){ $TABLE= $_POST['password'] ; } $username = null ; $password = null ; $connection = odbc_connect('Olympics', '', ''); if (!$connection) {exit("Conection Failed: " . $connection);} $username = stripslashes($username); $password = stripslashes($password); $sql = "select * from users where users = '$username' and passwords = '$password'"; $rs=odbc_exec($connection,$sql); $count=odbc_num_rows($rs); if ($count == 1) { $_SESSION['loggedIn'] = "true"; header("Location: searchpage.php"); } else { $_SESSION['loggedIn'] = "false"; header("Location: index.php"); echo "Login failed" ; } } echo "<form action='index.php' method='post'> \n" ; echo" Please enter your username and password if you wish. <br/> \n" ; echo "Username: <input type='text' name='username' > \n " ; echo "Password: <input type='password' name='password' > \n" ; echo "<input type='submit' value='Login' name='submit'> <br/> \n" ; echo "<input type='submit' value='You may also continue you as a guest.'> \n" ; ?> </body> </html> So basically my project is one where the user can log onto my website, and the page then checks if the ID and password are in my table in my microsoft access file. If the username and password are the same, the user continues, if it isnt, then it stays on the same page and says something like "username and/or password are incorrect" or something along the lines of that. the problem is right now im not sure how to make it say "ERROR username and/or password is incorrect" if the username and password dont match. Can someone help me with this? and also make sure if the username and password are correct that it goes to the next page, entitled searchpage.php here is the code Code: [Select] <html> <head> <style type="text/css"> </style> </head> <body style="text-align:center"> <div id='title'> </div> <?php print_r ($_POST) ; if if (isset($_POST['Login'])) { if(isset($_POST['username'])){ $username= $_POST['username'] ; } if(isset($_POST['password'])){ $TABLE= $_POST['password'] ; } $username = null ; $password = null ; $connection = odbc_connect('Olympics', '', ''); if (!$connection) {exit("Conection Failed: " . $connection);} $username = stripslashes($username); $password = stripslashes($password); $sql = "select * from users where users = '$username' and passwords = '$password'"; $rs=odbc_exec($connection,$sql); $count=odbc_num_rows($rs); if ($count == 1) { $_SESSION['loggedIn'] = "true"; header("Location: searchpage.php"); } else { $_SESSION['loggedIn'] = "false"; header("Location: index.php"); echo "Login failed" ; } } echo "<form action='index.php' method='post'> \n" ; echo" Please enter your username and password if you wish. <br/> \n" ; echo "Username: <input type='text' name='username' > \n " ; echo "Password: <input type='password' name='password' > \n" ; echo "<input type='submit' value='Login' name='Login'> <br/> \n" ; echo "<input type='submit' value='You may also continue you as a guest.'> \n" ; echo "</form>" ; ?> </body> </html> Just a quick help here... When you click click this radio button. <input type="radio" name="radio" id="radio_id_card" /> ID Card it will open the form below the radio button. <form> First Name: <input type="text" name="textfield" id="textfield" /> Last Name: <input type="text" name="textfield" id="textfield" /> <input type="submit" id="Send" value="Submit" /> </form> ------------------------------- hope someone can help me... i really have a bad time thinking of ways to do it.. thank you in advance.. Scenario. I have a simple form and on the same page a link to open a popup window. The client completes the form then click the upload link. In the popup window the client uploads a file. Problem On closing the popup window the main page is refreshed (to indicate the upload was successful) As the form was not initially submitted - All Form Data is then Lost Question Is there a way of submitting the form and opening a popup window at the same time (to preserve the data entered by the client) or is there another fix for this problem ? Any help is greatly appreciated. Cheers I'm trying to open a URL using fopen() and I keep getting this error: Code: [Select] Failed to open stream: Permission deniedI can not work out what is wrong, it's not a firewall as far as I can tell. Not to say that this occurs in every php software out there, but I far too occasionally notice that the application is written with scattered php open and close tags, for instance
<?php if(true) ?> <?php { ?> Blah blah blah, because it's true <?php } else { ?> because it's not true <?php } ?>To me, it is extremely irritating. Regardless, I see a lot of open source software written this way and I can't help but think that there must be some underlying reason for it. Magento, for example, is written exactly in this manner. The templates are infested with these opened and closed php snippets. Obscurity is not security so I'm ruling security reasons out. Maybe it is more efficient? -- But I couldn't understand why, if so. It seems like that would put more of a drag on the system itself causing php to start and stop parsing continually and excessively, then again, I'm no expert in the field of memory consumption and other operating system complexities. Honestly, in my opinion, it is stupid. i would never write a program that way.. HEREDOCs are much more useful and eye pleasing than that awful <?php { ?> I had the misfortune a few months ago when I purchased an invoicing/customer maintenance system that I didn't know was written for PHP 5.2 or something lower, one that allowed short tags; and thus short tags were used in the same manner as I've described. Is this just plain disorganization or is there some deep-seated inner lining advantage that I'm not aware of? Hi. I'm having some problem with my form. I want to create a booking form with the attachment. Its done but have a few error. Anyone can help me? If the form goes to my email, I can download the attachment. but if i want to open it, it will show this error.'Unable to upen the file. Not a valid PDF file.' Beside that, after i submit the form, this error will come out at my form. Warning: fclose(): supplied argument is not a valid stream resource in D:\xampplite\htdocs\borneotours02\booking2.php on line 268 This is my code: <? require_once("Connections/pamconnection.php"); $cart_id=session_id(); if($_POST['Submit']=='Submit'){ if(mysql_query("INSERT INTO inquiry_log1 (id, session_id, tour, name, contact, email02, phone, fax, travel, adult, children, p_requirement, foc, pdf_title, itinerary,, status, date_posted, time) VALUES ('', '".$cart_id."', '".mysql_real_escape_string($_POST['tour'])."', '".mysql_real_escape_string($_POST['name'])."', '".mysql_real_escape_string($_POST['contact'])."', '".mysql_real_escape_string($_POST['email02'])."', '".mysql_real_escape_string($_POST['phone'])."', '".mysql_real_escape_string($_POST['fax'])."', '".mysql_real_escape_string($_POST['travel'])."', '".mysql_real_escape_string($_POST['no_adult'])."', '".mysql_real_escape_string($_POST['no_children'])."', '".mysql_real_escape_string($_POST['product_requirement'])."', '".mysql_real_escape_string($_POST['foc_allocation'])."', '".mysql_real_escape_string($_POST['pdf_file'])."', '".mysql_real_escape_string($_POST['itinerary'])."', 1, '".date("Y-m-d")."', '".date("g:i a")."')")) if($_FILES['pdf_file']!='') { $fileatt = $HTTP_POST_FILES['pdf_file']['tmp_name']; $fileatt_type = $HTTP_POST_FILES['pdf_file']['type']; $file_name = $HTTP_POST_FILES['pdf_file']['name']; $ext = substr(strrchr($fileatt_type, "/"), 1); switch ( $ext ) { case 'pdf': $fileatt_name = $file_name; break; case 'msword': $fileatt_name = $file_name; break; case 'vnd.openxmlformats-officedocument.wordprocessingml.document': $fileatt_name = $file_name; break; } } $email_from = $_POST['email02']; // Who the email is from $email_subject = "Outbound Booking Form"; // The Subject of the email $email_message.='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <!--<style> .title{ font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; font-weight:bold; } .content{ font-family:Verdana, Arial, Helvetica, sans-serifl; font-size:12px;} </style>--> <body> <table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000"> <tr><td> <table width="100%" border="0" align="center" cellpadding="4" cellspacing="6" bgcolor="#DCE1E9" class="content"> <tr> <td colspan="2" class="title">Online Booking Form</td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" align="right">'.date("jS F Y").'</td> </tr> <tr class="style9"> <td> </td> </tr>'; if($_POST['tour']!=''){ $email_message.='<tr class="style9"> <td width="32%" class="title02">Tour Package Name</td> <td width="68%" class="email_message">'.$_POST['tour'].'</td> </tr>';} //if($_POST['title']!=''){ //$email_message.='<tr class="style9"> //<td width="32%" class="title02">Title</td> //<td width="68%" class="email_message">'.$_POST['title'].'</td> //</tr>';} $email_message.=' <tr class="style9"><td colspan="2" class="title" bgcolor="#FFFFFF"><strong>CONTACT DETAILS</strong></td></tr>'; if($_POST['name']!=''){ $email_message.='<tr class="style9"> <td width="32%" class="title02">Name</td> <td width="68%" class="email_message">'.$_POST['name'].'</td> </tr>';} if($_POST['contact']!=''){ $email_message.='<tr class="style9"> <td class="title02">Contact Person</td> <td class="email_message">'.$_POST['contact'].'</td> </tr>';} if($_POST['email02']!=''){ $email_message.='<tr class="style9"> <td class="title02">Email Address</td> <td class="email_message">'.$_POST['email02'].'</td> </tr>';} if($_POST['phone']!=''){ $email_message.='<tr class="style9"> <td class="title02">Phone Number</td> <td class="email_message">'.$_POST['phone'].'</td> </tr>';} if($_POST['fax']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">Fax Number</td> <td class="email_message">'.$_POST['fax'].'<br><br></td> </tr>';} $email_message.=' <tr class="style9"><td colspan="2" class="title" bgcolor="#FFFFFF"><strong>TRIP REQUIREMENTS</strong></td></tr>'; if($_POST['travel']!=''){ $email_message.='<tr class="style9"> <td class="title02">Date Of Travel</td> <td class="email_message">'.$_POST['travel'].'</td> </tr>';} $email_message.=' <tr class="style9"><td colspan="2" class="title02">No.Of Travellers :</td></tr>'; if($_POST['adult']!=''){ $email_message.='<tr class="style9"> <td class="title02">Adults</td> <td class="email_message">'.$_POST['adult'].'</td> </tr>';} if($_POST['children']!=''){ $email_message.='<tr class="style9"> <td width="32%" valign="top" class="title02">Children</td> <td width="68%" class="email_message">'.$_POST['children'].'</td> </tr>';} if($_POST['s_interest']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">Special Interest</td> <td class="email_message">'.$_POST['s_interest'].'</td> </tr>';} if($_POST['p_requirement']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">Product Requirement</td> <td class="email_message">'.$_POST['p_requirement'].'</td> </tr>';} if($_POST['foc']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">FOC Allocation</td> <td class="email_message">'.$_POST['foc'].'<br><br></td> </tr>';} $email_message.=' <tr class="style9"><td colspan="2" class="title02">Room Types Required:</td></tr>'; if($_POST['single']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">Single</td> <td class="email_message">'.$_POST['single'].'</td> </tr>';} if($_POST['double']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">Double</td> <td class="email_message">'.$_POST['double'].'</td> </tr>';} if($_POST['triple']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">Triple</td> <td class="email_message">'.$_POST['triple'].'</td> </tr>';} if($_POST['s_requirement']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">Special Requirement</td> <td class="email_message">'.$_POST['s_requirement'].'<br><br></td> </tr>';} $email_message.=' <tr class="style9"><td colspan="2" class="title" bgcolor="#FFFFFF"><strong>ITINERARY</strong></td></tr>'; if($_POST['pdf_file']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">Itinerary File</td> <td class="email_message">'.$_POST['pdf_file'].'</td> </tr>';} if($_POST['itinerary']!=''){ $email_message.='<tr class="style9"> <td valign="top" class="title02">Itinerary</td> <td class="email_message">'.$_POST['itinerary'].'<br><br></td> </tr>';} $email_message.='<tr class="style9"> <td colspan="2" valign="top"><div align="center"> </div></td> </tr> </table> </td></tr></table></body> </html>'; $email_to = "ee_elizebert@hotmail.com"; // Who the email is to ini_set(SMTP, "mail.sarawakhost.com"); ini_set(smtp_port, "587"); ini_set(sendmail_from, $email); $headers = "From: ".$email_from; $file = fopen($fileatt,'rb'); //$data = fread($file,filesize($fileatt)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message .= "\n\n"; $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data .= "\n\n" . "--{$mime_boundary}--\n"; $ok = mail($email_to, $email_subject, $email_message, $headers); if($ok) { $send='<font color=#336600>Feedback sent</font>'; } else { $send='<font color=#CC3300>Failed to send. Please try again.</font>'; } }?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Outbound Booking Form</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .style1 {color: #FF0000} body { background-image: url(images/booking.jpg); background-repeat:repeat-x; } --> </style> </head> <script> function booknow() { if(document.form1.name.value==''){alert("Please enter your name. Thank You."); document.form1.name.focus(); return false;} if(document.form1.contact.value==''){alert("Please enter the contact person. Thank You."); document.form1.contact.focus(); return false;} if(document.form1.email02.value==''){alert("Please enter your email address. Thank You."); document.form1.email02.focus(); return false;} if(document.form1.email02.value.indexOf('@')==-1){alert("Invalid email address. Please enter a valid email address. Thank You."); document.form1.email02.focus(); return false;} if(document.form1.email02.value.indexOf('.')==-1){alert("Invalid email address. Please enter a valid email address. Thank You."); document.form1.email02.focus(); return false;} } //<![CDATA[ window.addEvent('domready', function() { myCal2 = new Calendar({ date02: 'd/m/Y' }, { classes: ['dashboard'], direction: 1, tweak: {x: 3, y: -3} }); }); window.addEvent('domready', function() { myCal2 = new Calendar({ date03: 'd/m/Y' }, { classes: ['dashboard'], direction: 1, tweak: {x: 3, y: -3} }); }); //]]> </script> <script type="text/javascript" src="mootools.v1.11.js"></script> <script type="text/javascript" src="DatePicker.js"></script> <script type="text/javascript"> window.addEvent('domready', function(){ $$('input.DatePicker').each( function(el){ new DatePicker(el); }); }); </script> </script> <link rel="stylesheet" type="text/css" href="DatePicker.css" media="screen" /> <link rel="stylesheet" type="text/css" href="css/iframe.css" media="screen" /> <link rel="stylesheet" type="text/css" href="css/dashboard.css" media="screen" /> <link href="css.css" rel="stylesheet" type="text/css" /> <? if($send!=''){?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><? echo $send?></td> </tr> </table> <? }?> <form name="form1" method="post" action="booking2.php" enctype="multipart/form-data"> <table width="100%" border="0" cellspacing="4" cellpadding="2"> <tr> <td align="left" valign="middle" colspan="2"><p class="title3"><? echo $send;?></td> </tr> <tr> <td align="left" valign="middle" colspan="2"><? include("form_feature_tools.php");?></td> </tr> <table width="100%" border="0"> <tr> <td width="17%"><div align="right" class="title6"><strong>Tour Package Name</strong></div></td> <td width="28%"><span class="heading4"><? echo $_GET['tour']; if($_GET['code']!='') echo " (".$_GET['code'].")";?> <input type="hidden" name="tour" value="<? echo $_GET['tour']; if($_GET['code']!='') echo " (".$_GET['code'].")";?>" /> </span></td> <td width="16%"> </td> <td width="39%"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><div align="right"><strong class="title6">CONTACT DETAILS</strong></div></td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><div align="right"><span class="title6">Name</span> <span class="content_text3">*</span></div></td> <td><div align="left"><span class="title6"> <input name="name" type="text" class="style7" id="name" size="30" value="<? echo $_POST['name']?>" /> </span></div></td> <td> </td> <td> </td> </tr> <tr> <td><div align="right"><span class="title6">Contact Person</span><span class="content_text3">*</span></div></td> <td><div align="left"><span class="title6"> <input name="contact" type="text" class="style7" id="contact" size="30" value="<? echo $_POST['contact']?>"/> </span></div></td> <td> </td> <td> </td> </tr> <tr> <td><div align="right" class="title6">Email Address <span class="content_text3">*</span></div></td> <td><div align="left"> <input name="email02" type="text" class="style7" id="email02" size="30" value="<? echo $_POST['email02']?>" /> </div></td> <td> </td> <td> </td> </tr> <tr> <td><div align="right" class="title6">Phone Number</div></td> <td><div align="left"> <input type="text" name="phone" id="phone" class="style7" value="<? echo $_POST['phone']?>"/> </div></td> <td> </td> <td> </td> </tr> <tr> <td><div align="right" class="title6">Fax Number</div></td> <td><div align="left"> <input type="text" name="fax" id="fax" class="style7" value="<? echo $_POST['fax']?>"/> </div></td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><div align="right"><strong class="title6">TRIP REQUIREMENTS</strong></div></td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><div align="right" class="title6">Date Of Travel : </div></td> <td><? echo '<input id="travel" name="travel" style="width:50%" type="text" class="DatePicker" tabindex="1" value="'.date("m/d/Y", $tomorrow).'"/>';?></td> <td> </td> <td> </td> </tr> <tr> <td><div align="right" class="title6" valign="top">No Of Travellers: </div></td> <td><table width="100%" border="0"> <tr> <td width="19%" class="title6"><div align="right">Adult:</div></td> <td width="81%"><div align="left"> <input type="text" name="no_adult" id="no_adult" value="<? echo $_POST['adult']?>" /> </div></td> </tr> <tr> <td><div align="right" class="title6">Children:</div></td> <td><div align="left"> <input type="text" name="no_children" id="no_children" value="<? echo $_POST['children']?>"/> </div></td> </tr> </table></td> <td><div align="right" class="title6" valign="top">Product Requirement: </div></td> <td> <table width="41%" border="0"> <tr> <td width="8%"><input type="radio" name="product_requirement" id="air" value="air and land" <? if($_POST['p_requirement']=="air"){?> selected="selected"<? }?>/></td> <td width="92%" class="title6"><div align="left">Air & Land</div></td> </tr> <tr> <td><input type="radio" name="product_requirement" id="land" value="land only" <? if($_POST['p_requirement']=="land"){?> selected="selected"<? }?> /></td> <td class="title6"><div align="left">Land Only</div></td> </tr> </table></td> </tr> <tr> <td class="title6"><div align="right">Special Interest:</div></td> <td><div align="left"> <textarea name="special_interest" id="special_interest" cols="30" rows="3"><? echo $_POST['s_interest']?></textarea> </div></td> <td><div align="right" valign="top" class="title6">FOC Allocation</div></td> <td><div align="left"> <input type="text" name="foc_allocation" id="foc_allocation" value="<? echo $_POST['foc']?>"/> </div></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="title6"><div align="right"><strong>ITINERARY</strong></div></td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><div align="right" class="title6">Upload Itinerary</div></td> <td><div align="left"> <input name="pdf_file" enctype="multipart/form-data" type="file" id="pdf_file"> <br> <span class="content_text">Browse for file (.doc or .pdf only)</span></div></td> <td> </td> <td> </td> </tr> <tr> <td><div align="right" class="title6">or ENTER Itinerary Here;</div></td> <td> <label> <div align="left"> <textarea name="itinerary" id="itinerary" cols="30" rows="3"><? echo $_POST['itinerary']?></textarea> </div> </label></td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><div align="right"> <input name="reset" type="reset" id="reset" value="Reset"/> </div></td> <td><div align="left"> <input type="Submit" name="Submit" value="Submit" onClick="return booknow();" /> </div></td> <td> </td> </tr> </table> </body> </html> Hello, folks. I am having a little trouble with this script. I want it to be able to read a directory, not just a file, and list all files in the directory along with their id3 tags. I can't get it to read all the files, it reads only the first file in the directory. Here, I'm posting the basic (stripped down) script, without mods or add-ons. I would appreciate any help. Thanks. Code: [Select] <?php require('error.inc.php'); require('id3.class.php'); $nome_arq = 'music.mp3'; $myId3 = new ID3($nome_arq); if ($myId3->getInfo()){ echo('<HTML>'); echo('<a href= "'.$nome_arq.'">Click to play: </a><br>'); echo('<table border=1> <tr> <td><strong>Artist</strong></td> <td><strong>Title</strong></font></div></td> <td><strong>Track</strong></font></div></td> <td><strong>Album/Year</strong></font></div></td> <td><strong>Genre</strong></font></div></td> <td><strong>Comments</strong></font></div></td> </tr> <tr> <td>'. $myId3->getArtist() . ' </td> <td>'. $myId3->getTitle() . ' </td> <td>'. $myId3->getTrack() . ' </td> <td>'. $myId3->getAlbum() . '/'.$myId3->getYear().' </td> <td>'. $myId3->getGender() . ' </td> <td>'. $myId3->tags['COMM']. ' </td> </tr> </table>'); echo('</HTML>'); }else{ echo($errors[$myId3->last_error_num]); } ?> Hi guys, I am making a site where users upload files (like images, pdfs, etc) to the server. My question is, how does Facebook handle file permissions, restricting access to files uploaded to their servers based on what a user sets? Because I need to implement a similar thing and have no idea how to do it in a clean way. I have had two thoughts on storing the files 1) in a DB or 2) in a folder out of the wwwroot, which would prevent access by anyone without knowing the path (or some such) but it is the more "real" permissions implementation I am stuck on. I obviously would like to achieve this with PHP and MySQL(i). Any help is much appreciated. Cheers in advance. Hi I'm after a solution to a problem I have. I'm building a small site for charity which the the client wants to email(with a url link) to say 1000 selected companies but only wants them to be able to view the site and register interest and not anyone else or if they forward the mail to a non prefered client? Any help to point me in the right direction would be good thank-you. Hi, i am learning WordPress and have just started, but i have a problem....when i try to access my site i get this: Warning: Cannot modify header information - headers already sent by (output started at /home/smra9/public_html/wp-content/themes/evanescence/functions.php:6) in /home/smra9/public_html/wp-includes/pluggable.php on line 890 when i open pluggable.php and i go to the line 890 it says: header("Location: $location", true, $status); i will also copy a text from line 885 to 890 so maybe you will understand better: if ( $is_IIS ) { header("Refresh: 0;url=$location"); } else { if ( php_sapi_name() != 'cgi-fcgi' ) status_header($status); // This causes problems on IIS and some FastCGI setups header("Location: $location", true, $status); } Can anyone help me, i don't know what to do I'm currently learning PHP and I think I have a decent grasp of procedural programming so I'm trying to set it up a little bit and get a hang of OOP. I'm finding it a little tough going but I am making progress, the syntax and coding of it is fine but I don't quite get some theory and the best way to use it yet. It's only my third day in but I have a question relating to access modifiers. It's a simple one, but what is the point? That may sound a bit narky but I keep hearing and reading that it's good programming convention but it's never really explained why. What am I missing? I get how they work but I don't really get why to use them. I've even read that private should only be rarely used, if at all as it makes testing harder and it stops you from being able to extend your classes. I'm not against using them - I want to learn to program to the very best of my ability but I'm eager to learn what benefits it actually has. Is there a technical reason, for example? Array ( [game] => Array ( [id] => 2011012593950636050 [name] => Array ( [us] => Castlevania II: Belmont's Revenge [uk] => Castlevania II: Belmont's Revenge ) echo print_r($this->game[0]['name']) but undefined offset error. I don't want to loop through the first array either. Thanks I've got data in a mySql database which is updated daily. I would like to allow webmasters to place this data in a form of a widget on their websites provided they pay for access. If not payment comes through we should be able to block access.
Any suggestions how this project would be designed?
Hey Guys.
I have a class named CoreCartFunctions. In the class there is a protected property named $menu_item_id which is initialized as null.
A method named GetMenuItemId assigns the $menu_item_id its value. I have tested it out using the following, to see if a value got returned and it did
fb($menu_item_id->GetMenuItemId(), "This is the menu id");The problem is when I access the property from a different public method in the same class it dones't return anything. fb($menu_item_id->DisplayMenuItems());It only returns something when I hard code a value to it.... Not sure why this is happening. Here is my full code. Please not the example below may have some syntax errors since I just copied and paste pieces of my code, to show a quick and dirty example. class CoreCartFunctions { protected $menu_item_id = NULL; public static $items; //Equal to the a long session string protected function GetMenuItemId() { foreach (self::$items as $menu_item_id_session) { /*********************************** Get the id of the menu item item ************************************/ $this->menu_item_id = preg_match_all('/\-(.*?)\*/',$menu_item_id_session,$match_found)?$match_found[1][0]:""; // The following line shows example of above line // $menu_item_id = "12"; public function DisplayMenuItems(){ return $this->menu_item_id; // Doesn't return Item ID } } If a client connects to a ReactPHP TLS socket server, is it possible to obtain the symmetric key from within the PHP code? Hoping it will allow me to decrypt analysis traffic between two using Wireshark. |