Jump to content

Search the Community

Showing results for tags 'PHP'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 981 results

  1. haruncpi

    How to will it be ?

    I have a login function in my site http://www.learn24bd.com. In my database every register member has their data, Like name,e-mail,etc. At the time of login user needs to put his/her email and password.I wanna if a user login successfully, a message will display on login success page Welcome (The name which has saved in my database in name field) Example: Welcome MD.Harun-Ur-Rashid Please any body help me.
  2. I have an array full of smaller arrays. The smaller arrays contain elements, one of which is a date. (Not a timestamp, a date such as 1, 2, 3, etc.) I want to sort the small arrays within the large array in order of this date. I don't see anything in the docs for PHP on how to do this.Let me state this another way. I have an array called $eventsThisMonth. I would like to sort $eventsThisMonth by $eventsThisMonth[every][dateOfThisOccurrance]. Thank you in advance for your great help and advice. Jeff P.S. I tried sorting "manually" using an outside loop that goes 1-31 (for the possible values of the date) and an inner loop that goes 0-count($eventsThisMonth) and compares the dateOfThisOccurrance of each smaller array to the index of the outside loop. If equal, it does an array_push to another array. This still didn't work; the other array was in the same order as the original.
  3. I am trying to cURL my university login page. I want users to enter their university id and pass in my website, my website will curl to university website, authenticate and then allow them to login or give error accordingly. But my university portal is a jsp page. And after having posted in StackOverflow and other forums before, this is what I came up with. I need further help on where I am going wrong and how to rectify it. <form class="form-horizontal" action="curl.php" method="POST"> <div class="control-group"> <label class="control-label" for="inputEmail">Username</label> <div class="controls"> <input type="text" id="inputEmail" placeholder="Username"> </div> </div> <div class="control-group"> <label class="control-label" for="inputPassword">Password</label> <div class="controls"> <input type="password" id="inputPassword" placeholder="Password"> </div> </div> <div class="control-group"> <div class="controls"> <label class="checkbox"> <input type="checkbox"> Remember me </label> <button type="submit" class="btn">Sign in</button> </div> </div> </form> Now this is my curl.php file: <?php $address = "http://evarsity.srmuniv.ac.in/srmswi/usermanager/youLogin.jsp"; //site URL $post = "username=txtRegNumber&pass=txtPwd"; //Parameters to be sent. Written like GET. $welcomeMessage = "Welcome..."; //This is the message that is displayed when a login is successful $options = array( CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)', CURLOPT_POST => true, //using post CURLOPT_URL => $address, //where to go CURLOPT_POSTFIELDS => $post, //input params CURLOPT_RETURNTRANSFER => true, //Returns a string value of the request CURLOPT_SSL_VERIFYPEER => false, //Avoid SSL problems CURLOPT_COOKIEFILE => 'cookie.txt', //Save cookies CURLOPT_COOKIEJAR => 'cookies.txt' //Cookies located CURLOPT_USERPWD ==> [username]:[password]); if (strpos($content, $welcomeMessage) !== false){ /* Do whatever,I don't know what to do here though */ } curl_close($ch); //close connections ?> Please let me know where I am going wrong, why I am not able to login and after logging in, how to log out.Thank you.
  4. So basically, I have taken a form, re-arranged it and I have messed something up along the way. quote.php: <table id="form" border="0" cellpadding="0" cellspacing="5" width="100%"> <form method="post" action="http://www.mysite.com/sendquote.php"></form> <tbody><tr> <td colspan="2" align="right" bgcolor="#CCCCCC"><strong>Select Make</strong> <span>*</span></td> <td colspan="2" align="left" bgcolor="#CCCCCC"><select name="make" id="make"> <option value="">Select One</option> <option value="Acura">Acura</option>.... <option value="Yugo">Yugo</option> </select></td> </tr> <tr> <td align="left">Select Model <span>*</span></td> <td align="left"><input name="model" id="model" type="text"></td> <td align="left">Year <span>*</span></td> <td align="left"><select name="year" id="year"> <option value="">Selct One</option> <option value="2012"> 2012 </option>..... <option value="1961"> 1961 </option> </select></td> </tr> <tr> <td align="left">VIN <span>*</span></td> <td align="left"><input name="vin" id="vin" type="text"></td> <td align="left">Odometer: (Write "0" if N/A)</td> <td align="left"><input name="odometer" id="odometer" type="text"></td> </tr> <tr> <td align="left">Does it start and drive? <span>*</span></td> <td align="left"><select name="driveable" id="driveable"> <option selected="selected" value="Start and Drivable">Start and Drivable</option> <option value="Start - will not run">Start - will not run</option> <option value="Will not start">Will not start</option> </select></td> <td align="left">Do you have the title in hand ?<span>*</span></td> <td align="left"><select name="title" id="title"> <option selected="selected" value="Yes - Clear in Hand">Yes - Clear in Hand</option> <option value="Yes - Salvage Title">Yes - Salvage Title</option> <option value="No - I lost it">No - I lost it</option> <option value="No - It is not my car">No - It is not my car</option> </select></td> </tr> <tr> <td align="left">Ever been in an accident or flood <span>*</span></td> <td align="left"><select name="accidentflood" id="accidentflood"> <option selected="selected" value="NO">NO</option> <option value="Yes - Accident">Yes - Accident</option> <option value="Yes - Flood">Yes - Flood</option> </select></td> <td align="left">Price expected (Optional)</td> <td align="left"><select name="price" id="price"> <option value="">Choose Amount</option> <option value="Not Sure">Not Sure</option> <option value="$50">$50</option> <option value="More than $5000">More than $5000</option> </select></td> </tr> <tr> <td colspan="4" align="left" bgcolor="#CCCCCC"><strong>Describe condition of vehicle including missing parts, body and mechanical damages:</strong></td> </tr> <tr> <td colspan="4" align="center"><textarea name="comments" onkeypress="return maxLength(this,"501");" onblur="return maxLengthPaste(this,"501");" rows="3" cols="40"></textarea></td> </tr> <tr> <td colspan="4" align="left" bgcolor="#CCCCCC"><strong>Seller Info</strong></td> </tr> <tr> <td align="right"> Name <span>*</span></td> <td align="left"><input name="fname" id="fname" type="text"></td> <td align="right">Email <span>*</span></td> <td align="left"><input name="email" id="email" type="text"></td> </tr> <tr> <td align="right">Phone <span>*</span></td> <td align="left">(<input name="phone1" id="phone1" maxlength="3" style="width:40px;" type="text">) <input name="phno" id="phno" maxlength="8" style="width:90px;" type="text"></td> <td align="right">Zip Code <span>*</span></td> <td align="left"><input maxlength="5" name="zip" type="text"></td> </tr> <tr> <td colspan="4" align="center"><input name="submit" id="submit" value="Submit" style="width:100px;" type="submit"></td> </tr></tbody></table> sendquote.php <?php$mailto = 'myemail@gmail.com' ;$subject = "Quote Request" ;$formurl = "http://www.mysite.com/quote.php" ;$errorurl = "http://www.mysite.com/quote.php" ;$thankyouurl = "http://www.mysite.com/quote.php" ;$uself = 0;$use_sendmailfrom = 0;$use_webmaster_email_for_from = 0;$use_utf8 = 1;$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;$content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' : 'Content-Type: text/plain; charset="utf-8"' ;if (isset( $use_sendmailfrom ) && $use_sendmailfrom) {ini_set( 'sendmail_from', $mailto );}$firstname = addslashes($_POST['fname']) ;$zip = addslashes($_POST['zip']) ;$phone = addslashes($_POST['phone1']) ;$email = addslashes($_POST['email']) ;$comments = addslashes($_POST['comments']) ;$make = addslashes($_POST['make']) ;$model = addslashes($_POST['model']) ;$year = addslashes($_POST['year']) ;$vin = addslashes($_POST['vin']) ;$odometer = addslashes($_POST['odometer']) ;$driveable = addslashes($_POST['driveable']) ;$title = addslashes($_POST['title']) ;$accidentflood = addslashes($_POST['accidentflood']) ;$price = addslashes($_POST['price']) ;if (!isset($_POST['email'])) {header( "Location: $formurl" );exit ;}$valid_email = (preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/im', $email)) ? true : false;$valid_firstname = (!empty($firstname)) ? true : false;$valid_zip = (!empty($zip)) ? true : false;$valid_phone = (!empty($phone1)) ? true : false;$valid_email = (!empty($email)) ? true : false;$valid_vin = (!empty($vin)) ? true : false;$valid_year = (!empty($year)) ? true : false;$valid_make = (!empty($make)) ? true : false;$valid_model = (!empty($model)) ? true : false;$valid_odometer = (!empty($odometer)) ? true : false;$fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ;if (get_magic_quotes_gpc()) { $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); while (list($key, $val) = each($process)) { foreach ($val as $k => $v) { unset($process[$key][$k]); if (is_array($v)) { $process[$key][stripslashes($k)] = $v; $process[] = &$process[$key][stripslashes($k)]; } else { $process[$key][stripslashes($k)] = stripslashes($v); } } } unset($process);}$messageproper ="This message was sent from:\n" ."$http_referrer\n" ."------------------------------------------------------------\n" ."Name: $firstname\n" ."Zip: $zip\n" ."Email: $email\n" ."Phone: $phone\n" ."Year: $year\n" ."Make: $make\n" ."Model: $model\n" ."Odometer: $odometer\n" ."Runs? $driveable\n" ."Title? $title\n" ."Accident or flood? $accidentflood\n" ."Expected pirce? $price\n" ."------------------------- MESSAGE -------------------------\n\n" .$comments ."\n\n------------------------------------------------------------\n" ;$headers = "From: \"$firstname\" <$fromemail>" . $headersep . "Reply-To: \"$firstname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.15.0" . $headersep . 'MIME-Version: 1.0' . $headersep . $content_type ;if ($valid_email && $valid_fname && $valid_zip && $valid_email && $valid_comments && $valid_year && $valid_make && $valid_model && $valid_odometer) {mail( $mailto, $subject, $messageproper, $headers );}else {header( "Location: $errorurl" );exit ;}header( "Location: $thankyouurl" );exit ;?> Any ideas of where I went wrong?
  5. i want to fetch data from multiple tables. they all are similar that is they have same colum names (catalog_product_flat_1,catalog_product_flat_ 2,catalog_product_flat_ 3,catalog_product_flat_ 4.......), but they are not related.Is there any way to do this through stored prcedures or any other way. One more thing these tables will increse in future as the stores of my ecomerce site increases..please help me i am new to this...
  6. Hello everyone,I am looking for a tool similar to http://www.downes.ca/memorization.htm to help me memorize arabic textThe tool should be able to extract up to first 3 letters of an Arabic word when I copy paste the Arabic text into the field box.Can this be done automatically or will I need this be done manually where someone goes through the text and inserts first 3 letters from each word. What programming language can this be coded in? Which would give the best result? I want it to be a fluid user experience.Please read here for more info - http://www.productivity501.com/how-to-memorize-verbatim-text/294/Here is an example of Arabic text - http://www.allahsquran.com/learn/ Thank you very much!
  7. Hello Everyone, I have to create object array for my userdefine class. In c++ when we create class and we want to create object array then we simply do by following statement. // My class in c++ class MyClass { public: int iVal;} if we want to create object array you do like that in c++ MyClass obj[5]; In this we create 5 object of class MyClass. I want to do same thing in php. Thanks and Regards,Antrikssh...
  8. Hello anybody can help me . how to make chek remember me for login , like login in here , we can no login again cause chek remember me..? hoe to create like it. ..thks
  9. Hello Everyone,I have to create object array for my userdefine class. In c++ when we create class and we want to create object array then we simply do by following statement.// My class in c++class MyClass {public:int iVal;}if we want to create object array you do like that in c++MyClass obj[5];In this we create 5 object of class MyClass.I want to do same thing in php.Thanks and Regards,Antrikssh...
  10. Hi, I am currently building a portfolio using the drag and drop design software wix. I have tried coding it myself in dream weaver but I always get hung up the design. So What i want to do is get the basic ideas of the site with the WIX program, and then recreate it myself in dreamweaver as there are some things that the program can not do that I would like. My problem has been in the design process though. I always read to code repeating items in separate files so you only have to change one file if something changes. Things like the header, footer, navigation, ect.My question is, what is the proper way to include these elements. In the past I have designed a basic CSS layout and then I'd include the various elements with PHP include. For the navigation, I tended to use PHP switch statements to load the appropriate content into the content portion of my design. Unfortunately this results in having only one web address that doesnt change to the various pages. I'm assuming the proper way would be to include the different elements into the content index file itself. Does that make sense? Is there a way to do this without PHP? How do the different sections fit within the <body> tag? What's the best process in putting all these parts together and organizing them within the site folder structure? If this is not clear, I will try to provide an example. Thanks for any help.
  11. Hello,I am going to do a test/benchmark of some PHP frameworks.The main factor of comaparation will be a comunication with MySQL databases and CRUD operations with them.I'll also compare their documentation, comunity support, etc.So I made a list of some known frameworks and I'll be glad if someone can tell me which I should not use or which I forgot to include. Zend Framework CodeIgniter Symphony Yii Kohana Prado CakePHP Nette PhpBURN Akelos Recess Jelix DooPHP Qcodo Seagull Thx for every help.
  12. Hello everyone!I have a few questions, I have taken on a project this week that is kinda complex. My first question regarding this script is this: I am going to have a forum with a few drop downs text fields and text boxes and check boxes/selections. for this example lets say there is a total of 12 elements (from the above list) Thats the easy part no what i need to do is. I am going to have a $var that can be anything from 1 to 150, now i need the forum drop downs text fields, text boxes and check boxes/selections to repeat with in that forum for the amount of $var. Then when all that info is field out i need it to post to a mysql db. What i dont understand how to do is make php rename all the name boxes for each example by default i will have: |--fname--|--lname--|--start_date--| --end_date--|--night--| and so on.... So what im assuming i need to do is make php do (with $var being 3)... |--fname--|--lname--|--start_date--| --end_date--|--night--| and so on....|--fname1--|--lname1--|--start_date1--| --end_date1--|--night1--| and so on....|--fname2--|--lname2--|--start_date2--| --end_date2--|--night2--| and so on.... And how do i get my php insert mysql script to dynamically know names of the fields (fname, fname1, fname2....and so on) and have them stored in mysql. Thank you for the help!Kelly
  13. Hey everyone! i am trying to fetch data from different file locations, every time there is a new location like this /5/3/539238_375049019231475_1212083119_n.jpg/3/0/309320_396625203733616_1897402511_n.jpg/n/i/nike.jpg I want to get data from all these locations in a single query, how do i get it? Please help me..
  14. Can anyone tell me what is wrong with this file that keeps saying that this file is invalid. it seems certain jpg files are invalid while others are not. yet they all meet the guidelines establish. ERROR:Upload: americanrobinbird.jpgType: image/pjpegSize: 12.8095703125 KbStored in: /chroot/tmp/phpfryeow Invalid file Invalid file Upload.php file <?php$query = "SELECT * FROM {$dbprefix}pages ORDER BY hn ASC";$result = mysql_query($query) or die(mysql_error());while($row = mysql_fetch_array($result)){extract($row);$options .= "<option value='$pn'>$hn</option>";}$query = "SELECT * FROM {$dbprefix}leftnav ORDER BY name ASC";$result = mysql_query($query) or die(mysql_error());while($row = mysql_fetch_array($result)){extract($row);$folderoptions .= "<option value='$link'>$name</option>";}echo "<form action='upload_file.php' method='post' enctype='multipart/form-data'> <label for='file'>Filename:</label> <input type='file' name='file' id='file' /><br /> <label for='file'>File Belonges To:</label> <select name='powner' class='form' />$options</select><br /> <label for='file'>File Folder:</label> <select name='folder' class='form' />$folderoptions</select><br /> <input type='submit' name='submit' value='Submit' /> </form>";?> Upload php file: <?php include("config.php");include("themes/$theme/header.php");?><?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } ?> <?php $allowedExts = array("jpg", "jpeg", "gif", "png"); $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/jpg")) && ($_FILES["file"]["size"] < 20000) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } } else { echo "Invalid file"; } ?> <?php $allowedExts = array("jpg", "jpeg", "gif", "png"); $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/jpg")) && ($_FILES["file"]["size"] < 20000) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("$folder/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { $name = $_FILES["file"]["name"]; $newname = "$folder/$name"; $query = "INSERT INTO {$dbprefix}pictures (plocation, powner) VALUES ('$newname', '$powner')"; $result = mysql_query($query) or die(mysql_error()); move_uploaded_file($_FILES["file"]["tmp_name"], "$folder/" . $_FILES["file"]["name"]); echo "Stored in: " . "$folder/" . $_FILES["file"]["name"]; echo "<script language=\"Javascript\">alert(\"Success!\");window.location.href = 'index.php?p=Upload';</script>"; } } } else { echo "Invalid file"; } ?> <?php include("themes/$theme/footer.php");?>
  15. I have created a checklist using HTML tables, however I want different people to be able to use the checklist and be able to come back to it and check things off as they are acquired or completed. I'm pretty sure I will need to use PHP and I know how to create a login page, and I think to be able to save the checkboxes for individual people I would use a PHP form but I'm not sure how to incorporate the table I have already created. Any help would be appreciated.
  16. Note: This part of the problem is solved. Please go down to the 11:38 am posting below to pick up what monster we face now. Here's the link to show you the problem -- results appear in the wrong location -- just type a into the search box. http://www.woofwoofwoof.org/is01/search.htm Greetings: I'm brand new at trying to wrangle PHP into cooperating so please forgive my being so wet behind the ears. On the W3School's site there is code for a PHP/HTML/AJAX instant search which I want to integrate into my site. The code is at http://www.w3schools..._livesearch.asp The code works perfectly on the website example itself, but after I take the three code snippets (HTML,PHP,XML) and transfer them all as is into one folder in each of 2 hosting services, I have trouble. On both hosts the "input" search box appears (just HTML), but when I enter a letter into the box here's the story: On GoDaddy I get the following error message: Warning: DOMDocument::load() [domdocument.load]: Input is not proper UTF-8, indicate encoding ! Bytes: 0xAE 0x20 0x2D 0x2D in /home/content/36/6182436/html/instantsearchtrial/links.xml, line: 1 in /home/content/36/6182436/html/instantsearchtrial/livesearch.php on line 3no suggestion On Earthlink I get the code produced "no suggestion" message which is the code's indication that it hasn't found the data in an xml file. I do know that GoDaddy no longer supports PHP 4 and I couldn't figure out if the PHP code is 4 or 5. What do you think I might be doing wrong? Any help you might have to help me integrate that code into our website would be grand. Our site helps the 450 visitors a day to our site find medical and other nonprofit resources; they are often sick or scared and so we want the process to be as simple as possible. Thank you. Dr. C.
  17. Hello, regarding to this example in your website: this example display data from mysql database\table with parameter (dropdown list),and i do input the choices to this list,what if i want same this but the choices in the (dropdown list) come from database\table as well ? anyone can help me plz? this example containing two files as the following: 1. HTML File: <html><head><script type="text/javascript">function showUser(str){if (str=="") { document.getElementById("txtHint").innerHTML=""; return; }if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } }xmlhttp.open("GET","getuser.php?q="+str,true);xmlhttp.send();}</script></head><body><form><select name="users" onchange="showUser(this.value)"><option value="">Select a person:</option><option value="1">Peter Griffin</option><option value="2">Lois Griffin</option><option value="3">Glenn Quagmire</option><option value="4">Joseph Swanson</option></select></form><br /><div id="txtHint"><b>Person info will be listed here.</b></div></body></html> 2. PHP File: <?php$q=$_GET["q"];$con = mysql_connect('localhost', 'peter', 'abc123');if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("ajax_demo", $con);$sql="SELECT * FROM user WHERE id = '".$q."'";$result = mysql_query($sql);echo "<table border='1'><tr><th>Firstname</th><th>Lastname</th><th>Age</th><th>Hometown</th><th>Job</th></tr>";while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['LastName'] . "</td>"; echo "<td>" . $row['Age'] . "</td>"; echo "<td>" . $row['Hometown'] . "</td>"; echo "<td>" . $row['Job'] . "</td>"; echo "</tr>"; }echo "</table>";mysql_close($con);?> Thank you very much... Regards,
  18. sepoto

    htmlentities

    I am currently reading the title "Essential PHP Security". I see one of the topics is concerning the use of "htmlentities()". I have looked up the functions man page on php.net and I do understand what it is doing however I don't yet fully understand how the use of "htmlentities()" is supposed to make my application more secure. Could someone explain this a bit? Thanks!
  19. hi folks, iv gone into my sites php files via FTP to try and edit some sections, the problem im having is that its not a readable file. This is the message im getting:<?php @Zend;4147;/* ñ!This is not a text file!Þí */print <<<EOM<html><body><a href="http://www.zend.com/store/products/zend-safeguard-suite.php"><img border="0" src="http://www.zend.com/images/store/safeguard_optimizer_img.gif" align="right"></a><center><h1>Zend Optimizer not installed</h1></center><p>This file was encoded by the <a href="http://www.zend.com/products/zend_guard">Zend Guard</a>. In order to run it, please install the <a href="http://www.zend.com/products/zend_optimizer">Zend Optimizer</a> (available without charge), version 3.0.0 or later. </p><h2>Seeing this message instead of the website you expected?</h2>This means that this webserver is not configured correctly. In order to view this website properly, please contact the website's system administrator/webmaster with the following message:<br><br><tt>The component "Zend Optimizer" is not installed on the Web Server and therefore cannot service encoded files. Please download and install the Zend Optimizer (available without charge) on the Web Server.</tt><br><br><b>Note</b>: Zend Technologies cannot resolve issues related to this message appearing on websites not belonging to <a href="http://www.zend.com">Zend Technologies</a>. <h2>What is the Zend Optimizer?</h2><p>The Zend Optimizer is one of the most popular PHP plugins for performance-improvement, and has been available without charge, since the early days of PHP 4. It improves performance by scanning PHP's intermediate code and passing it through multiple Optimization Passes to replace inefficient code patterns with more efficient code blocks. The replaced code blocks perform exactly the same operations as the original code, only faster. </p><p>In addition to improving performance, the Zend Optimizer also enables PHP to transparently load files encoded by the Zend Guard. </p><p>The Zend Optimizer is a free product available for download from <a href="http://www.zend.com">Zend Technologies</a>. Zend Technologies also developed the PHP scripting engine, known as the <a href="http://www.zend.com/products/zend_engine">Zend Engine</a>.</p></body></html>EOM;exit();__halt_compiler();?> iv downloaded zend from the site which the message states but when i open it im getting the same file view, does this mean i cannot edit this file??any help would be very much appreciated.cheers folks!
  20. Im trying to upload a file to mysql using php and for some reason it doesnt work...could anyone help please..thanks in advance //Here goes the db connection //check for file upload if(isset($_FILES['csv_file']) && is_uploaded_file($_FILES['csv_file']['spredSheet'])){ //upload directory $upload_dir = "csv_dir/"; //create file name $file_path = $upload_dir . $_FILES['csv_file']['name']; echo ($_FILES['csv_file']); //echo "asd"; //move uploaded file to upload dir if (!move_uploaded_file($_FILES['csv_file']['tmp_name'], $file_path)) { //error moving upload file echo "Error moving file upload"; } //open the csv file for reading $handle = fopen($file_path, 'r'); //turn off autocommit and delete the product table mysql_query("SET AUTOCOMMIT=0"); mysql_query("BEGIN"); mysql_query("TRUNCATE TABLE $table") or die(mysql_error()); while (($data = fgetcsv($handle, 1000, ',')) !== FALSE) { //Access field data in $data array ex. $name = $data[0]; $quantity = $data[1]; //Use data to insert into db $sql = sprintf("INSERT INTO product_table (product_name, product_quantity) VALUES ('%s',%d)", mysql_real_escape_string($name), $quantity ); mysql_query($sql) or (mysql_query("ROLLBACK") and die(mysql_error() . " - $sql")); } //commit the data to the database mysql_query("COMMIT"); mysql_query("SET AUTOCOMMIT=1"); //delete csv file unlink($file_path); }
  21. Hello, I worked on pack, unpack function of php. I made a simple test by using pack and unpack function. I worte a simple code like <?php $SrcArry = array(10,20,30,40,50); $DestArry = array(); $Str = NULL; for ($i = 0;$i < 5;$i++) { $Str .= pack('I', $ScrArry[$i]); } $DestArry = unpack('I*',$Str); var_dump($SrcArry); var_dump($DestArry);?> I named this file MyTest.php. Now when I execute this file by using php MyTest.php I got the result like Result of var_dump($ScrArry) array(5) { [0]=> int(10) [1]=> int(20) [2]=> int(30) [3]=> int(40) [4]=> int(50) Result of var_dump($DestArry) array(5) { [1]=> int(10) [2]=> int(20) [3]=> int(30) [4]=> int(40) [5]=> int(50)} My question is this why index of array changed during pack unpack function like [0] => 10 in $ScrArry and[1] => 10 in $DestArry.When I assign source array in destionation array by using $SrcArry = $DestArry (without using pack/unpack) then my indexing of array is correct. Thanks and Regards,Antrikssh...
  22. Hello I've got a question about "AJAX Database Example" from w3schools page (linked here -> http://www.w3schools...ax_database.asp ) All works perfectly fine, but I want to adjust it to TWO select dropdowns and show the results only after the second one is selected (I pick the first select, then second one and after that results are shown). The problem is, I don't know exactly what I need to change in showUser function. Of course it needs to take 2 parameters and I have to create second select dropdown outside the function, but my knowledge about AJAX is too poor to make it work ; / Will somebody help me ? ; ) If already there is a topic about the same issue I'm really sorry, but I've got some problems with search module on this forum. Kinda doesn't show any results ;x
  23. i have 2 tables:1) father table.. (posts table)2)child table.. (comments table)now i ordered the results by (id of father) desc.....now what i want is if comment on some post,,,this post is being the first in the order!..any help please ?what query to use?
  24. Hi everybody, I am trying to write a code which record a CIDR (5.2.80.0/21 5.11.128.0/17) format ip list into mysql database. I have a problem at one part of my code. Code is the below. With this code I am trying to find every third "." character's place and every "/" character's place and every " " characters place. After finding the places the code record the places in to an array which name is $reference_points. The problem is that for exaple if I apply this code on this 5.2.80.0/21 5.11.128.0/17 string. The result should be $reference_points.[1]=7 $reference_points.[2]=9 $reference_points.[3]=12 but it shows $reference_points.[1]=7 $reference_points.[2]=9 $reference_points.[3]=23. And the full list of CIDR ip is attached. By the way I use a form on php page to take this list. The code part is which start fith FOR loop. Thak you very much. <div align="center"><form action="add_new_country.php" method="post"><table><tr><td>Country name:</td> <td><input type="text" maxlength="50" name="new_country_name" id="new_country_name" size="38" /></td></br></br></tr><tr><td>Country Ip Ranges:</td> <td><textarea rows="10" cols="30" name="country_ip_ranges" id="country_ip_ranges"> </textarea></td></br></br></tr><tr><td><input type="submit" name="submit" value="Add New Country" /></td><td></td></tr></table></form></div> <div align="center"><?phpif(isset($_POST["new_country_name"]) && isset($_POST["country_ip_ranges"]) && !empty($_POST["new_country_name"]) && !empty($_POST["country_ip_ranges"])){$country_name=@$_POST['new_country_name'];$country_ip_range=@$_POST['country_ip_ranges']; $sql=mysql_query("SELECT id FROM countries WHERE country_name='$country_name' LIMIT 1");$exist_count=mysql_num_rows($sql); if($exist_count==1){echo "The name of the country which you try to add is already exist in the system, please try to add different name.";}else{mysql_query("INSERT INTO countries (id,country_name) VALUES ('','$country_name')" );mkdir("$country_name");$dot=0;$reference_points=array();$reference_points_index=1; for($i=1;$i<=strlen(trim($country_ip_range));$i++){if(substr(trim($country_ip_range),$i-1,1)=='.' && $dot<3){$dot=$dot+1; if($dot==3){$reference_points[$reference_points_index]=$i;$dot=0;$reference_points_index=$reference_points_index+1;} }elseif(substr(trim($country_ip_range),$i-1,1)=='/'){$reference_points[$reference_points_index]=$i;$reference_points_index=$reference_points_index+1; }elseif(substr(trim($country_ip_range),$i-1,1)==' '){$reference_points[$reference_points_index]=$i;$reference_points_index=$reference_points_index+1;}}echo $reference_points[1].'<br/>';echo $reference_points[2].'<br/>';echo $reference_points[3].'<br/>';echo $reference_points[4].'<br/>';echo $reference_points[5].'<br/>';echo $reference_points[6].'<br/>';echo $reference_points[7].'<br/>';echo $reference_points[8].'<br/>';}}?></div> TR_cidr.txt
  25. Hi All, I need to login to zoho crm using a url which will be in my own site. But i am unable to do this as i read the zoho api, i got confused and i am not getting a right way to go forward. I need some code example or any good tutorial. Thanks,
×
×
  • Create New...