-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
That's a client side request. If you try via PHP you probably need an external program. (an external program will probably hit the router) you will need to use a client side script like Javascript, VBS etc however its classed as a security risk to the client, here's a VBS example (untested) try{ var x = new ActiveXObject("WScript.Network"); document.write('Computer: ' + x.ComputerName + '<br />'); }catch (e){ document.write('Permission to access computer name is denied' + '<br />'); } But your need the clients to add the site to the trusted zone in IE (won't work in other browser) or your just get a permission denied error Tools -> Internet Options -> Security tab -> Trusted sites Zone -> Sites... and Initialize and script ActiveX controls not marked as safe That's the hostname not the computer name! EDIT: updated script
-
No options will be 100%, I could always set my PC to record from my Mic and Play from speaker and connect the ports together.. (that's low-tech but you get the idea) however.. it maybe worth looking into media steaming server, however that can be captured but is a little harder then just grabbing from temp, If you had to play a full MP3 and wanted to "reduce" the risk.. then maybe try getting a flash MP3 player The have the flash player, play a MP3 that's parsed via a PHP script, the PHP script loads the files from a folder outside the public domain and requites a token sent from the flash player so the flash player would load a file like getMP3.php?file=madtechie.mp3&token=465f7846abce the getMP3.php will check the token with the session, then generate a new token and then open the MP3 from its folder
-
I do agree with this, but once I have seen their code, I then have a better idea of what they are good at, so know what projects to hand their way, I would never hire a developer to write something that would take me over 2 weeks to write without seeing a few examples of their code first. but would hand a smaller project to get an idea (even if I had the time to write it myself) -MadTechie 1 20 Years experienced Fisherman (on and off) 2 14 Years Full Driving license (no points) 1been fishing about 20 times 2I can but don't drive procrastination, and [..I'll write the rest later..]
-
then set the Content-type to the type of the file! curl_setopt ( $ch , CURL_HTTPHEADER , "Content-type: ".$_FILES['foto']['type'] )
-
Technically for something to play on your PC it needs to "downloaded" the media so users could save anything your site supplies, your best and simplest solution is to only allow sample downloads
-
does /members/{$memberType} exist ? also dirname should be used with FILE paths try mkdir("/members/{$memberType}", 0777); mkdir("/members/{$memberType}/{$userName}",0777); mkdir("/members/{$memberType}/{$userName}/mp3",0777); mkdir("/members/{$memberType}/{$userName}/images",0777); mkdir("/members/{$memberType}/{$userName}/include",0777);
-
That's what my girl friend always say! I would probably do this <?php $lines = file('details.csv'); foreach ($lines as $line) { $details = explode(",",$line); $account = $details[1]; //second row = account $phone = $details[5]; //sixth row = phone $path = "/accounts/files/"; if(file_exists($path.$account) && is_file($path.$account)) { rename($path.$account.".txt", $path.$phone.".txt"); //rename account to phone echo "account $account changed to $phone<br />\n"; }else{ echo "<strong>account $account NOT found</strong><br />\n"; } } ?> I assumed the CSV had account on the second row and number on the sixths remember back and trial test EDIT: this isn't perfect but should give you the basic idea!
-
Do you have a way to link the account number to the phone number ? if so then yes, you could just use a loop to rename account to the phone..
-
add curl_setopt ( $ch , CURL_HTTPHEADER , "Content-type: multipart/form-data" ) EDIT: also please use code tags [ code] and welcome to PHPFreaks
-
isn't valid it should be $Username = preg_replace('/[^a-z0-9]/i','', $Username); *nb: i removed the pointless s & m (my bad) but you need the quotes also $Username = $_POST[username]; should really be $Username = $_POST['Username']; (not sure what happening with your single quotes
-
True, but if you do a bulk in insert with arrayA then how will you get all the ID's (i mean what if another insert is made while your doing this ?) maybe a paired insert INSERT INTO TableA (fields) VALUES ($dataA); INSERT INTO TableB (fields,id) VALUES ($dataB,LAST_INSERT_ID) *Should i move this to MySQL section ?*
-
as jcombs said or get a web designer..
-
Hummm examples look generic .. I'm sorry but i have no idea what your looking for
-
So solved (doesn't look like it)? if so click the topic solved button
-
You mean like loop from 1 array (Array A) and then getting the returned ID and saving that in array B then on the Array B loop your have all the ID's required so instead of looping you could so one massive insert, ie (sorry typed it direct so no tabs etc ) $arrayA = array(array("blar", "blar2","blar2"),array("blar3", "blar4", "blar5")); $arrayB = array(array('field1' => "blar", 'field2' => "blar2", 'field3' => "blar3"),array( 'field1' => "blar4", 'field2' => "blar5", 'field3' => "blar6")); foreach($arrayA as $K => $A) { //insert data $uID = retuned data $arrayB[$K]['uID'] = $uID; } $data = ""; foreach($arrayB as $B) { $data .= "('{$B['field1']}','{$B['field2']}','{$B['field3']}','{$B['uID']}'),"; } $data = trim($data,","); //remove last , echo "INSERT INTO table (`field1`, `field2`, `field3`, `fID`) VALUE $data";
-
Erm.. any code will just post html or css. why you against downloading an example?
-
Just one thing remaining then.. clicking of the topic solved button (bottom left)
-
@Garethp s = dot matched new lines (kinda pointless in the example given) i = make is case insensitive. m = mean ^$ matches line breaks (instead of full string) so only i was needed, but I have been working on some large files so I have typed sim on most of them and didn't review my post so they creped in .. I use / by default, if my regex has a / then I use % just a habit no real reason for it
-
pure CSS http://www.cssmenus.co.uk/dropdown.html enjoy
-
Yeah personal preference, the i make is case insensitive.
-
But if you look at the curl http_code is 0 and NOT 404 as expected so I say domain not found at all!
-
Wanna bet money on that ? EDIT: Let say 5 buck, deal ?
-
If you put it in the freelance section and pay me then maybe! this isn't hard //Set a variable from post $Username = $_POST['Username']; //filter out any characters that are not A-Z or 0-9 $Username = preg_replace('/[^a-z0-9]/sim', '', $Username); echo $Username; //echo clean version
-
Basic result is server host not found.. try pinging server from PHP server (check IP returned if any), check 'A Record's / Name server