231 Posted Topics
Re: Okay, the correct way to do this will depend on what your form action and method are set to do. If you could post your form code I should be able to help. | |
Re: You shouldn't need a template to do this! Just look at the CSS. The easiest way to do this is to create a <div> tag that wraps around all your content, then specify the width of it using CSS. [CODE] <html> <head> <style type="text/css"> container { width: 100%; } </style> … | |
Re: If you are using Linux, you can set up a cron job. The cron daemon provides the ability for a system administrator or any other user (if permitted to do so) to automate the routine running of scripts, tasks or any other server function on a regular basis. You can … | |
Re: So what's the error you're getting? Try this and report back with the error message: [CODE] $Query = mysql_query("INSERT INTO products (title, url, finalurl, category, owner, shortdescription, longdescription, price, rank, tag1, tag2, tag3) VALUES ('$Title','$Random_Number','$url','$Category','$Username','$SD','$LD','$Price','0','$Tag1','$Tag2','$Tag3')") or die(mysql_error()); echo "Yes! Your product was created I hope " . $Title . " … | |
![]() | Re: You get this error message because you're trying to retrieve $_GET['start'] from the URL when it doesn't exist. Why not check whether the variable exists before deciding what to do with its value. E.g. [CODE] <?php if (isset($_GET['start'])) { $start = $_GET['start']; } else { $start = 0; } ?> … ![]() |
Re: I developed an online auction website for my final yr project. It's a pretty good project to do - lots of potential for interactive and business-like features. And to add to that - in my opinion, for a final year project it shouldn't really matter if a jQuery feature doesn't … ![]() | |
Hi all, How can I execute an external program (wget) on a linux box? I assume I should be using exec() or something similar. The command I'm trying to execute is: [CODE]wget -p 'x.x.x.x/inventory.ssi?mag_0=1&mag_1=1'[/CODE] Which returns the html page of inventory. I am then parsing the file using DOMDocument to … | |
Re: Have a look at the BETWEEN function in MySQL. You could try this, although I really don't know whether it will work in the format you're using. Worth a try though [CODE]("SELECT * FROM mytable WHERE date BETWEEN '12-10-2010' AND '12-10-2010'");[/CODE] | |
Okay, I've been racking my brain trying to figure this one out but the more I try, the more I get stuck. I need to construct a multi-dimensional array as follows, so for each iteration there are 4 values added to the array. (there is a total of 6 iterations, … | |
Hi all, I'm trying to figure out how to stop MySQL errors being displayed to the user. I have turned off all the necessary options in php.ini such as [CODE]display_errors = Off log_errors = On error_log = /path/to/log/[/CODE] I have even tried to override these settings using ini_set() in my … | |
Re: You can still use the $_GET method to grab variables from your URL using form method="post", but you'd have to append the Id variable to the form action like this: [CODE]<form action="<?php 'process.php?id=$id' ?>" method="post">[/CODE] (that's if you're actually using a form, you haven't stated whether you are). Can you … | |
Re: I *think* in this case they will be two copies of the same value. You could probably check for definite if you use the PHP debugger in Linux CLI. | |
Re: Using <center> is deprecated since HTML 4.0. You should use CSS to control the styles: [CODE] <style type="text/css"> td.tdcenter { text-align:center; padding: 2px; } </style> <tr> <td class="td_center"> <input type="button" class="btn" value="New" name="New" onClick="window.location.href='new2.php'" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" align="absmiddle"> <input type="submit" value="Delete" name="delete" class="btn" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" ></td> </tr> [/CODE] | |
Re: Personally, I wouldn't rely on updating your database to determine this. Precisely for the reason you just mentioned and it isn't necessary. Have a read of this chapter of the php manual to see what fits your bill [url]http://www.php.net/manual/en/features.http-auth.php[/url] | |
Re: I don't fully understand what you're asking. But PHP is a server-side language - Meaning that any request by the client must be sent to the server so PHP can process it. You can process form data on the same page by using the $_SERVER global, as long as it … | |
Re: I've never come across that message before but what Firefox is telling you is that the site is redirecting you in a loop E.g. Page A sends you to Page B which sends you to Page A. An alternative is to install Google Chrome and see if you get a … | |
Re: So $testname is going to be your array right? Try: [CODE]$testname[] = "|".$row['full_path']."|";[/CODE] Then you could use a foreach() to loop through the array and apply the explode() function | |
Re: You can use Javascript inside a php function to control your redirects. [CODE] <?php redirect("www.redirecting.com/page.php"); function redirect($url) { ?> <script type="text/javascript"> window.location = "<?php echo $url ?>" </script> <?php } ?>[/CODE] | |
Re: You can use another regular expression to decide whether to allow/deny the email address. [CODE](\.([a-z]{3})$)[/CODE] I'm no expert on these, but *I think* this will match ".com" at the end of the email address, so you'll need to work on how to match the sub-domains that you want to allow … | |
Hi all, I have virtually no knowledge of C, but I have a problem with one of my scripts. It runs fine on a 64-bit Linux machine, yet it gives me a seg fault when run on 32-bit linux. gdb tells me that the seg fault occurs on line 314. … | |
Re: Try re-writting your query so that it looks something like this: [CODE] $insert = mysql_query("INSERT INTO info (field1,field2,field3) VALUES ('$fname','$lname','$note')") or die(mysql_error()); [/CODE] (replacing <field1><field2> etc with the names of the corresponding columns in your database) | |
Re: You can use strlen() to check this. [CODE] if(strlen($x) ==0) { echo "X is blank"; } [/CODE] | |
Re: You can break out of the php tags to make it a bit more manageable: [CODE] <td><a class="mylink" href="<?php 'www.'.$row['website']; ?>"> <?php echo "www.$row['website']" ?></a></td> [/CODE] You'll also need an image link for the thumbnail... [CODE]<td> <img src="/path/of/image" alt="image description" href="<?php $row['url'] ?>" height="78px" width="78px"></td>[/CODE] This prints "www.outputsite.com" and the … | |
Re: Your coding was slightly incorrect. Your input field AND your submit button have the same names (name="submitcost"). This works: [CODE] <?php if (isset($_POST['submit'])) { $price = $_POST['submitcost']; echo $price ."<br>"; echo "it works"; } ?> <form name="unitcost" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input ID="submitcost" name="submitcost" size="21" maxlength="20" VALUE=""> <input … | |
Re: [CODE]$result = mysql_query ("select Name from dba.wx_faq_backup group by Name") or die (mysql_error()); echo "<select name='DB_Backup' value=''>Database Backup</option>"; $i=1; while($nt=mysql_fetch_assoc($result)) { echo "<option selected value='$i' > $nt[Name] </option>"."<BR>"; $i++; } echo "</select>"; [/CODE] Before, you were populating the value of the selection, rather than the actual selection option. You may … | |
![]() | Re: Personally, I find IDEs to be a waste of time. I just stick to the good old fashioned Notepad++ for windows, or gedit/kate for linux Here's a list you can look at though [url]http://www.ibm.com/developerworks/opensource/library/os-php-ide/index.html[/url] (Eclipse seems to be a popular one) ![]() |
Re: Hi there, All Linux distros have some differences... But essentially, they all perform the same operations, albeit with slight desktop and/or command-line variations. CentOS is a good, (free) RedHat-based distro, whereas Fedora is based on a debian system. When I first began using Linux I used Ubuntu (another debian based … | |
Re: This should get you started... It permutes the string, working out each combination. But it only works out combinations with the same amount of characters of the input string. E.g. The 4 letter string "abcd" returns the following 4 letter combinations: abcd abdc acbd acdb adcb adbc bacd badc bcad … | |
Re: Looks like there's a few bugs in there... 1. You have commented out the filename so you're pointing to just 'a'. Not sure what you're trying to do here... This makes no sense! Also, you're trying to write three lines of code on one line... You should concatenate these lines … | |
Re: [QUOTE]Do i need to mount? Do i need to repartition?[/QUOTE] I'm not sure what exactly you're trying to do here... All you need for users to connect is a correct network set up with the correct services running. You could mount the VM disk over the network as well if … | |
Re: you could create a loop and counter to count the number of users... [CODE] $sql = "SELECT COUNT(CDID) AS total FROM rtnUser GROUP BY CDID"; $query = mysql_query($sql); $count=0; while ($recordset = mysql_fetch_assoc($query)) { $count++; } echo "$count"; [/CODE] | |
Hi all, I'm relatively new to Perl and particularly new to regular expressions. This is really simple script I've just mocked up. All it does is to take the input string and check if it's in the correct format or not. Here are some examples of correct format (will always … | |
Re: Sounds like a driver issue. Have you checked whether your hardware is supported on Ubuntu? I had the same problem with a Netgear wireless dongle. Have you using a wired connection? | |
Re: I did an Online Auction website for my first PHP project. It took about 8 weeks of hard work. Depends on how much time you have I guess... | |
Re: Why not put your function(s) in a seperate file, and include that file as you need it File1.php [CODE] function stuff() { // do some stuff... } [/CODE] File2.php [CODE] include('File1.php'); $location=stuff(); echo $location; [/CODE] | |
Re: I've never used access, but you should be able to do the processing using PHP First, convert to returned datetime variable to a unix timestamp Then apply the date() function to display just the bits you want. [CODE] $date=odbc_result($query); $convert_date = strtotime($date); $formatted_date = date("Y-m-d", $convert_date); echo $formatted_date; [/CODE] Should … | |
Re: [CODE] for ($i=0;$i<=$x;$i++) { $query = mysql_query("select amount_id from payment where admission_no='$admission_no[$i]'") or die (mysql_error()); }[/CODE] You do not need to concatenate the query/variable. Just put single quotes around the variable you're inputting | |
Re: I would suggest staying away from Iframes as many browsers don't have good support for them. Instead I would recommend using html <div> tags to display each 'section'. Then each topic has a hyperlink that references content.php with an added topic variable. Eg: [CODE] Topics: <a href="content.php?topic=12">Global Warming</a> <a href="content.php?topic=13">Child … | |
Re: First of all, you won't be inserting an actual image into mysql. You will upload the image into a folder on your server, then MySQL will provide a link or path to that location, so the image can be displayed. You'll need a column in your database called 'image' and … | |
Re: [CODE]<textarea value="<?php echo $_POST["article_summary"] ?>"></textarea>[/CODE] Maybe something along the lines of this? Although I'm not sure that will work edit: yeah, that definately doesn't work... ... text areas don't allow their content to be formatted differently. So I really don't know if it is possible to display a link like … | |
Re: Actually, mysql_fetch_array can return a result row as an associative array, a numeric array, or both! [url]http://php.net/manual/en/function.mysql-fetch-array.php[/url] Although I usually use mysql_fetch_assoc() as it's easier to determine the result resource. Are you receiving any errors? Instead of this: [CODE]$query = "SELECT * FROM lgmsevze_sunbrite.webtemps LIMIT 0, 2"; $sql = mysql_query($query);[/CODE] … | |
Re: Obviously PHP as this is a PHP forum! :D | |
Re: You could use CSS display:none; or in HTML: <style="display:none;"> tag if you simply want to hide the image. I expect you're using a submit button to remove the image? [CODE] <?php if(isset($_POST['remove'])) { ?> <div id="image" style="display:none;"> //image here </div> <?php } else { ?> <div id="image"> //image here </div> … | |
Re: If you want to use smarty for documentation, then you can use a tool called phpdocumentor. [url]http://www.phpdoc.org/[/url] | |
Re: Can you give us some examples of the characters you're trying to display? Try: [CODE]<meta http-equiv="content-type" content="text/html; charset=windows-1251" />[/CODE] | |
Re: Not exactly sure about this, but it could be because your search input field is saved as a variable. When you navigate to the next page, the variable is lost. You may be able to save the input text in a session, so it is available across all pages of … | |
Re: [CODE] <?php if ($Valid == 0) { echo 'Incomplete Data, Redirecting...'; Redirect("QuoteAgeError.html"); } /** * JavaScript Redirect Function - Redirects the user should the result data be empty * @param string $url the dynamic url to redirect to */ function Redirect($url) { ?> <script type="text/javascript"> window.location = "<?php echo $url … | |
Re: You will need to define the requirements for the system before that question can be answered. There is no set language for a particular type of project. It is down to you to recognise what is needed, what are the inputs and outputs, how will the users interact with the … |
The End.