wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
No. That is not code but configuration settings. You can change these settings to set restrictions etc. However the default settings are fine. Also could you post the full error message(s) you are getting here please.
-
You can use varchar. Varchar can have a default value. However varchar can only store 255 characters maximum. Text can store about 65,000 characters or more.
-
You cannot call PHP functions from HTML. PHP oly runs when ever you go to the page. PHP is not like javascript where you can call javascript from HTML. What you'll want to do is look into AJAX where you can use HTML/Javascript to call a PHP function when on the web page.
-
HELP! How to redirect visitor after form submission?
wildteen88 replied to youngsuccess's topic in PHP Coding Help
Do you get any errors or a blank screen? -
Sure you can. All you need is the HTML code: [code]while($row = mysql_fetch_assoc($SQLRessult)) { echo '<a href="somepage.php?page=' . $row['nameCol']">' . $row['nameCol'] . '</a><br />'; }[/code] That it. All you need to do is change that to your needs. If you are unsure post the current code you go here and I'll adapt it for you.
-
its not PHP whos dumb. Its to do with how the http protocol works. Read up on http headers to see how they work.
-
You have output on line2 in session_test2.php Is <?php on line 1 in session_test2.php and there is nothing before <?php Is there anything before <?php or if its not on line 1 then that is why.
-
[SOLVED] Can I make foreach function run multiple parameters?
wildteen88 replied to Chappers's topic in PHP Coding Help
You can still do that but the parameter for the foreach loop is wrong: $array1 as $name => $age => $location The parameter for the foreach loop can only be either of the following: foreach($array as $value) or foreach($array as $key => $value) The first will be ideal if the array didnt have any keys assigned, whereas the latter one would. What you are best of doing is something like this for the array format: array('name' => array(age, 'location')) so it'll be like this: [code]$myvar = array('andrew' => array(18, 'USA'));[/code] You will need to design how the array will be, then when you've done that you can the set about doing the foreach. So if you go for the newer array you'll do this: [code]// the people array $people['andrew'] = array(18, 'USA'); $people['dave'] = array(27, 'DEN'); $people['charlie'] = array(17, 'GBR'); foreach($people as $name => $details) { echo $name . ' is from ' . $details[1] . ' and is aged ' . $details[0] . "<br />\n"; }[/code] -
Not seeing all the code
wildteen88 replied to calimon's topic in Editor Help (PhpStorm, VS Code, etc)
You can access it [url=http://psdesignsjewelry.com/admin/]here[/url]. I dont know what the control will be like but navigate through until you find what you are looking for. There should be a heading called categories or something. If you are unsure PM me screenshots of the admin control panel and I'll have a look. -
Not seeing all the code
wildteen88 replied to calimon's topic in Editor Help (PhpStorm, VS Code, etc)
Cancel the though of phpMyAdmin Did you try going through the websites control panel to make the changes? Ask the person you are doing this for, for the username and password for the admin control panel to do this. -
HELP! How to redirect visitor after form submission?
wildteen88 replied to youngsuccess's topic in PHP Coding Help
Change where it says: [code=php:0]print_r("Customer information was successfully added"); [/code] this: [code=php:0]header("Location: pagename.php")[/code] Change pagename.php to the page you want to the user to be redirected too. Note before using this function make sure there is nothing being outputted to the browser before you use the function. -
[SOLVED] Can I make foreach function run multiple parameters?
wildteen88 replied to Chappers's topic in PHP Coding Help
is array two the ages? of the names in array1? You may aswel the join the two instead. so its like this: $array('name' => 'age', 'name' => age) That way it will be easier loop through in a foreach loop. rather than handling two different arrays. Like so: [code=php:0] $array1 = array('andrew', 'dave', 'charlie', 'peter', 'susan', 'greg'); $array2 = array('18', '27', '17', '43', '32', '21'); // use this for our internal counter in the loo] $i = 0; foreach($array1 as $name) { // people is the array we are going to create // here we are going array1 with array2 // array1 is going to be the key eg myarray['keyname'] // array2 is going to be the value // first item will be $people['andrew'] = 18; $people[$name] = $array2[$i]; $i++; } echo '<pre>' . print_r($people, true) . '</pre>';[/code] -
Not seeing all the code
wildteen88 replied to calimon's topic in Editor Help (PhpStorm, VS Code, etc)
Ok those are coming from a database (mysql). You are best of editing the database itself rather than the script. You can do this using phpMyAdmin or via the the websites control panel if it has one. You can edit these in the table called [b]febpsd_products_category[/b] which is in the database being used for the site. You can check which database is being used in connections/conn.php I have confirmed the website has a contorl panel [url=http://psdesignsjewelry.com/admin/]here[/url]. You should be able to do it through there. -
[SOLVED] Can I make foreach function run multiple parameters?
wildteen88 replied to Chappers's topic in PHP Coding Help
For each can only loop through one array/array level at a time. It can not loop through multiple arrays/levels. Post what your arrays look like here. -
Not seeing all the code
wildteen88 replied to calimon's topic in Editor Help (PhpStorm, VS Code, etc)
Oh bugger! Looks like I miss understood you. I though you could only see <? /* LEFT PANEL */ echo "<div style=\"padding:4px;\"> <br / >Categories<br / ><br / >"; and thats it and nothing else judging by your post. I didnt think you mean the HTML code. Ok. Now to explain. PHP is creating that code. PHP is a server-side programming languages it allows you to create dynamic websites. So you can't go in and edit like you can with HTML. Now what needs to be changed. You have to modify the PHP code in order to change the output. If you tell us what needs changing we'll be able to help. -
That will have be doing in javascript which counts down.
-
Not seeing all the code
wildteen88 replied to calimon's topic in Editor Help (PhpStorm, VS Code, etc)
There is both PHP and HTML code. Look at the attached file he/she attached a few posts above ([url=http://www.phpfreaks.com/forums/index.php?action=dlattach;topic=120596.0;attach=882]product.php[/url]). He/She said got it from FTP when they open it in Dreamweaver can only see the following in the entire file: [code=php:0]<? /* LEFT PANEL */ echo "<div style=\"padding:4px;\"> <br / >Categories<br / ><br / >";[/code] -
[SOLVED] Whats ON UPDATE CURRENT_TIMESTAMP CURRENT_TIMESTAMP?
wildteen88 replied to ted_chou12's topic in PHP Coding Help
The column type should be timestamp yes. Then when you update the table you use the CURRENT_TIMESTAMP constant or you can just use PHPs time function which will place a unix timstamp (number of secounds passed since 1 Jan 1970). Then you convert the timestamp into a formatted date by passing the timestamp to the date function as the second parameter. -
Why don't you include your validation class in add.php instead?
-
Here you are doing it wrong: $output = shell_exec('$funky'); Variables are treated as text if they are in single quotes. Remove the quotes. Also echo out the funky variable to see what is being passed to the shell_exec function.
-
reg form is inserting blank info in database
wildteen88 replied to Rother2005's topic in PHP Coding Help
thorpe just said you cant do this: [code]if ($username=$_POST['username'] == "") {[/code] Use the isset function then check the value of the variable like so: [code=php:0]if(isset($_POST['username']) && !empty($_POST['username'])) { // valid } else { // not valid }[/code] Also when validating form data do not kill the script for every check. Log the errors in an array then check if there any errors after you;ve validated all the fields. If there are errors log display them along with the form. If there are no errors then continue on. -
Not seeing all the code
wildteen88 replied to calimon's topic in Editor Help (PhpStorm, VS Code, etc)
[quote author=PFMaBiSmAd link=topic=120596.msg495336#msg495336 date=1167752502] I reviewed the posts, and I believe that calimon does see all the lines of PHP code [quote]I open the file in Dreamweaver (this is only a piece of the entire file):[/quote] and what is missing here is a little PHP 101 - PHP is a programming language that outputs content (hopefully valid HTML content) to a browser. When a PHP page is fetched by a browser, the PHP code is parsed and any output from echo/print/print_r... statements and any content that is not enclosed within <?php ... ?> tags is sent to the browser. It is this resultant output that the browser renders and that you see when you view the source of the page in the browser. [/quote] But he/she (pardon me) is getting the file via FTP, not via HTTP (browser). I already asked/explained this this a few posts back. -
[SOLVED] How to add a ';' charater to an array??
wildteen88 replied to gabrielkolbe's topic in PHP Coding Help
implode the array: [code]while ($row = mysql_fetch_object($result)) { array_push ($mail, $row->email); } // implodes the mail array to something like this: // [email protected];[email protected];[email protected] etc $addys = implode(';', $mail);[/code] Umm, thorpe beat me :) -
Not seeing all the code
wildteen88 replied to calimon's topic in Editor Help (PhpStorm, VS Code, etc)
Interesting I can see all the code, however I'm on a PC (WinXP). I get 230+ lines of code when I view the file in my PHP IDE (RapidPHP 2006). DW8 also displays fine too. I am not experienced with Mac's so I'm not sure what to suggest sorry. -
[quote author=Renlok link=topic=120681.msg495290#msg495290 date=1167749577] oh yeah lol im an idiot, thanks for that ^^ [/quote] You're not the only one! We all missed it!