-
Posts
334 -
Joined
-
Last visited
Everything posted by inversesoft123
-
Assign it to variable $info = "The information have already been updated in the database";
-
http://api.jquery.com/submit-selector/
-
If I understand correctly you are searching for wild card redirection. I have discussed it here http://www.phpfreaks.com/forums/php-coding-help/subdomain-always-redirect-to-index-php/
-
You can load different contents on same page when user logs in with his specific user name and password. however if you are searching to give a physical path to your users (a static html / php fle per user) then when user logs in generated a random key or word or password with combination of upper and lower case characters or symbols and encrypt it with md5 we call it as tokens then add this corresponding token into the database and pass user to targeted file by assigning token and then by using GET method verify users token with whatever that is enter into the database. another option is setting cookies to the database. but why to do such complex stuff ? you don't you load different content on same page by using advantages of database system ?
-
for first solution you can use a temporary table to insert records or database triggers. for second solution you can use AJAX to check validity of inputs submitted by users.
-
it is a bit difficult to implement with file management system. you need to use explode like functions and lots of coding is needed and you may get ambiguous results . alternatively you can do it easily with by using database even if writing to the file is important for you you can do it in short with the help of mysql or mssql database.
-
Read data from one file $dfile = "download.txt"; $dopr = fopen($dfile, 'r'); $collectdata= fread($dopr, 50000); fclose($dopr); write data into another file $mfile = "master.txt"; $mopr = fopen($mfile, 'w') or die("could not open file"); fwrite($mopr, $collectdata); fclose($mopr);
-
As we know the total number of hits to database is proportional to the number of page views if page views * queries per page is more than the capacity of your database, then mysql queries may show problem. is there any way to calculate the database capacity ? I googled someone says 128Mb cache is there for mysql.
-
you can do it with jQuery API.
-
Trouble inserting code into 'if/else' statement
inversesoft123 replied to pioneerx01's topic in PHP Coding Help
It seems that your function is not loading into else statement of your code. the quick solution would be defining function at the top of the page. or creating a file for function and including it dynamically on all pages where you want to use this function. -
Problem with cookies - value disappears on page reload
inversesoft123 replied to rmelino's topic in PHP Coding Help
you must set expiration time for cookies which you are setting on users browser. eg: setcookie("KW", $kw, time()+60*60*24*60); For more regarding time visit http://php.net/manual/en/ref.datetime.php -
Installation of PECL module id3
inversesoft123 replied to inversesoft123's topic in PHP Installation and Configuration
i have pear installed -
Anybody know how to install PECL module id3 http://www.php.net/manual/en/id3.installation.php on cent OS 5.x ? I am wired now. Thanks in advance !!
-
post complete function here...
-
but before using this script on server you need to make it more secure. your query $execute = mysql_query("DELETE FROM polaroids WHERE id='".$action."'"); will delete any image irrespective to the owner information. someone may delete all images from your database starting from id = 1 to end... so update your query such that only owned images of users should be deleted. ex. suppose ID is a primary and unique key to identify user from database the query would be.. $execute = mysql_query("DELETE FROM polaroids WHERE id='".$action."' AND userid='".$uid."'");
-
<div id="editindexpage"> <?php $qGetId = "SELECT * FROM `polaroids` WHERE id='".$_GET['delete_polaroid']."'"; $result = mysql_query($qGetId) or die (mysql_error()); $pola=mysql_fetch_array($result); ?> <p class="bold">Are you sure you want to delete this polaroid from the database?</p><br/> <?php $act = $_GET['delete_polaroid']; echo "<a href=\"deleting_stuff_check.php?delete_comp=$act\">Yes</a>"; $action = $_GET['delete_comp']; if(isset($action)) { $execute = mysql_query("DELETE FROM polaroids WHERE id='".$action."'"); if($execute) { echo "Complete"; } else { echo "Unable to delete"; } } ?> <a href="polaroids.php">No</a> </div>
-
checkout these lines... you are executing mysql on page load hence the image is getting deleted.. use php get method instead for confirmation. <a href="polaroids.php?delete_comp=1">Yes</a> <?php $action = $_GET['delete_comp']; if(isset($action)) { if($action == "1") { mysql_query("DELETE FROM polaroids WHERE id='".$_GET['delete_polaroid']."'"); mysql_query("DELETE FROM category WHERE cat_name='".$pola['catid']."'"); } } ?> <a href="polaroids.php">No</a> </div>
-
Ask your host to change upload_max_filesize from root. it should be at least 20M. Otherwise i recommend to chance host as mentioned by trope
-
Problems with php includes from diff file paths. Need help
inversesoft123 replied to Lexicon's topic in PHP Coding Help
The links can be controlled by PHP with the help of $_SERVER['DOCUMENT_ROOT']; including example is include($_SERVER['DOCUMENT_ROOT'].'/root/myprojects/blah.php'); //and linking as echo "<a href=\"" . $_SERVER['DOCUMENT_ROOT'] . "/root/myprojects/blah.php\">My Project List</a>"; -
function greatexplode($characters,$string) { $takeary = explode($characters[0],$string); array_shift($characters); if($characters != NULL) { foreach($takeary as $key => $val) { $takeary[$key] = multiexplode($characters, $val); } } return $takeary; } $string = "The Publisher: Abhijeet here > hello how are you."; $characters = Array("Publisher:">"); $results = greatexplode($characters,$string); print_r($results);
-
<?php $string = "The Publisher: Abhijeet here > hello how are you."; $pices = explode("Publisher:", $string); echo $pices[0]; // prints : The Publisher echo $pices[1]; // prints : Abhijeet here > hello how are you. $pices1 = explode(">", $pices[1]); echo $pices1[0]; // prints : Abhijeet here $newstring = "Publisher:John here>"; $combine = "$pices[0].$newstring.$pices1[1]"; echo $combine; // The Publisher: John here > hello how are you. Then you can replace text
-
<?php mysql_select_db("uni", $con); $sql=mysql_query("select * from student"); $res=0; while($row=mysql_fetch_array($sql)) { if($row['StudentID']==$_POST["sid"]) { ?> <form id="form2" name="form2" method="post" action="editing.php"> <?php $studentid = $row['StudentID']; $studentname = $row['StudentName']; echo "<p>StudentID: <input type=\"text\" name=\"sid\" id=\"sid\" value=\"$studentid\"/>"; echo "<p>StudentName :<input type=\"text\" name=\"sname\" id=\"sname\" value=\"$studentname \" /> </p>"; $res=1; } } if($res==0) { echo "Please enter the Correct ID. "; } mysql_close($con); ?> update.php <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("uni", $con); mysql_query("UPDATE student SET StudentID = .$row['StudentID'] WHERE student.StudentID ='.$row['StudentID']'"); mysql_query("UPDATE student SET StudentName = .$row['StudentName'] WHERE student.StudentID ='.$row['StudentID']'"); echo "Successfully Edited"; ?>
-
you can get open source codes form the web and install them on your server. http://www.phpbb.com/ http://www.simplemachines.org/ http://www.mybboard.net/ http://www.seo-board.com/
-
why are you hiding error message under ............................. we need line number anyways change this <h2><p><?php echo "StudentID :" ?> <input type="text" name="sid" id="sid" value="<?php echo"".$row['StudentID'] ?>" /> <p><?php echo "StudentName :" ?> <input type="text" name="stname" id="stname" value="<?php echo"".$row['StudentName'] ?>" /> </p> to echo "<h2><p>StudentID : <input type=\"text\" name=\"sid\" id=\"sid\" value=\"$row['StudentID']\" />"; echo "<p>StudentName :<input type=\"text\" name=\"stname\" id=\"stname\" value=\"$row['StudentName'] \" /> </p>";
-
Interested to know how did you solved this