How can I detect if the user is on localhost in PHP?
In other words, how can I tell if the person using my web application is on the server it resides on? If I remember correctly, PHPMyAdmin does something like this for security reasons. ...
In other words, how can I tell if the person using my web application is on the server it resides on? If I remember correctly, PHPMyAdmin does something like this for security reasons. ...
Hi ...., I've deployed simple machine forum at smf.com domain, and than I created simple application to read session from the smf.com, but i deployed the simple application in the subdoamin, let say I put my simple application in simple.smf.com In order to read session from domain, I must put ini_set("session.cookie_domain",".smf.com");...
i want to import all the data variables from a php file. but if i write: include 'user.php'; it loads that php file instead of the current file. any solutions? ...
Can we use input type value in session variable without any form submitting like there is an input field now i want to save above input field value in a $_session['anyname']; when there is no form in page. ...
hello! i got a form: <form name="form2" method="POST" action="post.php"> <p>ba$lik: <input type="text" name="baslik" size="90"></p> <p>spot kisa: <textarea name="spot_kisa"></textarea></p> <p>spot uzun: <textarea name="spot"></textarea> </p> <p>kategori: <select name='kategori'> <? while ($kat=mysql_fetch_array...
Hi all, I have a c++ app, which I launch from a php script (see below). The app compiles, and runs fine when I interact with it on the cli on boths Windows and OSX (separate executables for each). When I launch the script on OSX the app and script both run fine, but when I run it under windows the app process refuses to die but sits idl...
I'm trying to use vsprintf() to output a formatted string, but I need to validate that I have the correct number of arguments before running it to prevent "Too few arguments" errors. In essence I think what I need is a regex to count the number of type specifiers, but I'm pretty useless when it comes to regex and I couldn't fund it anyw...
Hi everyone. I appreciate your effort tat helping newbies like me. I have the following problems and will appreciate urgent help. PROBLEM NUMBER 1: Using PHP and MySQL, I am able to upload picture successfully unto the server but not so with the file name of the picture even though other parameters in my form got inserted successfuly i...
I am trying to take a flat array and recreate it so that it's multidimensional. I've been looking into array_combine and array_merge, but I'm not sure that either of those will give me what I'm hoping for... The array, in it's current form (and this is just a simplified example): Array ( [0] => stdClass Object ( ...
wahta i m asking is... i have some value in p tag eg. Hello now i want that is there any way to get the value inside in a php variable( eg. $getIT)( session variable or normal varaibale or global variable) so that when i do echo $getIT then it print Hello; ...
How to remove the last character only if it's a period? $string = "something here."; $output = 'something here'; ...
I just want to include an HTML file server-side into another HTML file, using JSP. PHP is not available. Is this what I want? <jsp:include page="/include.html"></jsp:include> ...
This is the error that I am getting while using mysql_num_rows() function Error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource Here is my source code: $title = "SELECT * FROM item WHERE item.title LIKE % " .implode("% OR item.title LIKE % ", $data); $title_result = mysql_query($title, $this->dbh);...
I have the following sql statement: start_time = ADDDATE(start_time, INTERVAL $minuteDelta MINUTE), end_time = ADDDATE(end_time, INTERVAL $minuteDelta MINUTE) start_time and end_time are both time fields in my database (not datetime) $minuteDelta is 60 for argument's sake Right now it doesn't throw an error but resets my time fie...
I have read that PHPs "probable" weakness is how it handles "concurrency". With only sessions and cookies to keep track of user state, how can PHP handle the following situations with high accuracy: multiple users check out with one item that has only 1 stock in inventory (sorry for grammar mistakes, but you pretty much get the picture...
Is there a way to mask the URL extensions for pages on my website with PHP? Example: http://home/subfolder instead of http://home.subfolder.php ...
Can someone tell me what I'm doing wrong? I cannot get the affected rows returned after a row has been deleted. The function always returns int(0) even though the delete action was preformed. I read where I needed to clear or close the results which I have done but it still does not work. A debug shows this error: Command out of sync. Th...
I have a variable with a 2 digit month number.. is there a built in function that allows me to change it to the month name. I thought maybe the date() function would work, but that requires a full timestamp. Thanks! ...
I've got a multidimentional array such as: $array = array( array('test'=>23, 'one'=>'etc' , 'blah'=>'blah'), array('test'=>123, 'one'=>'etc' , 'blah'=>'blah'), array('test'=>33, 'one'=>'etc' , 'blah'=>'blah'), ); How to I search the array for all the keys 'test' and get the value? I wish to add all of the values of 'test' found ...
The form and PHP code included here has been used to successfully upload a file name to the database and the file itself to a folder on the server. I need to edit the form and the code to allow for simultaneous upload of two files instead of just one. The filenames will go to the database while the files themselves will go to a folder ...