-
Posts
334 -
Joined
-
Last visited
Everything posted by inversesoft123
-
Set permissions to the user if you have already added user to database. or add the user to the database. let me know what you have done with user and database. or trying to connect database without user ?
-
Quick Question regarding uploading image paths to an sql DB
inversesoft123 replied to svgmx5's topic in PHP Coding Help
But beware designing uploading script as someone can upload Trojans and harmful virus related files on your server. You must strictly check that uploaded file is a valid image file or not. You can check it by opening file and reading first few characters of file Somthing Like $f = @fopen($_FILES['uploadedfile']['tmp_name'],'r'); $s = @fread($f,4); @fclose($f); if($s != "ÿØÿà"){ echo “Invelid File”; } -
Quick Question regarding uploading image paths to an sql DB
inversesoft123 replied to svgmx5's topic in PHP Coding Help
Upload Image use HTML upload. then copy and unlink image. copy($HTTP_POST_FILES['uploadedfile']['tmp_name'],"/home/domainfolder/public_html/files/location/$userid/".$hashedfilename); unlink($HTTP_POST_FILES['uploadedfile']['tmp_name']); Then save this filename in database mysql_query("INSERT INTO tableprefix_uploads SET uid='".$uid."', type='filetype', cdate='".$todate."', name='".$filenamename."', hashedname='".$hashedfilename."'"); if you need full script send me request. -
There is no need to change permissions on suPHP enabled servers. after rebuilding apache my problem was solved
-
Function name must be a string whats the error ? pls help
inversesoft123 replied to inversesoft123's topic in PHP Coding Help
awww, thanx PFMaBiSmAd -
its batter if you break text with paragraphs aor explode its from fullstops.
-
catching a proper file from remote server plz help..
inversesoft123 replied to inversesoft123's topic in PHP Coding Help
Still waiting 4 reply .,, unsolved... -
catching a proper file from remote server plz help..
inversesoft123 replied to inversesoft123's topic in PHP Coding Help
$fh = fopen("testvideo.flv", "w"); fwrite($fh, $file1); fclose($fh); yeah but unable to write data into file. File remains blank after execuation of code. -
catching a proper file from remote server plz help..
inversesoft123 replied to inversesoft123's topic in PHP Coding Help
$fh = fopen(testvideo.flv, "w"); fwrite($fh, $file1); fclose($fh); Tried this but no success. -
I am having a problem to read file from remote url. at this stage I have successfully grabbed a video from YouTube and link which is generated is. $link = http://v14.lscache2.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor&fexp=901421%2C900033%2C903105&algorithm=throttle-factor&itag=5&ipbits=0&burst=40&sver=3&expire=1263679200&key=yt1&signature=76BE713D53D80C026AB6BDB2B83C82FF545B56B8.8626535B14E415A063E18531C0DEFFE78D4E2678&factor=1.25&id=30b46ae0eadc46df which offers a file to download video.flv now my problem is i want to save this file to localhost. I have tried using $file1 = file("$link?$QUERY_STRING"); $file1 = @implode("", $file1); // echo "$file1"; echo "$file1"; gives raw data of file FLV ��� ���� � 8������� � onMetaData ��� � duration�@Aó33333� starttime���������� totalduration�@Aó33333� width�@y������� height�@l@������ videodatarate�@r ¬ë ®Ó� audiodatarate�@M”}¹óÓ–� totaldatarate�@vB˜'’.Ž� framerate�@>������� bytelength�A8h®����� canseekontime � sourcedata � B4A7D0108HH�������.......... and grabbed file data. Now, I want to save it on my local drive so that i can convert it by using FFMPEG Please help me.
-
How to reset/reload php.ini file
inversesoft123 replied to inversesoft123's topic in PHP Installation and Configuration
-
How to reset/reload php.ini file
inversesoft123 replied to inversesoft123's topic in PHP Installation and Configuration
I dig into issue and studied apache documentations and found that suEXEC loads php.ini file from root of every user on server or VPS. if you make any changes in .htaccess regarding file upload limit etc server returns Internal Server Error. This problem can be solved by changing values in php.ini on root of respective user. but now a days newer versions of suphp do not allow changes in php.ini in root unless server administrator permits it from server root. Server administrator can load different ini files per user adding following line inside httpd.conf <VirtualHost IP***> per user like suPHP_ConfigPath /home/username/public_html/[iF ANY:subdomainfolder]/php.ini Hope this information helps others who are dealing with php.ini issue on cpanel/WHM and suphp enabled servers. -
How to reset/reload php.ini file
inversesoft123 replied to inversesoft123's topic in PHP Installation and Configuration
The email client script which I ware using was based on cgi.. But now I have uninstalled that script.. At the time of installation of that script the installer warned me that this will reload your php.ini Also sory for posting topic here. -
How to reset/reload php.ini file
inversesoft123 replied to inversesoft123's topic in PHP Installation and Configuration
Restarted server and reloaded php.ini file at same location and all my problems are now fixed. but is there any way to relaod it back ? -
How to reset/reload php.ini file
inversesoft123 replied to inversesoft123's topic in PHP Installation and Configuration
Not recompiled but moved my sites to another servers recently and then copied back to this server again by cPmove over SSH -
How to reset/reload php.ini file
inversesoft123 replied to inversesoft123's topic in PHP Installation and Configuration
its a CENTOS 4.7 i686 -
How to reset/reload php.ini file
inversesoft123 posted a topic in PHP Installation and Configuration
Hello, Because of email script installation my php.ini file location is changed. my phpinfo() is showing my loaded ini file location as /home/username/public_html/php.ini Now i want to reload this file back to /usr/local/lib/php.ini How to do this ? please help me I am having root access to server Thanks in Advance, Abhijeet -
ohhh.. Previously my websites ware hosted on HostICan VPS and my team uploaded thousands of files and folders and text databases without 777 and sites ware working fine. But now I moved to dedicated and there are lots of permission denies on site... I think we need to correct them manually. :-\
-
ya agreed but on some servers we can upload files without assigning read write execute (777) to folder hows that ?
-
I found that on some servers users or scripts can write into files without having universal write premissions 777. but on some servers 777 chmod must be there to write into file.. why like this? Is there any settings into cpanel or WHM to enable this stuff or this is based on PHP version.. please help thx is advance.
-
How to restore remote cpanel Backup.
inversesoft123 replied to inversesoft123's topic in Apache HTTP Server
Can i use wget ? I am not much familiar with this but data is so huge 23GB. :-\ -
please solve my confusions.. I am creating remote backup everyday by using cronjob. Now how do I restore remote backup to my main site again ? Remote backup name is : backup-3.15.2009_12-59-02_user.tar.gz I have used scp [email protected]:/path/to/your/file.tar.gz /path/to/destination/on/united/hosting/ but not succeed. putty is giving error Shell access is not enabled on your account. tried by using DSA and RSA authorised keys but same error. I am having full root access on my main site while i am creating backup on shared hosting account. Please help me. Thanks in advance.
-
Hello can anyone tell me how to print upper folder in PHP from the file which is located in sub folder.. eg: public_html / mysite / music / new / index.php $home = 'http://mysite.com/'; $current_folder = basename(dirname(__FILE__)); echo '<a href="'.$home.'">Home</a> / <a href="'.$home.$current_folder.'">'.$current_folder.'</a><br/>'; In this code I can link to currennt folder 'new' but how do I link 'music' folder in this script.. Pls Help... Tnx n advance
-
Anybody please help me out ... I am having admob advertise code with me I wanna use it into PHProxy but when I insert it gives Header already sent error.. Can any 1 guide me how to ad+ external PHP code into PHProxy I am attaching screenshot where I wanted to add code.. The code I am trying to insert is.. code1: <?php /* editable area */ $mob_mode = 'live'; // change mode from "test" to "live" when you are done testing $mob_alternate_link = ''; // use this to set a default link to appear if AdMob does not return an ad. /* end editable area */ //used for ad targeting $mob_contents = ''; $mob_ua = urlencode(getenv("HTTP_USER_AGENT")); $mob_ip = urlencode($_SERVER['REMOTE_ADDR']); $mob_m = ''; if ($mob_mode=='test') $mob_m = "&m"; $mob_url = 'http://ads.admob.com/ad_source.php?s=xxxxxxxxxx&u='.$mob_ua.'&i='.$mob_ip.$mob_m; @$mob_ad_serve = fopen($mob_url,'r'); if ($mob_ad_serve) { while (!feof($mob_ad_serve)) $mob_contents .= fread($mob_ad_serve,1024); fclose($mob_ad_serve); } $mob_link = explode("><",$mob_contents); $mob_ad_text = $mob_link[0]; $mob_ad_link = $mob_link[1]; if (isset($mob_ad_link) && ($mob_ad_link !='')) { //display AdMob Ad echo '<a href="'. $mob_ad_link .'">'. $mob_ad_text . '</a>'; } else { //no AdMob ad, display alternate echo $mob_alternate_link; } echo "<br/>\n"; ?> and Code2: <?php // change to "live" to disable demo mode and show real ads define("MOJIVA_MODE", "live"); function mojiva_ad($mojiva_params = array()) { // prepare url parameters of request $mojiva_get = 'site='.urlencode('252'); $mojiva_get .= '&ip='.urlencode($_SERVER['REMOTE_ADDR']); $mojiva_get .= '&ua='.urlencode($_SERVER['HTTP_USER_AGENT']); $mojiva_get .= '&url='.urlencode(sprintf("http%s://%s%s", (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == TRUE ? "s": ""), $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"])); $mojiva_get .= '&zone='.urlencode('277'); $mojiva_get .= '&adstype=3'; // type of ads (1 - text only, 2 - images only, 3 - text + images) $mojiva_get .= '&key=1'; $mojiva_get .= '&count=1'; // quantity of ads $mojiva_get .= '&keywords='; // keywords to search ad delimited by commas (not necessary) $mojiva_get .= '&whitelabel=0'; // filter by whitelabel(0 - all, 1 - only whitelabel, 2 - only non-whitelabel $mojiva_get .= '&premium=0'; // filter by premium status (0 - non-premium, 1 - premium only, 2 - both $mojiva_get .= '¶mBORDER='.urlencode('#000000'); // ads border color $mojiva_get .= '¶mHEADER='.urlencode('#cccccc'); // header color $mojiva_get .= '¶mBG='.urlencode('#eeeeee'); // background color $mojiva_get .= '¶mTEXT='.urlencode('#000000'); // text color $mojiva_get .= '¶mLINK='.urlencode('#ff0000'); // url color if(MOJIVA_MODE == "test") $mojiva_get .= '&test=1'; // send request $mojiva_request = @fsockopen('ads.mojiva.com', 80, $errno, $errstr, 1); if ($mojiva_request) { stream_set_timeout($mojiva_request, 1000); fwrite($mojiva_request, "GET /ad?".$mojiva_get." HTTP/1.0\r\n"); fwrite($mojiva_request, "Host: ads.mojiva.com\r\n"); fwrite($mojiva_request, "Connection: Close\r\n\r\n"); $mojiva_info = stream_get_meta_data($mojiva_request); $mojiva_timeout = $mojiva_info['timed_out']; $mojiva_contents = ""; $mojiva_body = false; $mojiva_head = ""; while (!feof($mojiva_request) && !$mojiva_timeout) { $mojiva_line = fgets($mojiva_request); if(!$mojiva_body && $mojiva_line == "\r\n") $mojiva_body = true; if(!$mojiva_body) $mojiva_head .= $mojiva_line; if($mojiva_body && !empty($mojiva_line)) $mojiva_contents .= $mojiva_line; $mojiva_info = stream_get_meta_data($mojiva_request); $mojiva_timeout = $mojiva_info['timed_out']; } fclose($mojiva_request); if (!preg_match('/^HTTP\/1\.\d 200 OK/', $mojiva_head)) $mojiva_timeout = true; if($mojiva_timeout) return ""; return $mojiva_contents; } } ?> <?php // copy this snippet elsewhere on your page for display more of ads echo mojiva_ad($mojiva_params); echo '<br/>'; Please Guide me regarding above 2 separate codes that what should I do if I don't want error Headers Already Sent in PHProxy.. thx