231 Posted Topics

Member Avatar for itisnot_me

Hey. You'll need and if statement that takes the input value and checks to see what range it's in. Pretty simple really... [CODE] if ($input >= 0 and $input < 10) { echo "Input = 0-9"; } elseif ($input >= 10 and $input < 20) { echo "Input = 10-20"; …

Member Avatar for diafol
0
88
Member Avatar for Sorcher

You can have a look at this function I used a while ago to determine the file extension: [CODE] //--- DETERMINES IMAGE EXTENSION ---// function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str)-$i; $exten = substr($str,$i+1,$l); return $exten; } $errors = 0; $filename = …

Member Avatar for Sorcher
0
220
Member Avatar for facarroll

You'd do exactly the same as you would for a normal field. Create the necessary fields using [CODE]<input type="hidden" value="groupX" name="groupX">[/CODE] Then on adminlogin.php get the value of the hidden field: [CODE] $hidden_field = $_POST['groupX']; //Then insert into the database along with the text field as necessary [/CODE]

Member Avatar for facarroll
0
102
Member Avatar for sakush100

Create an array with all the months in it. Then if 5 is supplied as the month, just access the 5th element of the array. You may want to put a dummy value in location 0 of the array so it makes it a bit easier to access the correct …

Member Avatar for kylegetson
0
107
Member Avatar for andydeans

[CODE] $date = $_POST['date']; $time = $_POST['time']; $datetime = $date ." ". $time; [/CODE]

Member Avatar for andydeans
0
75
Member Avatar for miss_indie

You need to change 'else' to 'elseif' for each of the statements. as hielo suggested, Quotation marks are required around the remark values Also 'totalg' needs the '$' prefix! It is a variable.

Member Avatar for miss_indie
0
104
Member Avatar for davidjennings

strange... the code looks okay to me. Maybe start commenting out blocks of code to narrow down where the problem is occurring?

Member Avatar for davidjennings
0
177
Member Avatar for gchurch

I'm not sure, I have never tried passing an array as a URL parameter. However, you could save the array as a session and simply get the contents of it on the payment page. Or even a bunch of hidden fields and get the values through $_post rather than $_get?

Member Avatar for gchurch
0
115
Member Avatar for spideyprasad

You can use sessions and/or cookies to accomplish this. E.g: 1. When each user logs in, start a session containing their username. 2. Simply check the content of the session variables to determine who is logged in 3. Close their session when the user has logged out. There is tons …

Member Avatar for fusedreality
0
106
Member Avatar for bjc999
Member Avatar for nonshatter
0
167
Member Avatar for iLoveNoodle

Yes of course there is! Although most companies have their own preference of CMS. Drupal, Joomla, Wordpress or their own custom one. So sound knowledge of a few of these, along with other web programming skills would make you desirable. I noticed that it is often the smaller > medium …

Member Avatar for nonshatter
0
45
Member Avatar for malvi

Use Notepad++ It's by far the best Windows editor in my opinion. XAMPP for windows is also good (and free). It installs Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, JpGraph, FileZilla FTP Server, mcrypt, …

Member Avatar for Stefano Mtangoo
0
81
Member Avatar for facarroll

Can you show us an example of what is contained within $thumbnail? Try removing the <br> and the '.=' may want to be changed to '=' You are allowed to use variables in path names. Are you using a windows or linux host?

Member Avatar for facarroll
0
1K
Member Avatar for mpc123

You will need to get a PayPal button from the paypal website. From what I remember, there are two types or button, an encrypted one or an unencrypted one. I think you need an unencrypted one if you wish to plug in your own php variables into the paypal form. …

Member Avatar for nonshatter
0
109
Member Avatar for tbaba83

Please remember to wrap your code in [ code ] tags. What exactly do you mean by "everytime i run the sign.php form and i input entries into the form, i get this:" . Does the db connection file have <?php ?> tags?? [CODE]<?php mysql_connect("localhost", "root","mobolaji") or die ("Could not …

Member Avatar for tbaba83
0
162
Member Avatar for valonesal

Don't quote me on this, but I think it's because the array you're passing the foreach loop isn't initialised. I find the following to be interesting in the man page: [CODE]foreach works only on arrays, and will issue an error when you try to use it on a variable with …

Member Avatar for nonshatter
0
509
Member Avatar for asifsomy

Welcome asifsomy, well I'm not sure if I'm able to give you a detailed answer, but judging from my previous experience with Wordpress, I found it was quite limited and flat as a development platform. I've heard that alternatives such as Joomla and Drupal have far better project manipulation. If …

Member Avatar for nonshatter
0
132
Member Avatar for micahgeorge

You will need some sort of regular expression to find the matching word. E.g: [CODE]$i=0; while (there are results) { if(preg_match("/the search term/i", $results[$i], $yellow)) { echo "<span id = "yellow">" $yellow[$i] . $results[$i] ."</span><br>"; } }[/CODE] Not exactly... but you can follow the logic x

Member Avatar for muralibobby2015
0
191
Member Avatar for davidjennings

Hi again, Try this instead. I have used Javascript for the redirect as PHP can sometimes moan about headers: [CODE]if (!$html) { echo 'Incomplete Data, Redirecting...'; Redirect("error.html"); } /** * JavaScript Redirect Function - Redirects the user should the result data be empty * @param string $url the dynamic url …

Member Avatar for davidjennings
0
159
Member Avatar for davidjennings

Hi there, I have been doing something similar recently to obtain data contained in an external webpage. I have used the DOMDocument technique to achieve this. Take a look: [CODE] <?php $some_link = 'www.imdb.com/webpage.html'; $tagName = 'div'; $attrName = 'id'; $attrValue = 'tn15title'; $dom = new DOMDocument; $dom->preserveWhiteSpace = false; …

Member Avatar for davidjennings
0
507
Member Avatar for ManishS

[url]http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php[/url] Perhaps you should read this tutorial or something. You need to show some more effort before we can help!

Member Avatar for jogesh_p
0
115
Member Avatar for nonshatter

Hi all, I have a fairly simple problem. I have an array which prints out the following text: [CODE]1 Full, Gen. 3 TMSWK2D 9 Poor write quality 2 Full, Gen. 1 TMSWK2C Read Only, Clean Tape[/CODE] The problem is after some of the lines of text, there are empty values, …

Member Avatar for mschroeder
0
138
Member Avatar for aMOEBa
Member Avatar for nonshatter

Hi all, I have an array called html which contains rows of text. E.g: [CODE]$html[0] = 1 Full, Gen. 3 TMSWK2D 9 Poor write quality $html[1] = 2 Full, Gen. 1 TMSWK2C Read Only, Clean Tape [/CODE] How would I go about taking each array value and splitting the row …

Member Avatar for nonshatter
0
119
Member Avatar for dandixon

"Permission denied" means that the file that you're trying to read from is protected somehow. Check the properties of that file or directory [CODE]C://xampp/htdocs/ $resource['txt']. [/CODE]

Member Avatar for nonshatter
0
154
Member Avatar for DarkDot

You have too many parenthesis after the sql query you have a ")" before the $link variable. Is that $link variable necessary?

Member Avatar for nonshatter
0
85
Member Avatar for nonshatter

Hi all, I have a query pulling out dates from a database, these dates are then added to an array and inserted into a graph along the x-axis. From the results, there could be one value with one date or there could be 10 values with one date. This means …

Member Avatar for paulrajj
0
100
Member Avatar for dandixon
Member Avatar for bsewell

Correct me if i'm wrong, but I think it might be because you're trying to print each row as an associative array when the results are returned as mysql_fetch_array. Try this: [CODE] $row=mysql_fetch_assoc($result); while($row = mysql_fetch_assoc($result)) [/CODE]

Member Avatar for bsewell
0
279
Member Avatar for mayuri_desh

This could be due to a number of things. You may want to be a bit more specific rather than saying "it shows an error when I host it". What is your host? Is the directory structure on your host the same as in WAMPP? Are all the files there? …

Member Avatar for mayuri_desh
0
105
Member Avatar for ebanbury

This is an old function I used to use. Not sure how helpful it will be, but at least it shows how to give the image a unique name using time(): [CODE] <?php define("MAX_SIZE","100"); $errors = 0; if (isset($_POST['upload'])) { $image = $_FILES['image']['name']; if ($image) { $filename = stripslashes($_FILES['image']['name']); $extension …

Member Avatar for nonshatter
0
149
Member Avatar for mpc123

In order for the recipients to be generated dynamically, you will need to do a query to fetch the recipients: [CODE]<?php $query = mysql_query("SELECT email_address FROM table WHERE date = someonesbirthdate"); // while there are result email addresses, add them to the recipients lists while ($results = mysql_fetch_assoc($query)) { // …

Member Avatar for nonshatter
0
87
Member Avatar for danny4444

Undefined index means you're referring to an array with an index value that doesn't exist or can't be recognised. Try putting single quotes around the [CODE]$_POST['$id'];[/CODE]

Member Avatar for danny4444
0
95
Member Avatar for dandixon

First you will need an action to occur when a button has been clicked. If the html element had a value of 'directors' then you could do something like this: [CODE] $staff=$_POST['directors']; if(isset($staff)) { $sql_query = mysql_query("select * from tablename where fieldname='$staff'") or die (mysql_error()); while ($result = mysql_fetch_assoc($sql_query)) { …

Member Avatar for nonshatter
0
83
Member Avatar for silvertwister10

I'd stick with Javascript for redirects. [CODE] <?php if($terms == "terms") { Redirect("http://www.romancart.com/checkavailability.asp?storeid=43296"); } // JAVASCRIPT REDIRECT FUNCTION function Redirect($url) { ?> <script type="text/javascript"> window.location = "<?php echo $url ?>" </script> <?php } ?> [/CODE]

Member Avatar for silvertwister10
0
217
Member Avatar for nonshatter

Hi all, I have a fairly simple question on something I know little about... Is there a PHP equivalent to the Perl POD? We're basically switching over from Perl to PHP but we are struggling to find a PHP-ish way of documenting from within our code. If anyone knows anything …

0
62
Member Avatar for Eworsley

Try: [CODE]<table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><img src="/_images/nav_divider_white.gif"></td> <?php while ($nav = @mysql_fetch_assoc($navigation)) { if ($nav['fieldname'] == "company") { continue; } ?> ... remaining original code, etc. ... [/CODE] ...Replacing ['fieldname'] with the name of the mysql fieldname that company is located. Also, I can't see where $mainnav and …

Member Avatar for Eworsley
0
105
Member Avatar for nonshatter

Hi all, Just installed PHP 5.2.6 on SLES11. I have editted php.ini to try and turn error reporting on, but it's not turning on (I have restarted apache2). At the moment, I'm using php in cli to debug which is getting a bit stale... Here's a section of my php.ini …

Member Avatar for nonshatter
0
210
Member Avatar for sussy123

Sussy, Good question. I'm not 100% sure on how this would work but this article may get you on the right track for how to use sockets and ping. [URL="http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=8&txtCodeId=1786"]http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=8&txtCodeId=1786[/URL]

Member Avatar for sussy123
0
110
Member Avatar for goldseiker
Member Avatar for nonshatter
0
109
Member Avatar for nyler01

I'm not sure entirely what you're trying to accomplish, but could this work? [CODE] $query = "SELECT SearchString,Count(SearchID) FROM SearchString GROUP BY SearchString"; $result = odbc_exec($conn,$query); // Print out result $i = 0; while($fetch=odbc_fetch_array($result)){ echo "There area total of ". $fetch[$i] ." Searches for ". $fetch['SearchString'] ."."; echo "<br />"; …

Member Avatar for nyler01
0
124
Member Avatar for aycmike

Hey aycmike. I know when I started learning I used a book called PHP and MySQL Web Development by luke welling and laura thomson which has lots of examples. Try and get the third/fourth edition though - you can get it second hand from Amazon for a decent price. There's …

Member Avatar for Stefano Mtangoo
0
122
Member Avatar for Acute

Acute, I adopted this one for one of my projects. It worked pretty well [URL="http://evolt.org/node/60265/"]http://evolt.org/node/60265/[/URL]

Member Avatar for Acute
0
61
Member Avatar for tito2004

You are probably missing an ending quote (") somewhere in your code. A missed end brace "}", bracket "]", or parenthesis ")" can also cause the unexpected $end in a script as well.

Member Avatar for almostbob
0
170
Member Avatar for dan_t

[CODE] <?php $username = $_POST['username']; $password = $_POST['password']; if (!$username or !$password) { echo 'make sure you entered the required fields'; exit(0); } $query = "SELECT password FROM table WHERE userId = '$username'"; $dbarray = mysql_fetch_array($query); if ($password == $dbarray['u_passwd']) { echo 'Password match'; } else { echo 'Password Fail'; …

Member Avatar for rajarajan2017
0
149
Member Avatar for nonshatter

Hey guys, Apologies if this is posted in the wrong place, but couldn't find a suitable forum. Basically I'm making a website for a musician, and was contemplating using WordPress to allow him to be able to manage his own updates, as well as update his image gallery, new videos …

Member Avatar for digital-ether
0
89
Member Avatar for nonshatter

hey guys, I'm trying to simply use the mail function. I'm using ubuntu 8.10 and have installed sendmail. My php.ini config is: [CODE]; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = /usr/sbin/sendmail -t -i[/CODE] and for testing purposes my php is: [CODE]$to = …

Member Avatar for nileshgr
0
74
Member Avatar for wesleysoccer
Member Avatar for nonshatter

If I have a table sales: sales {sellerid, buyerid} I'm trying to determine the buyers favourite seller... So I need to return the most frequent sellerid. I've used this query to find out the total number of times the buyer has bought something from any seller: [CODE]$countseller = mysql_query("SELECT count(sellerid) …

Member Avatar for nonshatter
0
96
Member Avatar for nonshatter

Hey everyone. I'm having some trouble returning the correct number of matched results after a search query is issued to my site's search bar. I was using this, but it returns the wrong number of matches (only for certain queries): [CODE] $countofrecs = mysql_query("SELECT count(*) from tablename WHERE title OR …

Member Avatar for urtrivedi
0
61

The End.