Search Results

Search found 31819 results on 1273 pages for 'sphinx php'.

Page 103/1273 | < Previous Page | 99 100 101 102 103 104 105 106 107 108 109 110  | Next Page >

  • How to run perl script with a few arguments from php

    - by Cristalla
    My html webpage calls php script to upload files to the server from a local computer as follows. <form enctype="multipart/form-data" action="upload.php" method="POST"> <p><b><h3> <font color="#003366"> (1) Upload your reading text file. </font> </h3> </b> </p> <INPUT type="file" name="uploaded" size="50" > <br/> <input type="submit" name="files" value="upload"> </form> In order to process with an uploaded file, my php script calls shell script $output=system('/bin/sh connector_0.sh'); and my shell script is composed of a series of python/perl scripts. #!/bin/sh python main_senselearner_final_0.py senseLearner.pl -i Uploaded_Files/slinput_0.txt -o Uploaded_Files/presloutput_0 .txt -model modelNNCollocations -model modelJJCollocations -model modelVBColloc ations -pos python smutngslout_0.py python genhtml_0.py Now, the problem is the following: all python scripts in shell script worked fine through php. But perl script didn't work. When I run shell script by myself in my server, all four scripts in shell worked perfectly. However, when I run shell script from php, only perl script doesn't work. Would you please give me any tips to solve this problem? Many thanks!!!

    Read the article

  • PHP Not Automatically Updating With ?reload=1

    - by user32007
    A friend built a ranking system on his site and I am trying to host in on mine via wordpress and godaddy. It updates for him but when I load it to my site, it works for 6 hours, but as soon as the reload is supposed to occur, it errors and I get a 500 timeout error. His page is at: jeremynoeljohnson .com/yakezieclub My page is currently at http://sweatingthebigstuff.com/yakezieclub but when you ?reload=1 it will give the error. Any idea why this might be happening? Any settings that I might need to change? Here is the top of the index.php file. I'm not sure which part of any of it is messing up. I literally uploaded the same code as him. Here's the reload part: $cachefile = "rankings.html"; $daycachefile = "rankings_history.xml"; $cachetime = (60 * 60) * 6; // every 6 hours, the cache refreshes $daycachetime = (60 * 60) * 24; // every 24 hours, the history will be written to - or whenever the page is requested after 24 hours has passed $writenewdata = false; if (!empty($_GET['reload'])) { if ($_GET['reload']== 1) { $cachetime = 1; } } if (!empty($_GET['reloadhistory'])) { if ($_GET['reloadhistory'] == 1) { $daycachetime = 1; $cachetime = 1; } } if (file_exists($daycachefile) && (time() - $daycachetime < filemtime($daycachefile))) { // Do nothing } else { $writenewdata = true; $cachetime = 1; } // Serve from the cache if it is younger than $cachetime if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile))) { include($cachefile); echo ""; exit; } ob_start(); // start the output buffer ?

    Read the article

  • PHP loop hanging/interspersed/threaded through HTML

    - by sandyv
    I can't figure out how to say what I'm talking about which is a big part of why I'm stuck. In PHP I often see code like this html <?php language construct that uses brackets { some code; ?> more html <?php some more code; } ?> rest of html Is there any name for this? Having seen this lead me to try it out so here is a concrete example whose behavior doesn't make sense to me <div id="content"> <ul id="nav"> <?php $path = 'content'; $dir = dir($path); while(false !== ($file = $dir->read())) { if(preg_match('/.+\.txt/i', $file)) { echo "<li>$file</li>"; ?> </ul> <?php echo file_get_contents($path . '/' . $file); } } ?> </div> Which outputs roughly <div><ul><li></li></ul><li></li>...</div> instead of <div><ul><li></li>...</ul></div> which is what I thought would happen and what I want to happen.

    Read the article

  • output all data from db to a php page

    - by Sarit
    Hi, I'm a real beginner with PHP & mysql. Just for studying and for a simple example at school I would like to work this simple query and possibly output all the rows (or maybe even one) to a very basic output on a php page: <?php $user= "root"; $host="localhost"; $password=""; $database = "PetCatalog"; $cxn = mysqli_connect($host,$user,$password,$database) or die ("couldn’t connect to server"); $query = "SELECT * FROM Pet"; $result = mysql_query($cxn,$query) or die ("Couldn’t execute query."); $row = mysqli_fetch_assoc($result); echo "$result"; ?> this is the error message i've been getting: Warning: mysql_query() expects parameter 1 to be string, object given in C:\xampplite\htdocs\myblog\query.php on line 18 Couldn’t execute query. What should I do? Thanks!

    Read the article

  • why resubmit after refresh php page

    - by user2719452
    why resubmit after refresh php page? try it, go to: http://qass.im/message-envelope/ and upload any image now try click F5, after refresh page "resubmit" Why? I don't want resubmit after refresh page What is the solution? See this is my form code: <form id="uploadedfile" name="uploadedfile" enctype="multipart/form-data" action="upload.php" method="POST"> <input name="uploadedfile" type="file" /> <input type="submit" value="upload" /> </form> See this is php code upload.php file: <?php $allowedExts = array("gif", "jpeg", "jpg", "png", "zip", "pdf", "docx", "rar", "txt", "doc"); $temp = explode(".", $_FILES["uploadedfile"]["name"]); $extension = end($temp); $newname = $extension.'_'.substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyz", 7)), 4, 7); $imglink = 'attachment/attachment_file_'; $uploaded = $imglink .$newname.'.'.$extension; if ((($_FILES["uploadedfile"]["type"] == "image/jpeg") || ($_FILES["uploadedfile"]["type"] == "image/jpeg") || ($_FILES["uploadedfile"]["type"] == "image/jpg") || ($_FILES["uploadedfile"]["type"] == "image/pjpeg") || ($_FILES["uploadedfile"]["type"] == "image/x-png") || ($_FILES["uploadedfile"]["type"] == "image/gif") || ($_FILES["uploadedfile"]["type"] == "image/png") || ($_FILES["uploadedfile"]["type"] == "application/msword") || ($_FILES["uploadedfile"]["type"] == "text/plain") || ($_FILES["uploadedfile"]["type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document") || ($_FILES["uploadedfile"]["type"] == "application/pdf") || ($_FILES["uploadedfile"]["type"] == "application/x-rar-compressed") || ($_FILES["uploadedfile"]["type"] == "application/x-zip-compressed") || ($_FILES["uploadedfile"]["type"] == "application/zip") || ($_FILES["uploadedfile"]["type"] == "multipart/x-zip") || ($_FILES["uploadedfile"]["type"] == "application/x-compressed") || ($_FILES["uploadedfile"]["type"] == "application/octet-stream")) && ($_FILES["uploadedfile"]["size"] < 5242880) // Max size is 5MB && in_array($extension, $allowedExts)) { move_uploaded_file($_FILES["uploadedfile"]["tmp_name"], $uploaded ); echo '<a target="_blank" href="'.$uploaded.'">click</a>'; // If has been uploaded file echo '<h3>'.$uploaded.'</h3>'; } if($_FILES["uploadedfile"]["error"] > 0){ echo '<h3>Please choose file to upload it!</h3>'; // If you don't choose file } elseif(!in_array($extension, $allowedExts)){ echo '<h3>This extension is not allowed!</h3>'; // If you choose file not allowed } elseif($_FILES["uploadedfile"]["size"] > 5242880){ echo "Big size!"; // If you choose big file } ?> if you have solution, please edit my php code and paste your solution code! Thanks.

    Read the article

  • JQuery post to php

    - by RussP
    Why is it that I can never get JQuery serialize to work properly. I guess I must be missing something. I can serialize a form data and it shows in an alert: var forminfo = $j('#frmuserinfo').serialize(); alert(forminfo); I then post to my PHP page thus: $j.ajax({ type: "POST", url: "cv-user-process.php", data: "forminfo="+forminfo, cache: false, complete: function(data) { } }); But WHENEVER (not the first time) I try to insert/update the data in the DB I only ever get 1 varaible passed: Here is my PHP script: $testit = mysql_query("UPDATE cv_usersmeta SET inputtest='".$_POST['forminfo']."' WHERE user='X'"); the data passed only ever gets the first variable. why? I think it is more the way I deal with the php but it drives me nuts and always takes me far too long to find where I am going wrong.

    Read the article

  • PHP: Object Oriented Programming -> Operator

    - by oman9589
    So I've been reading through the book PHP Solutions, Dynamic Web Design Made Easy by David Powers. I read through the short section on Object Oriented PHP, and I am having a hard time grasping the idea of the - operator. Can anyone try to give me a solid explanation on the - operator in OOP PHP? Example: $westcost = new DateTimeZone('America/Los_Angeles'); $now->setTimezone($westcoast); Also,a more general example: $someObject->propertyName Thanks

    Read the article

  • PHP Download File with Include

    - by arik-so
    How can I use PHP's include function to include a file and then modify the headers so it forces - at least that's how it's called - browsers to download ITSELF (the PHP file). Is it possible to also modify the preset save name, in order to change the extension from *.php to something else? Thanks in advance!

    Read the article

  • Socket php server not showing messages sent from android client

    - by Mj1992
    Hi I am a newbie in these kind of stuff but here's what i want to do. I am trying to implement a chat application in which users will send their queries from the website and as soon as the messages are sent by the website users.It will appear in the android mobile application of the site owner who will answer their queries .In short I wanna implement a live chat. Now right now I am just simply trying to send messages from android app to php server. But when I run my php script from dreamweaver in chrome the browser keeps on loading and doesn't shows any output when I send message from the client. Sometimes it happened that the php script showed some outputs which I have sent from the android(client).But i don't know when it works and when it does not. So I want to show those messages in the php script as soon as I send those messages from client and vice versa(did not implemented the vice versa for client but help will be appreciated). Here's what I've done till now. php script: <?php set_time_limit (0); $address = '127.0.0.1'; $port = 1234; $sock = socket_create(AF_INET, SOCK_STREAM, 0); socket_bind($sock, $address, $port) or die('Could not bind to address'); socket_listen($sock); $client = socket_accept($sock); $welcome = "Roll up, roll up, to the greatest show on earth!\n? "; socket_write($client, $welcome,strlen($welcome)) or die("Could not send connect string\n"); do{ $input=socket_read($client,1024,1) or die("Could not read input\n"); echo "User Says: \n\t\t\t".$input; if (trim($input) != "") { echo "Received input: $input\n"; if(trim($input)=="END") { socket_close($spawn); break; } } else{ $output = strrev($input) . "\n"; socket_write($spawn, $output . "? ", strlen (($output)+2)) or die("Could not write output\n"); echo "Sent output: " . trim($output) . "\n"; } } while(true); socket_close($sock); echo "Socket Terminated"; ?> Android Code: public class ServerClientActivity extends Activity { private Button bt; private TextView tv; private Socket socket; private String serverIpAddress = "127.0.0.1"; private static final int REDIRECTED_SERVERPORT = 1234; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); bt = (Button) findViewById(R.id.myButton); tv = (TextView) findViewById(R.id.myTextView); try { InetAddress serverAddr = InetAddress.getByName(serverIpAddress); socket = new Socket(serverAddr, REDIRECTED_SERVERPORT); } catch (UnknownHostException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } bt.setOnClickListener(new OnClickListener() { public void onClick(View v) { try { EditText et = (EditText) findViewById(R.id.EditText01); String str = et.getText().toString(); PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true); out.println(str); Log.d("Client", "Client sent message"); } catch (UnknownHostException e) { tv.setText(e.getMessage()); e.printStackTrace(); } catch (IOException e) { tv.setText(e.getMessage()); e.printStackTrace(); } catch (Exception e) { tv.setText(e.getMessage()); e.printStackTrace(); } } }); } } I've just pasted the onclick button event code for Android.Edit text is the textbox where I am going to enter my text. The ip address and port are same as in php script.

    Read the article

  • htaccess to not show index.php in sub directory

    - by Jamesaa
    I have a simple page structure like below /directory/subdir_1/index.php /directory/subdir_2/index.php .... (there are no other files in these directories) is it possible to have 'fake/pretty' urls for the above files as below? /directory/subdir_1 /directory/subdir_2 ... so this path would show whether the visitor typed that,/directory/subdir_2/ or /directory/subdir_2/index.php. Many thanks

    Read the article

  • replacing variables in output in php

    - by Thorpe Obazee
    Right now I have this code. <?php error_reporting(E_ALL); require_once('content_config.php'); function callback($buffer) { // replace all the apples with oranges foreach ($config as $key => $value) { $buffer = str_replace($key, $value, $buffer); } return $buffer; } ob_start("callback"); ?> some content <?php ob_end_flush(); ?> in the content_config.php file: $config['SiteName'] = 'MySiteName'; $config['SiteAuthor'] = 'thatGuy'; What I want to do is that I want to replace the placeholders that with the key of the config array with its value. Right now, it doesn't work :(

    Read the article

  • php to translate GET request to POST request

    - by DennyHalim
    i have a hosted script somewhere that only accept POST request. example, some.hosted/script.php how can i setup another simple php that can accept GET request and then POST it to the hosted script. so that i can put up a link like this: other.site/post2hostedscript.php?postthis=data and then it POST postthis=data to the hosted script. tnx

    Read the article

  • PHP CURL sending POST to Django app issue

    - by Felipe Pelá
    This code in PHP sends a HTTP POST to a Django app using CURL lib. I need that this code sends POST but redirect to the page in the same submit. Like a simple form does. The PHP Code: $c = curl_init(); curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); curl_setopt($c, CURLOPT_URL, "http://www.xxx.com"); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, 'Var='.$var); curl_exec($c); curl_close ($c); In this case, the PHP is sending the HTTP POST, but is not redirecting to the page. He is printing the result. My URL still .php and not a django/url/ I need be redirected to the django URL with the Post like a simple form in HTML does. Any Idea? Thanks.

    Read the article

  • how to use alert in php and js combined

    - by user295189
    have a need to alert through php, I have the code below. Problem is that it works as long as I dont use header redirect. But as soon as I use it..I loose alert. echo "I will do some functions here in php"; if($value == 1){ alert('ok working'); } header(location: 'someOtherpagethanthis.php');

    Read the article

  • PHP app.yaml, new to GAE, not sure of how to setup

    - by chetweewax
    I have a single page website built on bootstrap 3, that I am trying to move to Google Apps Engine. I Scaffold my sites using php, and all the content is showing but not the styles and javascript. My site is basically set up as follows _/js/bootstrap.js _/js/custom.js _/fonts/glypicon ...etc _/css/bootstrap.css _/css/custom.css _/php/ .. all my php files go here ... index.php can someone help me setup my app.yaml for this? I am new to GAE, and am a little confused by this.

    Read the article

  • Undefined index: email in C:\wamp\www\emailvalidate.php on line 4

    - by klari
    I am new to Ajax. In my Ajax I get the following error message : Notice: Undefined index: address in C:\wamp\www\test\sample.php on line 11 I googled but I didn't get a solution for my specified issue. Here is what I did. HTML Form with Ajax (test1.php) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script> function loadXMLDoc() { var xmlhttp; 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("mydiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("POST","test2.php",true); xmlhttp.send(); } </script> </head> <body> <form id="form1" name="form1" method="post" action="sample.php"> <p> <label for="mail"></label> <input type="text" name="mail" id="mail" onblur="loadXMLDoc()" /> <input type="submit" name="submit" id="submit" value="Submit" /> </p> <p><div id = 'mydiv'></div></p> </form> </body> </html> test2.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php echo "Your Address is ".$_POST['address']; ?> </body> </html> I am sure it is very simple issue but I don't know how to solve it. Any help ?

    Read the article

  • header problem in php refresh

    - by basma
    hello i have this code : <?php session_start(); echo "".$_SESSION['eventnum'].""; $urlRefresh = "testremot.php"; header("Refresh: 5; URL=\"" . $urlRefresh . "\""); ?> but the header doesnt work and this warning appear when i try to run this code : Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\remot\testremot.php:3) in C:\xampp\htdocs\remot\testremot.php on line 5 can you please help me ?

    Read the article

  • where is wrong in my php code ????

    - by user318068
    hi all, <td align="center" bgcolor="#FFFFFF"><?php echo '<label onclick="window.open('profilephp.php?member=$row['MemberID']','mywindow')">'.{$row['MemberName']}.'</label>';?><br /> <?php echo "<p align='center'><img width='100' height='100' src={$row['MemberImg']} alt='' /></p>";?></td></tr> Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\home - Copy\membercopy.php on line 141 I really don't know where it went wrong. Please help,

    Read the article

  • Gmail,Yahoo, Facebook, Twitter contacts importer in PHP

    - by Arjun
    Which is the greatest, cheapest application in PHP that I can buy to import Gmail, Yahoo, MSN, Facebook, Twitter contacts from my user's accounts if they wish to invite their friends? I have gone through: http://www.improsys.com/importer.htm http://www.octazen.com/demo.php and http://www.iplussoft.com/product/iplusinvite_pricing Octazen looks awesome but wants excess of $320 for an all in solution. I don't want to spend that much. All you PHP programmers out there you may have needed to build of integrate a similar app, I need to know which is the best PHP readymade app for this? Any help would be appreciated and I'll smile with each answer - this should be your biggest incentive to find me something amazing :)

    Read the article

  • php regular expression assistance bold a filename

    - by jason
    I am not very good, with regular expression in php I am trying to get a reg_expression to find all file names such as /file-name-here.php and make it bold. This expression works in Flash but not in php it also doesn't accept the '-' i'm not sure why i can't get it to work with preg_replace /(https?://)?(www\.)?([a-zA-Z0-9_%]*)\b\.[a-z]{2,4}(\.[a-z]{2})?((/[a-zA-Z0-9_%]*)+)?(\.[a-z]*)?/g

    Read the article

  • Php + mysql transactions examples

    - by Donator
    I really haven't found normal example of php file where mysql transactions are being used. Can you show me simple example of that? And one more question. I've already created a lot of programming and didn't use transaction, maybe I can put any php function or smth to header.php that if one mysql_query fails, then others too? Thank you.

    Read the article

< Previous Page | 99 100 101 102 103 104 105 106 107 108 109 110  | Next Page >