wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Use the style attribute instead: [code]style="background-image: url(image.gif);"[/code] the background attribute doesnt exist AFAIK.
-
In that case. Name each selectbox like this: part[] including the [] brackets. So you select box tag is like this: [code]<select name="part[]"> // options here </select>[/code] then use a foreach loop like so: [code]$partNumb = ''; foreach($_POST['part] as $part_k => $part_v) { $partNumb .= $part_v; } echo "Your partNumber is: {$partNumb}";[/code] That will then loop through each part selectbox and generate the 6 character part number.
-
You'll want to give aname to the selectbox tag for your listboxes. then when you submit your form you use $_POSt['select_box_name'] Changing select_box_name to the name of your select box. If its a multi listbox you'll want to add [] at the name of your select box name.
-
Yess sessions does have time limit until the session timesout, however redirecting the user when the session expires isnt possble I dont think, that is what I meant.
-
Help with require() statement using URL_fopen_wrappers.
wildteen88 replied to r3gan's topic in PHP Coding Help
Require doesnt execute the code on the remote machine, instead it basically copy 'n' paste's the contents of the file being included/required into the script that is getting the file. -
You code not working as you are not referencing this line: [code]mysql_query($Double_sql);[/code] You'll want to do this: [code]$sql_doublecheck = mysql_query($Double_sql);[/code]
-
[quote author=hackerkts link=topic=102443.msg406489#msg406489 date=1154356631] If you want to have a expire time, then I would suggest you to use cookie. [/quote] Sessions does use a cookie! Also marshall I dont think what you are trying to do is possible.
-
So you just want just line 19 to be displayed in the html file and not all the other lines correct? In that case could you provide the code that generates that html code. With no code to work with we cannot suggest anythink.
-
How is line 19 created? Javascript, PHP or someother language? You need to give us more infomation.
-
Only way to understand why your query is failing is to add an or die clause to the end of the function mysql_query, so change this: [code]$query = mysql_query($recieve); //do the query[/code] to this: [code]$query = mysql_query($recieve) or die("Unable to peform query - " . mysql_error()); //do the query[/code] When you run your code again it should now return an error from MySQL which should help you understand why your query is failing. From looking at your query I believe its do with the name of your password field - password. MySQL has reserved word/function called password. So what I recommend you to do is to add backticks (`) around the word password within you SQL Query. So your query should now be this: [code]$recieve = "SELECT * FROM users WHERE membername='".mysql_real_escape_string($username)."' AND `password`='".mysql_real_escape_string($password)."'";[/code]
-
Wheres the $users variable comming from? Also this error: [i]Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/***/public_html/test.php on line 23[/i] Is to do with your SQL query.
-
SA wasnt slacking, but I was. I should of taken action of changing the words earlier.
-
calling functions using parameter names
wildteen88 replied to mattgleeson's topic in PHP Coding Help
No I dont think this is possible. However when creating your own functions, you should first start of by listing the parameters for that function and then order those parameters in order of priority. You shouldn't create a function which has sometihng like 10+ parameters, otherwsie the order of prority becomes harder to work out, the max paramters I'd say a function should have is 5. -
upgrading from version 4.x to 5.x on Linux
wildteen88 replied to drorgo's topic in PHP Installation and Configuration
I think you can just replace the existing .so files then you'll have to recompile PHP in order to be upgraded. -
Welcome Colleen to phpfreaks.com! I'm sure you'll enjoy your stay here :). I'll see you around.
-
SOmething like this: [code]<?php if(isset($_POST['genCode'])) { // echo '<pre>' . print_r($_POST['tool'], true) . '</pre><br /><br />'; echo '<h1>Generating HTML...</h1>'; $html = <<<HTML <table width="90%" border="1" cellpadding="7"> <tr bgcolor="#66ccff"> <td><big>"Problem/Error":</big> {$_POST['problem']}</td> </tr> <tr bgcolor="#ccffff"> <td><big>"Cause":</big> {$_POST['cause']}</td> </tr> <tr> <td><big>"Solution":</big> {$_POST['solution']}</td> </tr> <tr bgcolor="#dddeee"> <td><big>"Tools":</big> <table width="100%" border="1" cellpadding="7"> HTML; $i = 0; foreach($_POST['tool']['name'] as $tools => $tool) { $html .= <<<HTML <tr bgcolor="#dddeee"> <td width="40%">"{$tool}"</td> <td>{$_POST['tool']['desc'][$i]}</td> </tr> HTML; $i++; } $html .= <<<HTML </table> </td> </tr> </table> HTML; echo '<textarea cols="100" rows="20">' . $html . '</textarea>'; } else { ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <table cellpadding="7" cellspacing="0" border="1" width="90%"> <tr> <td><big>"Problem/Error":</big> <input name="problem" type="text" /></td> </tr> <tr> <td><big>"Cause":</big> <input name="cause" type="text" /></td> </tr> <tr> <td><big>"Solution":</big> <input name="solution" type="text" /></td> </tr> <tr> <td colspan="2"> <big>"Tools":</big> <table align="center" width="98%" cellpadding="7" cellspacing="0" border="1" style="margin: 1%;"> <tr> <td>"Tool Name"</td> <td>"Tool Description"</td> </tr> <?php for($i=0; $i < 5; $i++) { ?> <tr> <td width="40%"><input name="tool[name][]" type="text" size="50" /></td> <td><input name="tool[desc][]" type="text" size="80" /></td> </tr> <?php } ?> </table> </td> </tr> <tr><td colspan="2"><input type="submit" name="genCode" value="Generate HTML" /></td></tr> </table> </form> <?php } ?>[/code]
-
Nothing is wrong with dreamweaver. Also WAMP/PHP designer wouldnt of affected anything. Also you need WAMP in order to run your PHP files. The reason why Dreweaver popped up with those messages was because .php files cannot be run in a browser, as the browser doesnt understand the PHP code within them. So it asked you setup a testing sever in order to run these files. The videos over at phpvideotutorials.com showed you how to setup PHP Designer to run your PHP. Dreamweaver isnt the best app to use when creating PHP scripts. If you start up Dreamweaver again it shouldn't promt to setup a testing server with .html files.However if it is. You Project setting may have been changed. To chekc you project settings open up Dreamweaver and go to Site > Manage Sites Now select the project and select Edit. Make sure the first screen is setup correctly. If it is click next. Make sure No, I dont want to use a server technology option is selected. Click Next again, and click Next again. Makie sure None is selected for How do you connect to your remove server. After taht Click Next again. Click Done. That shoudl now reset your project settings back to what is was before. NOTE: Dont run php files through Dreamweaver, unless youn ahve setup Dreamweaver to use a remote server or a local testing server (WAMP). You'll want to install WAMP in order for your PHP files to run. Web Browsers dont understand PHP code.
-
Web browsers, such as IE, FF, Opera etc, cannot parse php code. So theres no point in running php files through a web browser. What you'll want to do is install a server onto you PC. Such as Apache, or if you are on XP Pro/Windows Server OS you'll be able to use IIS. However Apache is better. PHP runs on the server and not the client, which HTML does that why you can run HTML files through a web browser. Once you've installed a server and configured it to parse any PHP files with the PHP Interpretor you can go to http://localhost/filename.php and your PHP scripts will now run.
-
Either set a cookie or a session which will hold the location they was before being redirected to the login page. Then when they successfully login you check whether the redirect cookie/session is set. If it is you redirect them, if its not you redirect them to your homepage.
-
adding error_reporting(E_ALL); may not work if you have the display_errors directive is turned off.
-
Is there any whitespace before the opening <?php tag in login.php. Also is there any whitespace before <?php and after ?> in config.php As you have some form of output which causeing this error. Also how are you saving your PHP files? Make sure you saving them with ANSI encoding, if you are saving them with other type of enconding such as UTF-8 it causes this problem.
-
Use the full PHP opening tag (<?php): [code=php:0]<?php phpinfo(); ?>[/code]
-
Make sure you have installed phpBB correctly, and that the configuration settings you provided whilst installing phpBB where correct. You can check these settingd by finding a file called config.php which stores all your phpBB database configuration settings. If not then goto http://www.phpBB.com for help. I;m sure the support team there will be able to advise on what to do.
-
When you get an supplied argument is not a valid MySQL result resource style error message, it usually means there is a problem with your SQL query. Could youy post the SQL query you are using here.