Jump to content

s4salman

Members
  • Posts

    84
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

s4salman's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I am using this code, what i want is to random fill up stepa field with either option a or option b every time i refresh the page, any help is highly appreciated!: <form action="myc.php" method="get"> <label for="element_1"> </label> <div> <select class="element select medium" name="stepa"> <option value="" selected="selected"></option> <option value="option a" >Advanced Human option a</option> <option value="option b">Advanced Human Option b</option> </select> </div> <br> <input type="submit"> </form>
  2. Can you please identify the line which is creating the issue. I am not able to figure out your point of view. Thanks
  3. Here the whole file attached herein <?php $host_name = "localhost"; $database = "s4salman_jag"; // Change your database name $username = "s4salman_jag"; // Your database user id $password = "jag001"; // Your password //////// Do not Edit below ///////// try { $dbo = new PDO('mysql:host='.$host_name.';dbname='.$database, $username, $password); } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "<br/>"; die(); } ?> <?php if( $_GET["stepa"] || $_GET["stepaa"]|| $_GET["stepaaa"] || $_GET["stepaaaa"] || $_GET["stepaaaaa"]|| $_GET["stepaaaaaa"] ) { echo $_GET['filename']; echo "<br/>"; echo "0&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"; echo $_GET['description']; echo "<br/>"; echo "1&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"; echo $_GET['stepa']; echo '&nbsp'; echo $_GET['stepaa']; echo '&nbsp'; echo $_GET['stepaaa']; echo '&nbsp'; echo $_GET['stepaaaa']; echo '&nbsp'; echo $_GET['stepaaaaa']; echo $_GET['stepaaaaaa']; echo "<br/>"; <body> <form action = "<?php $_PHP_SELF ?>" method = "GET"> <input type = "submit" /> <table border="0"> <tr> <td width="100%" ALIGN="CENTER"> file name<input type="text" name="filename"> </td> </tr> <tr> <td width="100%" ALIGN="CENTER"> description<input type="text" name="description"> </td> </tr> </table> <table border="0" cellpadding="2" cellspacing="8"> <tr> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field1"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field1]>$row[field1]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="20%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field2"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepaa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field2]>$row[field2]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepaaa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field3]>$row[field3]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field4"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepaaaa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field4]>$row[field4]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="20%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field5"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepaaaaa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field5]>$row[field5]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepaaaaaa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field6]>$row[field6]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> </tr> </table> </body> </html>
  4. This code is only printing the 1st part of the field 6. For example if field 6 has data an oval, so it shows up an oval in the drop down list, But when i submit this form, only an gets printed on the next page. It is not printing whole an oval on the next page what is wrong with the code. Pls help! <?php $sql="SELECT * FROM tutorial"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepaaaaaa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field6]>$row[field6]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?>
  5. I want to repeat this form 40 times. Can any body help me with php code. Below, is the one row printing 06 drop down list. I want to repeat this thing 40 times. What is mean is that repeate this 06 drop down field 40 times. <tr> <td width="100%" ALIGN="CENTER"> description<input type="text" name="description"> </td> </tr> </table> <table border="0" cellpadding="2" cellspacing="8"> <tr> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field1"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field1]>$row[field1]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="20%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field2"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field2]>$row[field2]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field3]>$row[field3]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field1"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field1]>$row[field1]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="20%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial order by field2"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field2]>$row[field2]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> <td width="10%" ALIGN="CENTER"> <label for="element_1"> </label> <div> <?php $sql="SELECT * FROM tutorial"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field3]>$row[field3]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </div> </td> </tr>
  6. Got it to work as: <?php $host_name = "localhost"; $database = "s4salman_jag"; // Change your database name $username = "s4salman_jag"; // Your database user id $password = "jag001"; // Your password //////// Do not Edit below ///////// try { $dbo = new PDO('mysql:host='.$host_name.';dbname='.$database, $username, $password); } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "<br/>"; die(); } $sql="SELECT * FROM tutorial"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field1]>$row[field1]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?>
  7. Anyone could help me out? Drop down list is not populating from mysql table, i could not figured out what is wrong in it. <?php $dbhost = 'localhost'; $dbuser = 's4salman_jag'; $dbpass = 'jag001'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $sql = 'SELECT * FROM tutorial'; mysql_select_db('s4salman_jag'); $retval = mysql_query( $sql, $conn ); echo "<select name=stepa>"; // list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "<option value=$row[field1]>$row[field1]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?>
  8. I am getting Parse error, i am confused what is wrong. Any one can guide me? Thanks cd.php
  9. Thanks for the reply, but this is also giving the same result.
  10. Hello i am getting nothing printed on the page using this code, just a blank page is showing. Can any body help me out from this issue : <?php if (!ini_get("register_globals")) { import_request_variables('GPC'); } //E?C?? ??I C?E? CEO E? $phpver = phpversion(); if ($phpver < '4.1.0') { $_GET = $HTTP_GET_VARS; $_POST = $HTTP_POST_VARS; $_SERVER = $HTTP_SERVER_VARS; } $phpver = explode(".", $phpver); $phpver = "$phpver[0]$phpver[1]"; if ($phpver >= 41) { $PHP_SELF = $_SERVER['PHP_SELF']; } class Pager { function getPagerData($numHits, $limit, $page) { $numHits = (int) $numHits; $limit = max((int) $limit, 1); $page = (int) $page; $numPages = ceil($numHits / $limit); $page = max($page, 1); $page = min($page, $numPages); $offset = ($page - 1) * $limit; $ret = new stdClass; $ret->offset = $offset; $ret->limit = $limit; $ret->numPages = $numPages; $ret->page = $page; return $ret; } } // get the pager input values $page = $_GET['page']; $limit = 50; $result = mysql_query("select count(*) from dada where category='Music'"); $total = mysql_result($result, 0, 0); // work out the pager values $pager = Pager::getPagerData($total, $limit, $page); $offset = $pager->offset; $limit = $pager->limit; $page = $pager->page; // use pager values to fetch data $query = "select * from dada order by id DESC category='Music' limit $offset, $limit"; $result = mysql_query($query); $num=mysql_numrows($result); ?> <?php $i=0; while ($i<$num) { $id=mysql_result($result,$i,"id"); $name=mysql_result($result,$i,"name"); $image=mysql_result($result,$i,"image"); $category=mysql_result($result,$i,"category"); $linkdown=mysql_result($result,$i,"linkdown"); $pubsite=mysql_result($result,$i,"pubsite"); $description=mysql_result($result,$i,"description"); $os=mysql_result($result,$i,"os"); echo "<b><u><font size=\"4\">$name</font></u></b><br><font size=\"3\">$description</font><br><a href=\"$pubsite\" rel=\"nofollow\"><font color=\"#060d45\"><b>Publisher WebSite</b></font></a> <a href=\"$linkdown\" rel=\"nofollow\"><font color=\"#060d45\"><b>Download</b></font></a> <hr>"; $i++ ; } ?> music.php
  11. Hello i am getting this error message, please help me to correct it : Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table (id, name, description, linkdown, pubsite, category, image, os) VALUES ('' at line 1 The code is as follows : <?php /// In order /// you /// information in this file: /// Copyright 2012 /// All rights reserved. include("connect.php"); $name = trim(mysql_real_escape_string($_POST["name"])); $description = trim(mysql_real_escape_string($_POST["description"])); $linkdown = trim(mysql_real_escape_string($_POST["linkdown"])); $pubsite = trim(mysql_real_escape_string($_POST["pubsite"])); $category = trim(mysql_real_escape_string($_POST["category"])); $image = trim(mysql_real_escape_string($_POST["image"])); $os = trim(mysql_real_escape_string($_POST["os"])); $results = mysql_query("INSERT INTO table (id, name, description, linkdown, pubsite, category, image, os) VALUES ('', '$name', '$description', '$linkdown', '$pubsite', '$category', '$image', '$os')"); if($results) { echo "Successfully Added"; } else { die('Invalid query: '.mysql_error()); } ?> <a href="index.php">Back to index</a>
  12. got this working UPDATE prices SET `range`='twentyfive' WHERE `range`='25000' thanks
  13. I am using this sql to filter records : $query = "select * from mobileprices where range='5000'" but i am getting this error message : mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/dracra/public_html/a.com/range.php range field contains product prices range and filled with 5000, 10000, 15000, 20000 etc. I tried the following code to update the range values from numeric to text in phpmyadmin sql area : UPDATE mobileprices SET range='five' WHERE range='5000' but i am getting this error message : #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range='five' WHERE range='5000'' at line 2 I am confused as there are thousands of records and manually updating it one by one will take so much time. Anyone could help me out as how i can change numeric with text in range. or there is any way by that sql could accept this : $query = "select * from mobileprices where range='5000'" I need a solution, so please help me !!
  14. Hello i am unable to find why the record is not adding into the mysql database. My connection are right. I am attaching the files. Please help me in this. [attachment deleted by admin]
  15. Hi i am getting sysntax error with the following code : <?php echo "<embed flashvars="" src="http://www.salmobile.info/scrubber.swf?file=http://www.salmobile.info/sab/1/$player&bufferTime=3&previewImage=http://salmobile.info/sab/img1/$image&startAt=0&autoStart=false" allowfullscreen="true" type="application/x-shockwave-flash" id="FLVScrubber2" style="width: 323px; height: 283px;" />"; ?> i am attaching the whole file. The error i am getting is Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/dracra/public_html/3gp-videos-download2.php on line 237 plz help [attachment deleted by admin]
×
×
  • 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.