It's actually a combination of php and bash:
exec(sprintf("%s > %s 2>&1 & echo $! >> %s", $cmd, $outputfile, $pidfile));
I don't understand what 2>&1 & echo $! is there for?
hey guys
im using a form in php to submit some information into my database
so i used two function to do this
but how to show the result in th same page that has the form
The following is my DB data, how can I sorting it by sid and prev_sid with php/mysql!?
sid prev_sid type
000 197 app_home
197 198 page_teach
198 218 page_teach
199 211 page_step
211 207 link
218 559 page_step
559 199 page_step
Result:
sid prev_sid type
000 197 app_home
197 198 page_teach
198 218 page_teach
218 559 page_step
559 199 page_step
199 211 page_step
211 207 link
000 197 198 218 559 199 199 211 207
I want to parse this
(adv) much (thanks)
I want to eliminate the words and the bracket (adv) but not (thanks)
the condition is:
inside bracket, and word length inside bracket is 1-5 characters
I am using preg_match in PHP
Thank You
DO they use a php page to analyze the link, and return all of the images as josn?
Is there a way to do this with just javascript, so you dont have to go to the server to analyze the page?
Trying to replace the first 12 digits of credit card numbers with X's in a predictable blob of text that contains the string:
Credit Card Number: 1234123412341234
Here's my PHP function:
preg_replace('/Credit Card Number: ([0-9]{12})/','Credit Card Number: XXXXXXXXXXXX',$str);
Help?
Hey guys i'm using phpmyadmin (php & mysql) and i'm having alot of trouble linking the tables using foreign keys.
I'm getting negative values for the field countyId (which is the foriegn key). However it is linking to my other table fine and it's cascading fine.
So when I go to add data there will be a drop box for the CountyId and the vlaues will look something like this,
"
-1
1-
"
Here is my alter statement,
ALTER TABLE Baronies
ADD FOREIGN KEY (CountyId)
REFERENCES Counties (CountyId)
ON DELETE CASCADE
Hai frnds i am new to php actually i am facing following problems in coding please can anyone give the solution?
Actually i am having one audio player and i am displaying some word dcoument
if i click word document corresponding audio file should play
actually when i click doc file it should pop ip with save as and open with for that i am using some header code
also i am passing query string in the browser
query string is not working if i use header
can anyone give me a solution for it below is my code i am attaching
<?php
$f_name = $_POST["fn"];
$id = $_POST["id1"];
echo $id;
//echo "../public_html/sites/default/files/ourfiles/$f_name";
$res2=db_query("select * from mt_files where id='".$id."' ");
$row2=db_fetch_array($res2);
$job_audio=$row2["audio_name"];
//echo $job_audio;
//$job_audi=explode("/",$job_audio);
//$job_audio=$job_audi[8];
$job_audio= "C:/xampp/htdocs/med/sites/default/files/audio/$job_audio";
//$job_audio= "C:/Documents and Settings/swuser/My Documents/$job_audio";
//echo $job_audio;
echo "<object data='$job_audio' type='application/x-mplayer2' width='150' height='45'>
<param name='src' value='$job_audio'>
<param name='autoplay' value='true'>
<param name='autoStart' value='1'>
</object> ";
$file = "../mts/sites/default/files/docs/$f_name";
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
//The download table query goes here put the $f_name in insert into with the //time varible
?>
I'm trying to create a BBS using PHP and SQL, and I want to make it so the topic with the most current post is on top of the topic list. what is a easy way to check if one date and time is more current than another?
Currently im just using something like:
in the DB Table:
access: home,register,login
and then in each page:
if(!Functions::has_rights('content'))
{
Functions::noAccess();
}
is there more efficient way to do it, php & MySQL? i may want to gain access even to several parts a page, for example: user can read a page, but doesnt comment to it, and I dont want to build a separate system to each module.
Thanks in advanced, Tal.
I've no idea with command line stuff!
What i've done:
changed my php.ini to phar.require_hash - off
ran go-pear.bat
so i'm pretty sure i've got PEAR installed,
now I'd like to install this package
I've tried following the instructions but I really don't know how to do things with cmd.exe,
would love some help!
Hi,
I have a folder for downloads on my server, i want to prevent direct access to that folder so i am makin it pass-protected with htaccess and i will push download with a php script. But i have some questions regarding mkdir and file_exists
Do mkdir and file_exists works good for pass-protected folders ?
and
would i get any error while uploading file to that folder ?
AND
is this a good way of preventing direct access ?
thanks
Not sure if this is possible..basically a server forwards/bridges an incoming connection
Client - Server - Destination
Now, rather than a normal proxy script on the server(or a simple redirect),
1) the Destination sees the incoming connection as from the CLIENT (not from the SERVER).. aka masking the server
2) the Server in the middle streams the data back to the client(without downloading it first, then passing it)
Anyone know how to do this or something like it in PHP ?
How can i fetch all data from any table of a test DB and DUMP it on the production db in same tablename(structure)? in Mysql using PHP code?
Please help me..
I need to take a file and move it to a windows machine on a specific folder where it is then to be printed automatically. How would I accomplish something like this? Is it possible with PHP?
I found this site is just what I need.
http://www.freeingweb.com/
I want to build a personal Poxey tool coz quite a lot of great sites were blocked for me. Which technique should I learn? Is PHP enough for the job?
hey, i have this path name from an input element interesse[angebote][flurfuerderfahrzeuge] as a string in my php var. now i need convert it somehow (with regex or explode()) so it looks like this: $_POST['interesse']['angebote']['flurfuerderfahrzeuge'] and the use eval() to get the value. But I'm sure there must be a much easier way do this.
Any ideas? Thanks!
For a few days now I'm using NetBeans 6.8 for doing PHP work.
But even if a class-file is included and the methods are public and there's phpDoc used, NetBeans everytime shows "No Suggestions" in the window.
E.g. I type
$user->
and press CTRL+Space, I do expect all the methods and variables but there aren't shown any. ideas?
To begin with, I just can say that I have always been programming by my own. I use php mostly. So, can you explain me why I should learn Zend Framework or other framework? Why just don't write a pure code by own?
<?php
echo (2884284 >> 16), '<br>'; // = 44
echo ((2884284 >> 16) & 0xFFFF), '<br>'; // 44
from the above i got 44
so how can i retrive from 44 to 2884284 ???
Hi,
I'm wondering how facebook extracts the right picture of the article from a link? they ignore any icons, ads images, or other not related images, & they gives you the right image?
What technique/method they use? because i've tried to extract all images using a php regex but how to find the right one?
Thanks
I'm using wordpress, and I want to add the adsense javascript tags where the Read More tag goes in a blogpost. It's stored as <!--more--> in the database, but when you use the_content() this is automatically changed before I have the chance to use a str_replace() function.
I'm looking to place an adsense tag for each post in the single.php page where the teaser ends. Has anyone been able to do this?
I have a table with my products and I'm trying to write a page that would pull bracelets with certain colors from the database. So here's what I have right now (in php):
$query = "SELECT * FROM products WHERE (products.colors LIKE '%black%')";
But I only want to select rows where the value for the column "category" equals "bracelet".
I've tried a few different things, but I keep getting warnings and errors. I appreciate any help you can give, thank you!
I start to learn class in PHP. According to my experience with other language, i can tell class is different then function. So, how we spot if our class start to be too much and too important and how we minimize its impact ?