Jump to content

jgkgopi

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by jgkgopi

  1. Hi all, My domain is http://ipogtech.com/Forum but if type http://ipogtech.com/forum it's not working pls help me to how write .htaccess for that
  2. i have create a folder and upload my file Folder name is Forum if i type http://ipogtech.com/Forum/ it's working But the URL http://ipogtech.com/forum it'not working pls help me to change it Case insensitive URL’s
  3. I want to pass name via form If i use the code like this i can fetch data but i want the url to ?name=babu like that <?php $db=mysql_connect("localhost","root",""); mysql_select_db("lasttry"); $username = $_POST['textfield']; //echo $username; echo '</br>'; $query = mysql_query("SELECT * FROM final WHERE name = '$username'"); while($result = mysql_fetch_array($query)) { //display echo $result['content']; echo '<br/>'; echo $result['conclusion']; }/* $result = MYSQL_QUERY($query); $data =
  4. Hi all I have this code for display some name,content this is the url http://localhost:8080/mobile/main.php if i give like this http://localhost:8080/mobile/main.php?name=babu i will get babu details i want to this babu through a text can u help me <?php require_once('Connections/final.php'); ?> <?php $colname_Recordset1 = "-1"; if (isset($_GET['name'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['name'] : addslashes($_GET['name']); } mysql_select_db($database_final, $final); $query_Recordset1 = sprintf("SELECT * FROM final WHERE name = '%s'", $colname_Recordset1); $Recordset1 = mysql_query($query_Recordset1, $final) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); mysql_free_result($Recordset1); ?>
  5. <?php echo $row_Recordset1['name']; ?> i want to convert the name in to like <a href=main.php?name= $row_Recordset1['name'] >> in databse i has 3 name Steve Mark Lisa i want that names into link like main.php?name=mark and so on how to do it help me h
  6. I have insert image using this following code but i want to know where it is storing i want file path of the imahe what i have inserted <html> <head><title>File Insert</title></head> <body> <h3>Please Choose a File and click Submit</h3> <form enctype="multipart/form-data" action= "<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> <input name="userfile" type="file" /> <input type="submit" value="Submit" /> </form> </body> <?php // check if a file was submitted if(!isset($_FILES['userfile'])) { echo '<p>Please select a file</p>'; } else { try { upload(); //this will upload your image echo '<p>Thank you for submitting</p>'; //Message after uploading image } catch(Exception $e) { echo $e->getMessage(); echo 'Sorry, could not upload file'; } } // the upload function function upload(){ include "file_constants.php"; $maxsize = $_POST['MAX_FILE_SIZE']; if(is_uploaded_file($_FILES['userfile']['tmp_name'])) { // check the file is less than the maximum file size if( $_FILES['userfile']['size'] < $maxsize) { // prepare the image for insertion $imgData =addslashes (file_get_contents($_FILES['userfile']['tmp_name'])); // put the image in the db... // database connection mysql_connect($host, $user, $pass) OR DIE (mysql_error()); // select the db mysql_select_db ($db) OR DIE ("Unable to select db".mysql_error()); // our sql query $sql = "INSERT INTO test_image (image, name) VALUES ('{$imgData}', '{$_FILES['userfile']['name']}');"; // insert the image mysql_query($sql) or die("Error in Query: " . mysql_error()); } } else { // if the file is not less than the maximum allowed, print an error echo '<div>File exceeds the Maximum File limit</div> <div>Maximum File limit is '.$maxsize.'</div> <div>File '.$_FILES['userfile']['name'].' is '.$_FILES['userfile']['size']. ' bytes</div> <hr />'; } } ?> </html>
  7. i want online quiz in php mysql
  8. http://ipogtech.com/myforum/index.php Still am getting this error Bad Gateway [color=red]Web server received an invalid response while acting as a gateway or proxy server. Web Server at ipogtech.com[/color]
  9. http://ipogtech.com/myforum/index.php sorry this the url because i have deleted all the file and installed smf once more
  10. for checking i have put a simple home page check this it is showing error http://ipogtech.com/mycomm/index.php
  11. Hi i buy new domain www.ipogtech.com Server is IIS 7 I have installed SMF Forum which is fully developed by PHP and add the database also but when i opened the site it is showing Bad Gateway Web server received an invalid response while acting as a gateway or proxy server. Web Server at ipogtech.com pls help me to recover form this error.
  12. i am using windows IIS. i have installed SMF forum in that. which is coded using php and mysql. after hosting the website if i tried to open it is producing URL http://ipogtech.com/comm/index.php Bad Gateway Web server received an invalid response while acting as a gateway or proxy server. Web Server at ipogtech.com
  13. Form code <form id="form1" name="form1" method="post" action="v.php"> <label>Name <input type="text" name="textfield" /> </label> <p> <label> <input type="submit" name="Submit" value="Submit" /> </label> </p> </form> PHP code <?php mysql_connect("localhost","root",""); mysql_select_db("lasttry"); $username = $_POST['textfield']; echo '</br>'; $query = mysql_query("SELECT * FROM final WHERE name=`$username` "); while($result = mysql_fetch_array($query)) { //display echo $result['content']; echo $result['conclusion']; } ?> Error getting on line 9 while($result = mysql_fetch_array($query)) { Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:\wamp\www\mobile\v.php on line 9
  14. have changed like this while($result = mysql_fetch_array($query)) { still it is in the same page, i want to get the user from me and show the details of that particular user
  15. Now i didn't get any but i had got What is SQL Structure Query Lang Super query language slow query lang See how you did if i click the correct answer also it is in the same page i think i don't know what to give in the action in quiz1.php i have attached all code with it Config.php <?php $database = "quiz"; $user = "root"; $pass = ""; $hostname = "localhost"; $table = "quiz"; ?> contentdb.php <?php include("config.php"); $db = mysql_connect("$hostname", "$user", "$pass"); mysql_select_db("$database",$db); ?>[/code] Quiz1.php <?php include("contentdb.php"); include("config.php"); global $submit,$db; $display = mysql_query("SELECT * FROM $table ORDER BY id",$db)or die (mysql_error()); if (!$submit) { echo '<form method="post" action="">'; echo "<table border=0>"; while ($row = mysql_fetch_array($display)) { $id = $row["id"]; $question = $row["question"]; $opt1 = $row["opt1"]; $opt2 = $row["opt2"]; $opt3 = $row["opt3"]; $answer = $row["answer"]; echo "<tr><td colspan=3><br><b>$question</b></td></tr>"; echo "<tr><td>$opt1 <input type=radio name=q$id value=\"$opt1\"></td><td>$opt2 <input type=radio name=q$id value=\"$opt2\"></td><td>$opt3 <input type=radio name=q$id value=\"$opt3\"></td></tr>"; } echo "</table>"; echo "<input type='submit' value='See how you did' name='submit'>"; echo "</form>"; } elseif ($submit) { $score = 0; $total = mysql_num_rows($display); while ($result = mysql_fetch_array($display)) { $answer = $result["answer"]; $q = $result["q"]; if ($$q == $answer) { $score++; } } echo "<p align=center><b>You scored $score out of $total</b></p>"; echo "<p>"; if ($score == $total) { echo "Congratulations! You got every question right!"; } elseif ($score/$total < 0.34) { echo "Oh dear. Not the best score, but don't worry, it's only a quiz."; } elseif ($score/$total > 0.67) { echo "Well done! You certainly know your stuff."; } else { echo "Not bad - but there were a few that caught you out!"; } echo "</p>"; echo "<p>Here are the answers:"; echo "<table border=0>"; $display = mysql_query("SELECT * FROM $table ORDER BY id",$db); while ($row = mysql_fetch_array($display)) { $question = $row["question"]; $answer = $row["answer"]; $q = $row["q"]; echo "<tr><td><br>$question</td></tr>"; if ($$q == $answer) { echo "<tr><td>»you answered ${$q}, which is correct</td></tr>"; } elseif ($$q == "") { echo "<tr><td>»you didn't select an answer. The answer is $answer</td></tr>"; } else { echo "<tr><td>»you answered ${$q}. The answer is $answer</td></tr>"; } } echo "</table></p>"; } ?>
  16. I have used this code But it is in the same page post title,content,conclusion are the column name used in my mysql datbase this page is also view.php in action also am using view.php <?php //include if(isset($_POST['Submit'])){ $username = $_POST['textfield']; $query = mysql_query("SELECT * FROM final WHERE name=$username"); while($result == mysql_fetch_array($query)) { //display echo $result['post title']; echo $result['content']; echo $result['conclusion']; } } ?> <form id="form1" name="form1" method="post" action="view.php"> <label>Name <input type="text" name="textfield" /> </label> <p> <label> <input type="submit" name="Submit" value="Submit" /> </label> </p> </form>
  17. PHPSuperNewb i had include in the contentdb.php this is the error i am getting mysql_query() expects parameter 2 to be
  18. If i changed the code like this echo '<form method=post action="">'; It is showing error in this line. mysql_query("SELECT * FROM $table ORDER BY id",$db);
  19. $username = $_POST['textfield']; $query = "SELECT * FROM table_name WHERE userName=$username; while($result == mysql_fetch_array($query)) { //display echo $result['title]; echo $result['post']; echo $result['content']; } where i have to use this code pls in the form
  20. hi i had database with field of name,title,post,content i want to fetch the post and content for a specific user from giving name of that user by form help me to get that ps just give me idea to how to do that/ <form id="form1" name="form1" method="post" action="view.php"> <label>Name <input type="text" name="textfield" /> </label> <p> <label> <input type="submit" name="Submit" value="Submit" /> </label> </p> </form>
  21. this is the line showing error echo "<form method=post action=$_SERVER['PHP_SELF']>";
  22. hi all am new to this forum help me to overcome from this error Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in D:\wamp\www\quiz1\quiz1.php on line 12 <?php include("contentdb.php"); $display = mysql_query("SELECT * FROM $table ORDER BY id",$db); if (!$submit) { echo "<form method=post action=$_SERVER['PHP_SELF']>"; echo "<table border=0>"; while ($row = mysql_fetch_array($display)) { $id = $row["id"]; $question = $row["question"]; $opt1 = $row["opt1"]; $opt2 = $row["opt2"]; $opt3 = $row["opt3"]; $answer = $row["answer"]; echo "<tr><td colspan=3><br><b>$question</b></td></tr>"; echo "<tr><td>$opt1 <input type=radio name=q$id value=\"$opt1\"></td><td>$opt2 <input type=radio name=q$id value=\"$opt2\"></td><td>$opt3 <input type=radio name=q$id value=\"$opt3\"></td></tr>"; } echo "</table>"; echo "<input type='submit' value='See how you did' name='submit'>"; echo "</form>"; } elseif ($submit) { $score = 0; $total = mysql_num_rows($display); while ($result = mysql_fetch_array($display)) { $answer = $result["answer"]; $q = $result["q"]; if ($$q == $answer) { $score++; } } echo "<p align=center><b>You scored $score out of $total</b></p>"; echo "<p>"; if ($score == $total) { echo "Congratulations! You got every question right!"; } elseif ($score/$total < 0.34) { echo "Oh dear. Not the best score, but don't worry, it's only a quiz."; } elseif ($score/$total > 0.67) { echo "Well done! You certainly know your stuff."; } else { echo "Not bad - but there were a few that caught you out!"; } echo "</p>"; echo "<p>Here are the answers:"; echo "<table border=0>"; $display = mysql_query("SELECT * FROM $table ORDER BY id",$db); while ($row = mysql_fetch_array($display)) { $question = $row["question"]; $answer = $row["answer"]; $q = $row["q"]; echo "<tr><td><br>$question</td></tr>"; if ($$q == $answer) { echo "<tr><td>»you answered ${$q}, which is correct</td></tr>"; } elseif ($$q == "") { echo "<tr><td>»you didn't select an answer. The answer is $answer</td></tr>"; } else { echo "<tr><td>»you answered ${$q}. The answer is $answer</td></tr>"; } } echo "</table></p>"; } ?> thanks in adavance
×
×
  • 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.