Jump to content

rahulvicky00

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Posts posted by rahulvicky00

  1. Sorry for my bad english but i hope you would understand my query.

     

    How can i set 404 not found for database driven pages..?

     

     

    I am using header("HTTP/1.0 404 Not Found"); in my 404 error page and ErrorDocument 404 /404.html, whereas 404.html is my error page.

     

    i have an URL http://www.example.com/folder/my-test-for-url-95/ which is opening correctly because it has existence on database. but when i am opening http://www.example.com/folder/my-test-for-url-951/ which has existence on database is also opening without any information but i want here a 404 not found page. How can i do so.

     

     

    Thanks

  2. By default, PHP allow a maximum file upload of 2MB. You can increase the limit when necessary.
     
    Two PHP configuration options control the maximum upload size: upload_max_filesize and post_max_size.
    Both can be set to, say, “10M” for 10 megabyte file sizes.
     
    Remember, PHP scripts normally time-out after 30 seconds, but a 10MB file would take at least 3 minutes to upload on a healthy broadband connection.
    So you need to set PHP’s max_input_time and max_execution_time to something like 300 (5 minutes specified in seconds).
     
    You can set these options 3 way -
    1. Set in your server’s php.ini configuration file so that they apply to all your applications.
      upload_max_filesize = 10M
      post_max_size = 10M
      max_input_time = 300
      max_execution_time = 300
      


    2. Set in your code.
      ini_set('upload_max_filesize', '10M');  
      ini_set('post_max_size', '10M');  
      ini_set('max_input_time', 300);  
      ini_set('max_execution_time', 300);
      


    3. If you’re using Apache, you can configure the settings in your application’s .htaccess file
      php_value upload_max_filesize 10M
      php_value post_max_size 10M
      php_value max_input_time 300
      php_value max_execution_time 300
      


     

    This seems very helpful information, but there is one confusion... where to find the php.ini file on the server. i am using window hosting for the website and using tomcat server...

     

  3. When i am uploading under 2 MB file, it is successfully uploaded but when i am trying to upload bigger file then its showing failed to upload issue... my code is following....please help me to get out of this situation...

    <?php
    function UploadOne($fname)
    {
    $uploaddir = 'uploadedfiles/';
    if (is_uploaded_file($fname['tmp_name']))
    {
    
    $filname = basename($fname['name']);
    
    $uploadfile = $uploaddir . basename($fname['name']);
    if (move_uploaded_file ($fname['tmp_name'], $uploadfile))
    	$res = "File " . $filname . "was successfully uploaded and stored. Upload More<br>";
    
    				include ('../config.php');
    				mysql_query("INSERT INTO videos (id, path, name, title, content)
    				VALUES ('$_POST[id]', 'url/$filname', '$_POST[date]', '$_POST[title]' , '$_POST[content]')");
    				$data = mysql_query('SELECT * FROM videos ORDER BY id DESC LIMIT 1');
    $info = mysql_fetch_array($data);
    
    	$res = "<strong>$info[title]</strong>," . "\n Sucessfully Uploaded. \n Upload more".  "<br>" . "<a href='../videos.php'>View Videos</a>";
    	}	
    else
    $res = "File ".$fname['name']." failed to upload.";
    return ($res);
    }
    ?>
    

     

    Thanks in advance...

  4. My db table has columns "id" (int-11), "date(varchar-50)", "author name(varchar-100)", "text (varchar-100000)"...

    I am storing images + text in text field of database. Everything is going fine while i am using ckeditor to insert data into the database for that particular text field.

    Now when i am retrieving data from database... i am able to extract id, date, autorname successfully (i have check it while the issue came)..but when i am trying to retrieve text field which have image, that jumps to page not found error...

     

    what could be the issue... am i having problem with database or editor that i am using????

  5. I am using CKeditor 3.2. Everything is going fine except image uploader, flash uploader and table...

    These content are not working.. my site is in PHP..

     

    I have searched too much to solution on Google not found a right answer... infact, there are many results talking about filemanager folder which i was not able to find on downloaded zip.

     

    One more thing; when i am uploading images through default uploader and send it to database everything is fine, but when i am retrieving that image on some page; the image is not displaying,  /"/" kind of code displaying instead of the images....

     

    What to do to resolve this issue..... Kindly help me its very needed...

     

    Thanks in advance....

  6. You need to be more specific, do you want:

    1)  The session to expire after a certain amount of inactivity?  For instance, if they get up and go to lunch, when they come back they'll be logged out?

    2)  The session to expire at a specific time after login regardless of their activity.  For instance, they can only browse your site for 4 hours before they're automatically kicked out?

     

    I need something like "The session to expire after a certain amount of inactivity?  For instance, if they get up and go to lunch, when they come back they'll be logged out?"...

     

  7. I am trying to make an edit page to edit any of my post...so i designed a manage post page manage-posts.php with the given code:

     

        <?php 
    echo '<form name="frmMain" action="del1.php" method="post" OnSubmit="return onDelete();">';
    			$objConnect = mysql_connect("hostname","username","password") or die(mysql_error());  
        $objDB = mysql_select_db("dbname");
        $strSQL = "SELECT * FROM text";  
        $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");  
         
    echo '<table width="600" border="1">';  
        echo '<tr>';  
       echo '<th width="91"> <div align="center">ID</div></th>'; 
    echo '<th width="91"> <div align="center">Date</div></th>';  
        echo '<th width="91"> <div align="center">Title</div></th>';
    echo '<th width="91"> <div align="center">Author</div></th>';
        echo '<th width="30"> <div align="center">Edit</div></th>';
    echo '<th width="30"> <div align="center">Select</div></th>';
        echo '</tr>'; 
       		while($objResult = mysql_fetch_array($objQuery))  
        			{  
       	  		?>
       	 <tr>  
        <td><?=$objResult["id"];?></td>
        <td><?=$objResult["date"];?></td>  
        <td><?=$objResult["title"];?></td>  
        <td><div align="center"><?=$objResult["author"];?></div></td>  
    <td align="center"><a href="edit.php?NewsID=<?php echo $objResult["id"];?>" name="edit">Edit</a></td>   
        <td align="center"><input type="checkbox" name="chkDel[]" value="<?=$objResult["id"];?>"></td>  
        <input type="hidden" name="id" value="<?=$objResult["id"];?>" />
        </tr>  
         <?
          }  
        
        echo '</table>'; 
    echo '<input type="submit" name="btnDelete" value="Delete">';  
        echo '</form>'; 
    

     

    and i designed another page edit.php to perform deletion of that particular post with the following code "

    <?php 
    
    			$objConnect = mysql_connect("hostname","username","pass") or die(mysql_error());  
        $objDB = mysql_select_db("dbname");
      
       $strSQL = "SELECT * FROM text";  
        $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");  
    $objResult = mysql_fetch_array($objQuery);
    ?>
      			<input type="hidden" name="id" value="<?=$objResult["id"];?>" />
    			Title : <br /><input type="text" name="title" size="100"  maxlength="100" value="<?=$objResult["title"];?>"/> <br />
                Date : <br /><input type="text" name="date" size="20"  maxlength="12" id="TextBox" value="<?=$objResult["date"];?>"/> <br />
                Author : <br /><input type="text" name="author" size="20"  maxlength="100" value="<?=$objResult["author"];?>"/> <br />
                <br />
    <input type="submit" value="Submit" name="submit" />
                </p>
    
    </form></fieldset></div>
    

     

     

    But the problem is that i am not able to get that particular post every time whenever i clicked on the respective post's edit link..

    i suppose there is any issue in calling the id from the mysql... kindly suggest solutions... thanks in advance...

  8. I am putting title in my URL whenever a new auto generated page is generates, so if i use single word tile then it is fine but when there is more that two words in the title it shows space in every word and therefor in title too. how can i add this hyphen or any other special char to my URL so it would look like?

    i.e.

    If i use title to MY FIRST WEB PAGE.php, what should i do so i can make it like MY-FIRST-WEB-PAGE.php

     

     

  9. Hi Mates,

     

    I want to know how to create auto generated pages in submit button with the existing templates...Wordpress users may easily understand what actually i mean...i am using the code that is creating a page but not getting the desired page name and giving a blank page that is without any formatting...

     

    <?php
    $content = <<<EOL
    <head>
    </head>
    <body>
    New page
    EOL;
    
    include ('config.php');
    mysql_select_db("$db_name");
    $result = mysql_query("SELECT * FROM text ORDER BY ID")
    or die(mysql_error());
    
    while($row = mysql_fetch_array( $result )) {
    echo $row['title'];
    echo "<br />";
    }
    
    $content .= <<<EOL
    </body>
    </html>
    EOL;
    $file = '$result' . '.php'; 
    $open = fopen($file, "w");
    fwrite($open, $content);
    fclose($open);
    ?> 

  10. freelance84 provided you with a tutorial that explains how to retrieve MySQL data using PHP. After reading it carefully for a good understanding, you should be able to adapt the examples there to fit what you need to do. If you get stuck, show us the code you have so far and we'll go from there.

    ;)

     

    Thanks for your reply...

     

    My code is looks like:

     

    <html>

    <head>

    <script type="text/javascript" src="/jwplayer/jwplayer.js"> </script>

    </head>

    <body>

    <?php

    $link = mysql_connect("localhost", "dbname", "password");

    if(!$link)

    {

    die("Connection Lost" . mysql_error());

    }

    mysql_select_db ("635177_vik", $link);

    $data = mysql_query('SELECT * FROM vik ORDER BY id DESC LIMIT 1');

    $info = mysql_fetch_array($data);

     

    echo "<video class="jwplayer" src=".$info['path']." width="252" height="250"></video>";

    mysql_close($link);

      ?>

    </body>

    </html>

    it showing an error :: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /srv/disk3/635177/www/indiavsaustralia.in/vup/acha/flash.php on line 16

  11.  

    Thanks for your reply... but the problem is still.. i am clearing my scenario here.

     

    i have uploaded a video in my sites in a specified folder and stored the URL in database. now i want to retrieve that  particular URL to my video player with the help of "video tag". it requires "src attribute" in that i want to retrieve the URL so every time when the new video have been uploaded that video will run in the video player..

     

    please send some suggestions...

  12. Hi Mates,

    I am very new to PHP so this forums too. i have stored a URL in database as VARCHAR, now i want to retrieve that URL in src attribute..is it possible in php to retrieve that URL in src so i can get the latest URL running with the tag? if yes then how to get that.

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.