116 Posted Topics
Re: Hi there, you could use a regular for loop like this: [code=php] $max = ceil(count($Forms,$sharedForms); for ($i = 0; $i < $max; $i++) { $outstring1.= " $(\"#shareform".$Forms[$i]['Form']['id']."\").hide(); $(\".Share".$Forms[$i]['Form']['id']."\").click(function(){ $(\"#shareform".$Forms[$i]['Form']['id']."\").toggle(\"show\"); });"; $outstring2.= " $(\"#shareform".$sharedForms[$i]['Form']['id']."\").hide(); $(\".Share".$sharedForms[$i]['Form']['id']."\").click(function(){ $(\"#shareform".$sharedForms[$i]['Form']['id']."\").toggle(\"show\"); });"; } echo $outstring1; echo $outstring2; [/code] | |
Re: Um a little skewed. Heres the breakdown: You have a number of "SUPER GLOBALS" in php which are superglobals because they can be accessed from anywhere in the scope of your script. The 3 i'm gonna focus on here are $_POST, $_GET, and $_REQUEST because they are relevant to your … | |
Re: Hi there, Do you mean you want to append ".sql" to the table name? If thats the case I have no idea short of recreating the table with the adjusted name. But why would you want this? | |
Re: Hi there, One option you could look into is using php to resize all your images according to a client's native resolution which you would have to store in a cookie/session and get initially with javascript (or by the user following a link specific to their resolution). Be aware though … | |
Re: Take a look at [URL="http://www.pagetutor.com/trillion/index.html"]this[/URL] | |
Re: The only way you can do that is with computations, rest easy though, the computer takes care of the actual math for you: [code=php] $bytes = $_FILES['my_file']['size']; //Size of file in bytes $kbytes = $bytes / 1024; $mbytes = $kbytes / 1024; //Size in Mega bytes [/code] Nice and simple … | |
Re: Hi there, I'm not sure if what you're asking for is possible. The way I understand it to work is if you take a page (index.html) and reload it, it also reloads all of it's child elements including the iframe and the page to which the iframe is linked. A … | |
Re: By the looks of things, you aren't connecting to your database correctly, try the following: Replace your db connection initialisation with the following [code=php] mysql_connect(localhost,$username,$password) or die( "Unable to connect to database"); mysql_select_db($database) or die( "Unable to select database"); [/code] I just removed the @ from the second line since … | |
Hi there, I would have done this earlier if I new this forum existed. But I didn't, so here it is. My name is Duncan, i'm a php/javascript/mysql developer in sunny South Africa, and I joined DaniWeb in thanks to all of the various forums and posts that Google found … | |
Re: Hi there, can you post your upload.php file so that we could take a look at it? | |
Hi there peoples of DaniWeb, Does anybody know how to authenticate that a request is coming to one of my pages from a specific server and not from any random script. Many thanks, | |
Re: Hi there, The error that you are getting indicates that your query is either invalid or the result set that it returns is empty. Just double check that your SQL statement run correctly on your phpMyAdmin or other SQL command panel, and that there is data in the database. Additionally, … | |
Hi there, Does anyone know how to force Internet Explorer to refresh it's results from an AJAX call? I might be doing something wrong but here is my problem: I use Ajax to present a form containing price values of a product from a database, where they are presented in … | |
Re: Hi there, If you ever have any questions about php the first place you should look is [URL="http://www.php.net"]http://www.php.net[/URL] and then [URL="http://www.w3schools.com"]http://www.w3schools.com[/URL]. These are probably the 2 best resources available for people trying to learn php. So take a look there before posting your assignments on forums :) | |
Re: Hi there, from the past couple of posts, you guys are on the right track, it just seems that no-one remembered to close the anchor tag properly, it should be like this: [CODE] # <?php # for ($i =0; $i < $ValuenumtableChildren; $i++) # { # echo '<a href="viewingdetails.php?name='.$Valuechild[$i].'">LINK TEXT … | |
Re: Hi there, Is "product name" the name of the input box & post variable or is that the value of the variable/text in the input box? | |
Re: Hi there, What you could try is changing your link from instead of having an href attribute, make an onclick attribute and put that line of javascript from your popup.php file into the onclick's value without the script tags etc. Example: <a onclick='window.open('Contact-Sms-Centre.php','new_window1','status=1,scrollbars=0,resizable=0,menu=no,left=450,top=2 ....) '>Contact</a> I'm not sure if this … | |
Re: Indeed it is: [code=php] <? echo "<a href=\"YOUR_LINK_HERE\" >LINK_TITLE_HERE</a>"; ?> [/code] P.s: Don't forget the backslashes for the 'href' attribute, if you leave them out the php won't work. ![]() | |
Re: Hi there, You don't actually have a problem statement in your post, so I'm not really sure where you are going wrong. But, I notice that after querying the database at the top of the file, you don't do anything with the $row variable, which is why you aren't seeing … | |
Re: Hi there, This is definitely a javascript problem, not pHp. Please check my response on the Javascript forum. | |
Re: Hi there, For one, some browsers will have a problem with multiple forms with the same name, I would go with the $_GET route. Instead of outputting the data in forms like you have done, just display the results normally and where you currently have your submit button, replace it … | |
Re: I would recommend using XAMPP, however, it uses MySQL not MS SQL. Im not even sure if you can get apache and php to work with MS SQL (well, you probably can but I'll guarantee it's more effort than it is worth). XAMPP is an all-in-one wunderkind php development kit. … | |
Re: Pfft, hearts is for Kids. Minesweeper, now thats a real mans game ;P | |
Re: Hi there, If you don't want to display two pages, try using "window.location", instead of "window.open". | |
Re: Hi there tones, Just append this to your query: [code=sql] ORDER BY O.ORDER_DATE DESC LIMIT 1 [/code] | |
Re: Hi there, The logic behind the process is this: First the user fills in the registration form & submits it Then your site must process the submission & create a temporary/inactive user profile for the registrant, at the same time, your site must send a mail to the new registrant … | |
Re: Hi there, Where exactly is the problem? Whats happening thats not supposed to or vice versa? | |
Re: You need to retrieve your results from your $stat3 variable just like you are doing, except in the square brackets the word (key) must be enclosed in quote marks, eg: $stat3[[COLOR="Red"]'[/COLOR]sex[COLOR="Red"]'[/COLOR]] | |
Re: Hi there, I assume your code snippet is from the fruit.php file, if thats the case then it is quite simple to do what (I think) you need, in fact you have already given it yourself: basename($_SERVER['REQUEST_URI']) will give the url sent to the server minus all of the folder … | |
Re: The only error i can see in your posted code is that you don't echo the variable $id_event for the value of it's hidden field, you just put the name there as html, but i don't think that would stop your page from being properly interpreted. Could you put the … | |
Re: Are you certain that your session is always started when you try to destroy it? | |
Re: Hi there, Once the xpath function has run, you can treat the $topost variable as an array. So I'd recommend taking a look at the output of print_r($topost) and then make note of the ids of the elements that you want and extract them like that. That is if your … | |
Re: Hi there, In an associative array the symbol '=>' indicates a key-value pair, ie: 'key' => 'value', this means that you can access an element of the array with it's named key like: $array['key'] will return the value of 'value' | |
Re: Hi there, What exactly were you doing when it happened? It sounds more like apache failed than your code though, unless you are actually manipulating threads manually. | |
Re: I'm not sure what you need: the HTML form, the SQL statement or the PHP to run it? or do you just want to pass? | |
Re: Hi there, I would use the if/else approach originally suggested without adding the full mark for an uninitialised POST variable. Additionally keep track of how much each of the tests is supposed to count (eg If you would multiply a mark by 0.05 to form part of the final mark, … | |
Re: Hi there, Myself and a buddy at work were dumbfounded by a similar situation not too long ago. Our current working theory is that the GD library's imagecreate****** methods first turn any image into a bitmap, could be wrong but it explains all the extra memory usage. Anycase, your best … | |
If you haven't heard the rumors (press releases), Google plans to release it's own OS by the end of 2010, according to the news it's going to be aimed at smaller devices (laptops/pdas etc.) and is going to be focussed on web-based functionality including the ability for people to write … | |
Re: Hi there, Unfortunately the answer is simpler than it seems: you are either using the incorrect password or username or both. I think the problem is your password, default for mysql is "" (nothing). | |
Re: Hi there, not really sure what you are trying to do, your diagram isn't very informative. Please post some more specific info, thanks | |
Re: Hi there, I think i've spotted your problem. [QUOTE=whiteyoh;912697] [code=php] <? // Select all data records in table "name_list" and put them into $result. $result=mysql_query("SELECT * from `indexinfo` WHERE id = '1'"); //store the queried cell in the variable //named $result $result = mysql_query($sql_query); [/code][/QUOTE] After you run the initial … | |
Re: Hi there, When I've had to keep an arbitrarily long set of parameters in a database in the past, I usually implode the array into a string, seperating the values with tildes and then store that string in a column of type text. I think that's what you're talking about … | |
Re: Hi there, I've just taken a brief scan through the code and nothing major stands out. What problems arise when you try to run the code? | |
Re: Hi there If you just want to keep track of how long a guy was on a page simply use the following, at the top of your php page: [code=php] $time = time(); $_SESSION['time_started'] = $time; [/code] Which stores the time (as a UNIX timestamp) that the page was loaded … | |
Whats the general opinion here: Are all programmers stoners? (If my colloquialism is lost across borders i'm talking about marijuana) Some two-bit sales person came and chirped me the other day that sales will always be the more powerful branch of the industry because they're the deal makers, they're more … | |
Re: Software to run php: XAMPP (if you are on a Windows based pc) Sofware to write php: Netbeans PHP is free (as far as I can tell) but phpEd from nuSphere is way awesomer if you're willing to buy a license. Best Place to Learn PHP: The basics at [URL="http://www.w3schools.com"]http://www.w3schools.com[/URL] … | |
Re: Smiling is over-rated. [i]Especially[/i] if you are staring at a computer screen, what are you trying to do? Re-assure it? I got into programming so that I wouldn't have to deal with people and by extension of that be nice to them for no reason | |
Re: Hi there, Give this a bash, be warned though I haven't tested it yet put if you post up your text file I'd be more than happy to: [code=php] $assoc_array = array('a'=>array(),'b'=>array(),'c'=>array(),'d'=>array(),'e'=>array(),'f'=>array(), 'g'=>array(),'h'=>array(),'i'=>array(),'j'=>array(),'k'=>array(),'l'=>array(), 'm'=>array(),'n'=>array(),'o'=>array(),'p'=>array(),'q'=>array(),'r'=>array(), 's'=>array(),'t'=>array(),'u'=>array(),'v'=>array(),'w'=>array(),'x'=>array(), 'y'=>array(),'z'=>array()); $filearr = file('myfile.txt'); foreach ($filearr as $line) { $thisLine = split(" ",$line); foreach ($thisLine … | |
Re: Hi there, You're gonna have to give us a little more info than that, such as what your OS is, what phone you have what are you gonna connect your pc to your phone with, what you are going to connect your phone to the internet with etc. | |
Re: Hi there, The problem that you are most likely facing is that the result set your database is returning is null. Please checkout [URL="http://www.daniweb.com/forums/thread201892.html"]http://www.daniweb.com/forums/thread201892.html[/URL], it should set you straight. |
The End.