Jump to content

pouncer

Members
  • Posts

    324
  • Joined

  • Last visited

    Never

Everything posted by pouncer

  1. I have a table called 'dvds' it has fields like: dvd name, description, fav_actor, release_year, etc etc basically its for users to add their favourite dvd's. what I need to do is create a form (by code) based on the fields because admins can add new fieldnames to the dvds table. im thinking i need to loop through the fieldname and create the text boxes on the form for each field, but im a bit unsure. could someone give me any ideas on how to do it? i also need to check each fields type, if it is of type 'TEXT' then i want to add a multi line text box on the form for this field. i really hope someone can show me how to do this, thanks!
  2. to insert $Desc = nl2br(mysql_escape_string($_POST['txt_Description'])); i inserted it but still when i display it, it still not appearing on multiline (btw when i dislay it, its in a table like <td align=center bgcolor=#F5F5FF>$description</td>
  3. $Desc = mysql_escape_string($_POST['txt_Description']); thats my description text box, which is what i insert into my sql table say if i enter my description like this: hello, these are my favourite dvd's !!!!! When i query my database to display it, it gives me: hello, these are my favourite dvd's!!!!! the exclamation marks should be on a new line right!??? $description = stripslashes($row['description']); thats how im getting it! echo $description;
  4. ahhhh, i seee! thank you so much
  5. ahhh, i see now mate. very nice. I was looking at how i could add a counter for each record like you added $i in the for loop. thanks! and also % is mod? which calculates the remainder?i just noticed you have if($i%3 == 0) twice :s and also, shouldnt i start at 1? since if its 0, it will display 0 1 2 3 which is 4?
  6. At the moment, I've got something like this. echo " <table width=90% cellpadding=0 cellspacing=1 border=0 align=center> <tr> <th>Item</th> <th>Description</th> </tr>"; while ($row = mysql_fetch_array($sql, MYSQL_ASSOC)) { echo " <tr> <td>$item_name</td> <td>$item_description</td> </tr>"; } echo "</table>"; But I want to change the table layout. I want to make a 3 by 3 table (9 slots) and put all the data in 1 slot at a time, can someone show me how to change the table layout?
  7. i don't get it. how would i change the order in the first place, on the php page.
  8. I have a table called forum_name with these fields forum_id (primary key) user_id (user id of admin who made the new discussion forum) forum_name forum_description Basically, I've just made a simple form for the admin to fill in a new forum name and descriptino and it inserts it into the database on those fields. However, what i need help on, is the ordering. I want to be able to change the order in which i display the discussion forums. e.g, if i made a forum for 'cars' then another forum for 'interests' this will display on the forums page cars interests how could i swap the order so it displays interests cars could someone show me a solution as to how i can do it please?
  9. thanks alot steve. i basically changed my httpd.conf listening 80 to 8080 and port forwarded 8080 to my router ip i now have to do http://myip:8080/whateverpages.php but it wrks for everyone now wud have been nice without the 8080 but i cudnt get port forwarding to wrk for port 80 :s
  10. its my external ip, my internal one is 192.168.1.2 which is my router ip so it definetely sounds like a router redirect problem? where are your links mate, the apache board this is the board right? is it port forwarding i need to do? when i do http://192.168.1.2/whateverpage.php - this works fine it's just my external ip which i badly need to get working
  11. ok ive downloaded and setup wamp 1.6.6. everything works fine when i preview files on the web by http://localhost/whateverfile.php but when i do http://81.my.ip.68/whateverfile.php it doesnt work, it asks for some username/password and i just asked my friend now to check on his pc, what that link gives him and he gets the 'page not displayed' error anyone know what i change to get it working? (i really hope it isn't my router causing this?)
  12. Well this is the whole page. The line is near the middle where it checks for errors [code] <?php require_once('keys.php') ?> <?php require_once('eBaySession.php') ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <TITLE>GetSearchResults</TITLE> </HEAD> <BODY> <FORM action="GetSearchResults.php" method="post"> <TABLE cellpadding="2" border="0"> <TR> <TD>Query:</TD> <TD><INPUT type="text" name="Query"></TD> </TR> <TR> <TD colspan="2" align="right"><INPUT type="submit" name="submit" value="Search"></TD> </TR> </TABLE> </FORM> <?php if(isset($_POST['Query'])) { //Get the query entered $query = $_POST['Query']; //set the number of results to return per call $maxResults = 15; //set the number of results to skip before starting to return results //used for paginated results (if MaxResults=15 then:  0 = page 1, 15 = page 2, ....) $skip = 0; //whether or not to search in description fields of items (0 = no, 1 = yes) $searchInDescription = 0; //SiteID must also be set in the Request's XML //SiteID = 0  (US) - UK = 3, Canada = 2, Australia = 15, .... //SiteID Indicates the eBay site to associate the call with $siteID = 0; //the call being made: $verb = 'GetSearchResults'; ///Build the request Xml string $requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>'; $requestXmlBody .= '<GetSearchResultsRequest xmlns="urn:ebay:apis:eBLBaseComponents">'; $requestXmlBody .= "<RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>"; $requestXmlBody .= "<Query>$query</Query>"; $requestXmlBody .= '</GetSearchResultsRequest>'; //Create a new eBay session with all details needed, CompatabilityLevel = 433 and using the test server $session = new eBaySession($userToken, $devID, $appID, $certID, false, 433, $siteID, $verb); //send the request and get response $responseXml = $session->sendHttpRequest($requestXmlBody); if(stristr($responseXml, 'HTTP 404') || $responseXml == '') die('<P>Error sending request'); //Xml string is parsed and creates a DOM Document object $responseDoc = new DomDocument(); $responseDoc->loadXML($responseXml); //get any error nodes $errors = $responseDoc->getElementsByTagName('Errors'); //if there are error nodes if($errors->length > 0) { echo '<P><B>eBay returned the following error(s):</B>'; //display each error //Get error code, ShortMesaage and LongMessage $code = $errors->item(0)->getElementsByTagName('ErrorCode'); $shortMsg = $errors->item(0)->getElementsByTagName('ShortMessage'); $longMsg = $errors->item(0)->getElementsByTagName('LongMessage'); //Display code and shortmessage echo '<P>', $code->item(0)->nodeValue, ' : ', str_replace(">", "&gt;", str_replace("<", "&lt;", $shortMsg->item(0)->nodeValue)); //if there is a long message (ie ErrorLevel=1), display it if(count($longMsg) > 0) echo '<BR>', str_replace(">", "&gt;", str_replace("<", "&lt;", $longMsg->item(0)->nodeValue)); } else //no errors { //get results nodes $itemNodes = $responseDoc->getElementsByTagName('Item'); //see if there are any results if($itemNodes->length > 0) { ?> <TABLE cellpadding="6" cellspacing="0" border="0"> <TR bgcolor="#BBBBBB"> <TD><B>Id</B></TD> <TD><B>Title</B></TD> <TD><B>Price</B></TD> <TD><B>Started</B></TD> <TD><B>Ends</B></TD> </TR> <?php //stores the alternationg background colour of the rows $bgColor = "#FFFFFF"; //go through each result foreach($itemNodes as $item) { //get the required nodes from the results $itemID = $item->getElementsByTagName('ItemID'); $title = $item->getElementsByTagName('Title'); $price = $item->getElementsByTagName('CurrentPrice'); $startTime = $item->getElementsByTagName('StartTime'); $endTime = $item->getElementsByTagName('EndTime'); $link = $item->getElementsByTagName('ViewItemURL'); //display the result in a table row ?> <TR bgcolor="<?php echo $bgColor ?>"> <TD><?php echo $itemID->item(0)->nodeValue; ?></TD> <!-- Display the Title as a link to the item on eBay --> <TD><A href="<?php echo $link->item(0)->nodeValue; ?>" target="_blank"> <?php echo $title->item(0)->nodeValue; ?> </A> </TD> <TD><?php echo $price->item(0)->nodeValue; ?></TD> <TD><?php echo $startTime->item(0)->nodeValue; ?> GMT</TD> <TD><?php echo $endTime->item(0)->nodeValue; ?> GMT</TD> </TR> <?php //alternate the background colours $bgColor = $bgColor == "#FFFFFF" ? "#EEEEEE" : "#FFFFFF"; } ?> </TABLE> <?php } else { echo '<P><B>No items found</B>'; } } } ?> </BODY> </HTML> [/code]
  13. problem is, i downloaed wamp with php/mysql/apache and it all works on my localhost but when i upload it to my ftp, thats when i get the errors, could it be the php version? this is what im doing it off: http://developer.ebay.com/quickstartguide
  14. Parse error: parse error, unexpected T_OBJECT_OPERATOR in c:\domains\interzurf.nl\wwwroot\socialnetwork\GetSearchResults\GetSearchResults.php on line 72 line 72 is this $code = $errors->item(0)->getElementsByTagName('ErrorCode'); (this is a ebay file, im using this ebay api stuff to display ebay items on my site)
  15. [quote author=kenrbnsn link=topic=124219.msg514435#msg514435 date=1169854109] Ok. I tried your function on my machine and got a Javascript error until I changed the "esleif" to "else if", then it worked. Ken [/quote] thanks. worked
  16. but isn't that gonna be the time off the server? thats why i was using javascript so its the clients time
  17. and also: document.write(objDate.getHours()); puts 23 on my page so the javascript stuff is working, but it just doesnt put the good morning of evening stuff on??? :s
  18. If I use this [code] function GetGreeting() { ?> <script> document.write("dfsdfsd"); </script> <?php } [/code] then $log-GetGreeting() puts  dfsdfsd on the page - fine. But this doesnt work: [code] function GetGreeting() { ?> <script> var objDate = new Date(); if (objDate.getHours() < 12) document.write("Good morning"); elseif (objDate.getHours() < 16) document.write("Good afternoon"); else document.write("Good evening"); </script> <?php } [/code]
  19. [code] function GetGreeting() { return '<script> var objDate = new Date(); if (objDate.getHours() < 12) document.write("Good morning"); elseif (objDate.getHours() < 16) document.write("Good afternoon"); else document.write("Good evening"); </script>'; } [/code] It's a function inside my php class, but when i do $log->GetGreeting() it just doesn't work.
  20. ahh i see so is this correct function Get_Occupation() { return $this->row['Occupation'] != "" ? $this->row['Occupation'] : 'Undisclosed'; }
  21. say for e.g function Get_Occupation() { return $this->row['Occupation']; } does php have a iif function? so in 1 line i can do something like return iif($this->row['Occupation'] != "", $this->row['Occupation'], "Undisclosed"); so to say if the occupation isnt blank, return it, otherwise return 'undisclosed' any one know?
  22. [code] <?php if (isset($_POST['Submit_x'])) { $message_id = $_POST['message_id']; // here i need to remove the record from table private_messages where the message_id=$message_id } ?> [/code] can someone please show me the correct php sql syntax?
  23. yeahh this worked [code] <?php if (isset($_POST['Submit_x'])) { $message_id = $_POST['message_id']; echo "to delete: " . $message_id; echo "<meta http-equiv=\"refresh\" content=\"4; url=myprivatemessages.php\" />"; } ?> [/code]
  24. hmm ok thanks jess. will it work if i put a timer on the reload?
×
×
  • 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.