PHP - Trying To Connect Using Fsockopen
HI, I'm running the next script from my local host and the production server, and Im getting different outputs. Anyone knows why am I getting that error from my localhost? <?php $host = 'ssl://mail.companyname.org'; $port = 993; $error = 0; $errorString = ""; var_dump(fsockopen($host, $port, $error, $errorString, 30)); var_dump($errorString); var_dump($error);
> PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Production server output: resource(4) of type (stream)
Edited November 26, 2020 by tirengarfio Similar TutorialsI have this in a method: Code: [Select] <?php public function hear($socket_id = 0, $length = 1024){ $fp = fsockopen("localhost", 5565, $errno, $errstr); if(!$fp){ echo "$errno: $errstr";exit; } $heard = fread($fp, $length); fclose($fp); return $heard; } ?> It is then called like this: Code: [Select] <?php require_once '../phpLive/phpLive.php'; $live->listen(function(){ global $live; if(($heard = $live->hear())){ echo "I heard: $heard"; } }); ?> listen is a while loop that calls the passed function over and over. The problem I am having is when I run it I get this error: 10061: No connection could be made because the target machine actively refused it. I open the port, on my computer and it still doesn't work! What is causing this? I am trying to open a Unix server and was wondering how would you return what the Unix server is saying, ie the prompt? Here is the code I was using after reading the php.net. The $call variable is my attempt at reading the server and have it return what it says. I do have a connection to the server cause if I change the address or port number, i have the error in the log file saying the address refused the connection. Any help/insight is really appreciated. Thanks Code: [Select] <?php $host = "127.0.0.1"; $port = 9595; $fp = stream_socket_client("tcp://".$host.":".$port."", $errno, $errstr, 30); $call = fgets($fp); echo $call; fclose($fp); ?> how is it possible to check how long a socket has been open for, using fsockopen? or if not fsockopen then what other function is good at checking this? basically i want to check a port on a site, and see how long it has been up for. Hello, I have recently started playing around with PHP, and have created a simple port checker with the help of a tutorial. Although what I would like to do is use an HTML form to insert the variable for fsockopen("xxxxx... instead of having it embedded. Is there any way to achieve this? <?php $connection = @fsockopen("www.google.com", 80); if ($connection) { echo "Port 80 on www.google.com is open."; fclose($connection); } else { echo "Port 80 on www.google.com is not open."; } Many thanks for any help that can be provided Hi Experts, How can I check whether I have FSOCKOPEN support from phpinfo() page? Thanks, I am using this code to check if a server is running. Everything is fine when it is running, but when it's not, it takes ages for the fsockopen to fail. Is there a way to make it timeout faster? if (fsockopen($settings->survival_server, $settings->survival_port, $timeout = 0.1)){ $survival['status'] = "Up"; }else { $survival['status'] = "Down" } sorry about this . please can u delete it Hey guys! I am writing a class file that does this: sends a GET/POST request with headers to a page and returns the HTML stores cookies Uses GZIp decompression I was wondering: what is the difference between fsockopen and curl? Which is faster for completing those tasks? Thanks Okay, I'm using fsockopen to see if a port is being used, But all it does it crashes the page if it isn't. If it is one it works but if it is off the pages just doesn't load at all. Code: <?php $fp=fsockopen("localhost", 43594, $errno, $errstr, 30); if($fp){ echo('The server is <font color="#0066FF"><b>Online!</b></font>'); } else { echo('The server is <font color="#FF0000"><b>Offline!</b></font>'); } ?> Can one of you amazing helpful souls help me out? Thanks in advance! Hi,
After a few years of having Barclays EPDQ payment gateway, they have now changed how they require the data to be sent to them - This has caused my site to stop working.
Now when the page redirects to epdq it is saying that the "Encrypted data is not present"
The original code for the fsockopen function was:
$fp = fsockopen('ssl://secure2.epdq.co.uk'. $host, 443, &$errno, &$errstr, 60); if(!$fp) { print "$errstr ($errno)<br />\n"; } else { fputs($fp, "POST /cgi-bin/CcxBarclaysEpdqEncTool.e HTTP/1.0\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\n"); fputs($fp, "Content-length: ".strlen($params)."\n\n"); fputs($fp, $params."\n\n"); while(!feof($fp)) { $output .= fgets($fp, 1024); } fclose($fp); } $response_lines = explode("\n",$output); $response_line_count = count($response_lines); for($i=0; $i<$response_line_count; $i++){ if(preg_match("/epdqdata/",$response_lines[$i])) { $curlencrypt = $response_lines[$i]; } }They have suggested this code instead: $header = "POST /cgi-bin/CcxBarclaysEpdqEncTool.e HTTP/1.1\n"; $header .= "Host: secure2.epdq.co.uk\n"; $header .= "Connection: close\n"; $header .= "Content-Type: application/x-www-form-urlencoded\n"; $header .= "Content-Length: " . strlen($data) . "\n\n"; $fp = @fsockopen("ssl://secure2.epdq.co.uk", 443, $errno, $errstr, 30);and then suggested using this to align it with the way my page is coded: fputs( $fp, "Content-type: application/x-www-form-urlencoded\n" ); fputs( $fp, "Content-length: ".$strlength."\n\n" ); fputs( $fp, "Host: ".$host."\n\n" ); fputs( $fp, $postdata."\n\n" );Can anyone point me in the right direction with this...? Code: [Select] <?php error_reporting(0); $email = ""; $password = ""; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.myspace.com/auth/login"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'formLocation=splashForm&captchaHandler=%2FModules%2FPageEditor%2FHandlers%2FLogin%2F%7B0%7D.ashx&captchaResponse=&hash=MIGcBgkrBgEEAYI3WAOggY4wgYsGCisGAQQBgjdYAwGgfTB7AgMCAAECAmYDAgIAwAQIWWaRadlhotEEEA15tDCUhuiBjy8nd6RN3nEEUOoYRIpPoA1uOadO5d%252bIlVuABvbaJHaznd%252fYWuR4TWNS2GUAl1G3GQZjRPA3SL%252fUrRZuPbiFT3fBtQzYnvOaR1sP8KzrzVcLGCeUlIObGSsg&SMSVerifiedCookieToken=&NextPage=&js=1&Email='.urlencode($email).'&Password='.urlencode($password).'&Remember=true&loginBtn='); curl_setopt($ch, CURLOPT_REFERER,'http://www.myspace.com/index.cfm?fuseaction=splash'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, 'login.txt'); curl_setopt($ch, CURLOPT_COOKIEJAR, 'login.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_VERBOSE, 0); file_put_contents('output.txt', curl_exec($ch)); curl_setopt($ch, CURLOPT_URL, "http://www.myspace.com/games/play/104283"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)'); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_COOKIEFILE, 'login.txt'); curl_setopt($ch, CURLOPT_COOKIEJAR, 'login.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $output2=curl_exec($ch); if(stristr($output2, 'render.app#')){ preg_match('/\sid="apppanel_104283_canvas".*?render.app#([^&]+).*?viewerId=([0-9]+)/is', $output2, $matches); $GameLink = "http://api.msappspace.com/apprendering/104283/canvas/04082011040014/1_0_0/render.app#".$matches[1]; echo '<font style="BACKGROUND-COLOR: 15317E"><a href="'.$GameLink.'"><font color="white">'.$email.'</font>'; } sleep(1000); curl_close($ch); ?> I know this is possible to do the same exact thing with fsockopen, but I cannot get it for the life of me, any help is appreciated Okay guys, so i have a status checker connected to a mySql database. Now, what i want to do is have it check the status, then update the field in the table. Here is my code, please someone add or tell me how to add the update mysql thing. Code: [Select] <?php error_reporting(0); include '../dbc.php'; if(isset($_GET['id'])) { $id = intval($_GET['id']); //We check if the user exists $dn = mysql_query('select * from users where id="'.$id.'"'); if(mysql_num_rows($dn)>0) { $dnn = mysql_fetch_array($dn); //We display the user datas $offline='<font color="red">Offline</font>'; $online='<font color="green">Online</font>'; $host=(htmlentities($dnn['server_ip'])); $style=(htmlentities($dnn['style'])); $port=htmlentities($dnn['port']); $fp = fsockopen($host, 43594, $errno,$errstr, 4); if (!$fp){ echo('<font color="red">Offline</font>'); } else { $online=echo('<font color="green">Online</font>'); fclose($fp); } } } ?> Thanks, hope so one can help me I found a pretty cool function that allows me to ping Pingomatic for new blogs that I have. Great. Now I can automate the process instead of manually going to their website. My problem is actually simple. Sometime Pingomatic is quite busy and is unable to receive the request. I want to be able to check the status of my ping request but I don't know how to get this specific field/variable? from the result. Here is the ping script: Code: [Select] $title = "My blog title"; $url = "http://mynewbloglink"; function pingomatic($title,$url,$debug=true) { $content='<?xml version="1.0"?>'. '<methodCall>'. ' <methodName>weblogUpdates.ping</methodName>'. ' <params>'. ' <param>'. ' <value>'.$title.'</value>'. ' </param>'. ' <param>'. ' <value>'.$url.'</value>'. ' </param>'. ' </params>'. '</methodCall>'; $headers="POST / HTTP/1.0\r\n". "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)\r\n". "Host: rpc.pingomatic.com\r\n". "Content-Type: text/xml\r\n". "Content-length: ".strlen($content); if ($debug) nl2br($headers); $request=$headers."\r\n\r\n".$content; $response = ""; $fs=fsockopen('rpc.pingomatic.com',80, $errno, $errstr); if ($fs) { fwrite ($fs, $request); while (!feof($fs)) $response .= fgets($fs); if ($debug) echo "<xmp>".$response."</xmp>"; fclose ($fs); preg_match_all("/<(name|value|boolean|string)>(.*)<\/(name|value|boolean|string)>/U",$response,$ar, PREG_PATTERN_ORDER); for($i=0;$i<count($ar[2]);$i++) $ar[2][$i]= strip_tags($ar[2][$i]); return array('status'=> ( $ar[2][1]==1 ? 'ko' : 'ok' ), 'msg'=>$ar[2][3] ); } else { if ($debug) echo "<xmp>".$errstr." (".$errno.")</xmp>"; return array('status'=>'ko', 'msg'=>$errstr." (".$errno.")"); } } pingomatic($title,$url,$debug=true); This script works and when Pingomatic 'is available' returns something to the effect of Thanks for pinging, you're blog is being forwarded...etc. etc. When Pingomatic is too busy I receive the following result: Code: [Select] HTTP/1.1 200 OK Server: nginx Date: Mon, 30 Apr 2012 22:23:17 GMT Content-Type: text/xml;charset=utf-8 Connection: close Content-Length: 390 <?xml version="1.0"?> <methodResponse> <params> <param> <value> <struct> <member><name>flerror</name><value><boolean>1</boolean></value></member> <member><name>message</name><value><string>Pingomatic is a bit overloaded at the moment</string></value></member> </struct> </value> </param> </params> </methodResponse> What I'm trying to get in a variable is the '<member><name>message' result. In this case it's "Pingomatic is a bit overloaded at the moment". This way I can try to ping the server again later at another time knowing that the ping was not successful. What I've tried: I've attempted to see if the 'message' (Pingomatic is a bit overloaded at the moment) is in some of the variables within the original function: $pingresponse = "<xmp>".$errstr." (".$errno.")</xmp>"; $pingresponse2 = "<xmp>".$response."</xmp>"; $pingresponse3 = array('status'=> ( $ar[2][1]==1 ? 'ko' : 'ok' ), 'msg'=>$ar[2][3] ); echo "Ping Server Response : Debug: ".$debug." Errstr :".$errstr." Errno: ".$errno."Response: ".$response; But it isn't. My plan was to use strpos to search for the term "Pingomatic is a bit overloaded at the moment" in which I'll be able to know whether or not the ping was successful or not. Any ideas? I have this inside of a method: if($output){ $opt = fread($pointer, 10000); if(!$headers){ $opt = preg_replace("/http.+(\r\n\r\n|\n\n|\r\r)/isU", "", $opt); } echo $opt; } one of my methods uses fsocketopen to open a file and start processing it. I then have this method which reads out the data to the page. as the file is being processed. Here is the file that is being processed Code: [Select] <?php function flush_buffers(){ ob_end_flush(); flush(); ob_start(); } for($i=0;$i<10;$i++){ echo "Test1: $i"; flush_buffers(); usleep(500000); } ?> when http outputs the data it also outputs the buffer size as well. I ran it on two files, and here was my output: Code: [Select] Test1: cats b Test1: cats b Test1: cats b Test1: cats b Test1: cats b Test1: cats b Test1: cats b Test1: cats b Test1: cats b Test1: cats 0 Test2: 0 8 Test2: 1 8 Test2: 2 8 Test2: 3 8 Test2: 4 8 Test2: 5 8 Test2: 6 8 Test2: 7 8 Test2: 8 8 Test2: 9 Is there any way to remove the buffer size (the "8" and the "b")? I basically went off of this and converted it to a class: http://phplens.com/phpeverywhere/?q=node/view/254 define("DB_HOST", "localhost"); hi all First of all My client have dot net server on windows OS. They want to display some pages which are created by php. Is there any possibility to display like this. And How can i connect sql server using php on remote to retrieve data. Can any one tell me how can i do this. Thanks in advance Hey, I've had this problem for a couple days now, and haven't been able to work it out. I'm trying to connect to the Gamesurge IRC using PHP - though the code I am using times out and can't connect. I thought it was my code, however I have searched the web for working codes and they all *seem* to do the same basic thing as mine. So if anyone has any ideas as to why I am getting a timeout, I would appreciate it. The code I'm using. <?php error_reporting(E_ERROR); $cfg = array( "server" => "irc.gamesurge.net", "channel" => "#wiremod", "port" => 6667, "name" => "thetree PHP" ); echo "Connecting to " . $cfg["server"] . " on port " . $cfg["port"] . "<br/>"; $socket = fsockopen($cfg["server"], $cfg["port"], $errno, $errstr, 5); if (!$socket) { echo("Error[$errno]: $errstr...<br/>"); } else { echo "Socket connection successful..<br/>"; } fclose($socket); ?> Hosted file: http://joethetree.lil.org.uk/socket.php Thanks thetree Hello all, This is my first post in here, so go easy. I recently transferred my account from my local ISP to GoDaddy. And now my search criteria is not working. I am getting the follow error message on the page of my search box, instead of the graphics itself: Could not connect to MySQL:Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) I thought maybe this would be a simple error when I found out that GoDaddy does not use the "localhost" connect string. So I switched it to the local IP for GoDaddy still to no avail. I am lost after that. My PHP skills are limited. I was taught by a very advanced user who uses shortcuts and different strings self made for his ease. So looking online for solutions for the script was very hard(to me at least), because the lines of code do not match common scripts online. Is this a simple solution? Does the: global $dbc; @dbConnect(); function work with GoDaddy? Because I have seen maybe different ways to connect to a DB with PHP. Here's the script I am using to connect and extract results from the DB. Any and all help will be greatly appreciated. Thanks in advance. Using MySQL Version 4: <? @require("searchheader.php"); ?> <table cellpadding=10 cellspacing=0 border=0> <tr> <td align=left valign=top> <? displayMenu(); ?> </td> <td align=right valign=bottom> <? if($_GET["f_catid"]){ $num_cats = 5; for($i=1;$i<=$num_cats;$i++){ $where .= " or c".$i." = ".$_GET["f_catid"]; } $where = substr($where,4,strlen($where)); $sql = "select * from product where ".$where." order by product_name ASC LIMIT 0,20"; dbConnect(); $result = mysql_query($sql,$dbc); ?> <div class="search_results_menu"> <form action="[url=http://www.nexpart.com/extpart.php?part=]http://www.nexpart.com/extpart.php?part=[/url]<?=$r["part_number"]?>&linecode=<?=$row[" manufacturer"] ?>" method="GET"><input type="text" name="quantity" size="2" value="0" style="text-align: center;"><input type="button" name="submit_top" value="Check Out"> </form> <table class="search_results_found" bgcolor="#efefef" cellpadding=3 cellspacing=0 border=1 bordercolor="#000000" style="border:1px solid #000000;"> <tr bgcolor="#efefef"> <td class="search_results_title"><b>Manufacturer</b></td> <td class="search_results_title"><b>Part Number</b></td> <td class="search_results_title"><b>Part Name</b></td> <td class="search_results_title"><b>Price</b></td> <td class="search_results_title"><b>Image</b></td> <td class="search_results_title"><b>Add to Cart</b></td> </tr> <? if(mysql_num_rows($result) > 0){ while($row = mysql_fetch_assoc($result)){ ?> <tr bgcolor="#efefef"> <td><?=$row["manufacturer"]?></td> <td><a href="[url=http://www.nexpart.com/extpart.php?part=]http://www.nexpart.com/extpart.php?part=[/url]<?=$row["part_number"]?>&linecode=<?=$row["manufacturer"]?>"><?=$row["part_number"]?></a></td> <td><?=$row["product_name"]?></td> <td>$<?=$row["price"]?></td> <td><a href="[url=http://www.wlpsr.com/images/]http://www.wlpsr.com/images/[/url]"<?=$row["part_number"]?>".jpg " onClick="window.open('/images/<?=$row["part_number"]?>.jpg', '<?=$row["part_number"]?>', 'toolbar=yes, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, height=300, width=400'); return false">View</a></td> <td><form action="[url=http://www.nexpart.com/extpart.php?part=]http://www.nexpart.com/extpart.php?part=[/url]<?=$r["part_number"]?>&linecode=<?=$row["manufacturer"] ?>" method="GET"><input type="text" name="quantity" size="2" value="0" style="text-align:center;"> </form> </td> </tr> <? } } else{ ?> <tr> <td colspan=100 align="center"><b>No products in this category.</b></td> </tr> </table> <form action="[url=http://www.nexpart.com/extpart.php?part=]http://www.nexpart.com/extpart.php?part=[/url]<?=$r["part_number"]?>&linecode=<?=$row[" manufacturer"] ?>" method="GET"><input type="text" name="quantity" size="2" value="0" style="text-align: center;"><input type="button" name="submit_top" value="Check Out"> </form> </td> </tr> <? } ?> </td> </tr> </table> </div> <? } ?> <div class="form"> <form name="search" action="<? echo $_SERVER['PHP_SELF']; ?>" method="GET"> <input type="text" name="f_keywords" size="17" value="" maxlength="100"> <input type="image" src="gobutton.gif"> </form> </select> <br><br><br> <? $trimmed = trim(strip_tags($_GET["f_keywords"])); //Set the database access information as constants. if(strlen($trimmed) > 0){ define ('DB_USER', 'USERNAME'); define ('DB_PASSWORD', 'THEPASSWORD'); define ('DB_HOST', 'LOCALIP'); define ('DB_NAME', 'DBNAME'); define ('DB_TABLE', 'TABLE'); //Make the connection to the DB global $dbc; @dbConnect(); $query = "SELECT * FROM product WHERE manufacturer LIKE '%$trimmed%' OR part_number LIKE '%$trimmed%' OR price LIKE '%$trimmed%' OR product_name LIKE '%$trimmed%' order by manufacturer"; $result = mysql_query($query); $count = mysql_numrows($result); if ($trimmed == "") { echo "Please enter a search criteria..."; exit; } // check for a search parameter if (!isset($result)) { echo "<p>Please enter a search parameter!</p>"; exit; } $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); if ($numrows == 0) { echo "<h4>Results</h4>"; echo "<p>We are sorry <b>$trimmed</b> has returned zero results.</p></font>"; } // next determine if s has been passed to script, if not use 0 if (empty($s)) { $s=0; } // get results $result = mysql_query($query,$dbc); if($numrows < 1){ $return= "results";} else{ $return = "result"; } if($numrows > 1){ $return = "results";} else{ $return = "result"; } // display what the person searched for echo "Your search for ", " <b>$trimmed</b> ", " found <br><b>$numrows $return.</b>"; // begin to show results set $count = 1 + $s ; } if(strlen($trimmed) > 0){ ?> </div> <div class="search_results"> <table cellpadding=0 cellspacing=0 border=0> <tr> <td align="right"> <form action="[url=http://www.nexpart.com/extpart.php?part=]http://www.nexpart.com/extpart.php?part=[/url]<?=$r["part_number"]?>&linecode=<?=$row[" manufacturer"] ?>" method="GET"><input type="text" name="quantity" size="2" value="0" style="text-align: center;"><input type="button" name="submit_top" value="Check Out"> </td> </tr> <tr> <td> <table class="search_results_found" bgcolor="#efefef" cellpadding=3 cellspacing=0 border=1 bordercolor="#000000" style="border:1px solid #000000;"> <tr> <td width="100" class="search_results_title" align="center"> Manufacturer </td><td width="70" class="search_results_title" align="center"> Part Num. </td><td width="115" class=" search_results_title" align="center"> Description </td><td width="60" class="search_results_title" align="center">Price</td><td width="45" class=" search_results_title" align="center"> Image </td><td width="105" align="center"><b>Add to Cart</b> </td> </tr> </td> </tr> <? while ($r= mysql_fetch_array($result)) { $manufacturer = $r["manufacturer"]; $part_number = $r["part_number"]; $product_name = $r["product_name"]; $price = $r["price"]; $count++; echo "<tr><td>$manufacturer</td><td>"; echo "<a href=\"[url=http://www.nexpart.com/extpart.php?part=]http://www.nexpart.com/extpart.php?part=[/url]".$r["part_number"]."&linecode=".$r["manufacturer"]."\">".$r["part_number"]."</a></td><td>"; echo "$product_name</td><td>"; echo "$ $price</td><td>"; echo "<a href=\"[url=http://www.wlpsr.com/images/]http://www.wlpsr.com/images/[/url]".$r["part_number"].".jpg \" onClick=\"window.open('/images/".$r["part_number"].".jpg', '".$r["part_number"]."', 'toolbar=yes, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, height=300, width=400'); return false \">View</a></td><td>"; echo "<form action=\"[url=http://www.nexpart.com/extpart.php?part=]http://www.nexpart.com/extpart.php?part=[/url]".$r["part_number"]."&linecode=".$r["manufacturer"]."\" method=\"GET\"><input type=\"text\" name=\"quantity\" size=\"2\" value=\"0\" style=\"text-align:center;\"></td></tr>"; } ?> </table> <tr> <td align="right"> <form action="[url=http://www.nexpart.com/extpart.php?part=]http://www.nexpart.com/extpart.php?part=[/url]<?=$r["part_number"]?>&linecode=<?=$row[" manufacturer"] ?>" method="GET"><input type="text" name="quantity" size="2" value="0" style="text-align: center;"><input type="button" name="submit_bottom" value="Check Out"> </td> </tr> <? } ?> </table> <br><br> </div> <? @require("footer3.php"); ?> Mod edit: [code] . . . [/code] tags added. hello, if i have an entry in a table called company on database cc, would the following be the propper code? im getting a blank page. Code: [Select] <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'mike'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'cc'; mysql_select_db($dbname); $query = "SELECT * FROM company"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "Name :{$row['compant']} <br>" . "Subject : {$row['address']} <br>" . } ?> |