i am having a problem with a while statement here is the code
Code: [Select]<?php
session_start();
if(!session_is_registered(username)){
header('location:login.php');
}
?>
<?php
include'db.php';
// Php Suubmit if and mysql insert
if(isset($_POST['Submit'])) {
$code=$_POST['code'];
mysql_query("INSERT INTO Ads
(id, Html) VALUES( NULL, '$code' ) ")
or die(mysql_error());
// pull out code
$result = mysql_query("SELECT * FROM Code WHERE id='1'");
while($row = mysql_fetch_array($result))
//find ad id
$res = mysql_query("SELECT * FROM Ads WHERE html='$code'");
while($row1 = mysql_fetch_array($res))
echo"
<label>
<textarea name='paste_code' id='paste_code' cols='100' rows='5'>
<?php
include 'db.php';
". $row['ad'] ." = mysql_query(". $row['lick'] ." SELECT * FROM Ads WHERE id='". $row1['id'] ." '". $row['lick'] ." );
while(". $row['row'] ." = mysql_fetch_array(". $row['ad'] ."))
{
". $row['echo1'] ."
". $row['echo2'] ."
}
?>
</textarea>
</label>";
}
else
{
echo"
<table width='439' height='351' border='0'align='center'>
<tr>
<td width='293'><form id='form1' name='form1' method='post' action=''>
<label></label>
Paste Html Here
</td>
<td width='136'> </td>
</tr>
<tr>
<td><textarea name='code' id='code' cols='45' rows='5'></textarea></td>
<td> </td>
</tr>
<tr>
<td><label>
<center> <input type='submit' name='Submit' id='Submit' value='Submit' /></center>
</label> </form></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Add</title>
</head>
<body>
</body>
</html>
it does not pull out both just one i am writing the code wrong
thank you
php title problem
Hi,I am having a problem managing my page title with PHP.Currently I have my <title> tags in each PHP document, followed by my header.php which has my functions.php file contained in it.
Beginners syntax and loop questions - help please!
Hi everyone,I have some problems with php code. I'm currently in the middle of learning php, but these problems have got me stuck fast. But also have a question regarding looping that i'll ask in the
Return X values where an ID number doesnt matter
Well as for subject heading, thats the best i could think of.Currently im having a problem with a rather old piece of script i had written for a guestbook.The guestbook itself relies completely on the
Checkbox info wont include in Mailto
Hey, im new to php.Basically I have made a form to request which type of job(s) are needed, which when filled will then be sent to an email address.The problem im having is that when more than 1
Displaying an image using echo command
I had done a query on my database, one of the fields being an image reference to a directory where an image is stored. e.g "/images/picture.jpg"I want to display this image by using
reading partial code from external site
Hi,I am trying to write a script for my website to get an article from an external website. The external website has the article in a set of tags <roottag> &
send() and recv() parameters confusion
On server Side:
Question handling xml data
Hello, I have sucessfull followed this tutorialhttp://www.phpfreaks.com/tutorial/handling-xml-dataand used xpath to find the books I need, here is my codeCode: [Select]<?php// load
I need an iframe that calls up a different page according to the date
hiI don't know any php (only html) and I urgently need to do the following: I need an iframe that calls up a different page according to the date e.g. on the 2th Dec a page called 'special2.php',
Dealing with code in db query
I am dealing with C code and I need to make sure it is encoded some how to ensure its integrity and then decoded. For security and later readability.