Jump to content

Search the Community

Showing results for tags 'parameter'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 8 results

  1. Hello everyone! I would like to need some help from someone who understands the basics of PHP. About the problem: I am supposed to make the user's input number multiple (a number between 0 and 10) with the text string the user has written. For example, the user writes "Hello" and "5", "Hello" should be printed out five times. I must use a for-loop and a while-loop to solve it.) Maybe it has to do with something called parameter. Would be thankful for some help! This is my current code: <form method="POST"> Message: <input type="text" name="message"/> Number: <input type="text" name="number"/> <input type="submit" value="OK!" name="submit" /> </form> <?php if(isset( $_POST["submit"] ) ) { $message = $_POST["message"]; $number = $_POST["number"]; ?> <?php for ($random = 0; $random < 10; $random = $random + $number) { echo "<ul><li>$message</li></ul>"; } ?> <?php } ?>
  2. Hi guys, please help me to solve my problem. i want to get the url parameter using / for now i use index.php?category_id=14 how can i change the ?category_id=14 to index.php/14 thank you so much.
  3. I didn't notice this until know. Say I have a url like this. http://www.yoursite.com?category_id=3&category_name= Grocers & Shoppers When I get the the category name using $_GET, it'll only echo 'Grocers' and not the full word 'Grocers & Shoppers'. Anyone can tell me what's happening?
  4. I have question regarding the setup of url for multiple pages. For eg. How does one have a setup like this? http://www.groupon.ca/deals/gatineau_en/Antirouille-Metropolitain/35853918 The setup I have is like this. //Page 1 with posts shown in a specific catagory. www.mysite.ca/posts_cat.php?catagoryId=1 //Page 2 with a single post shown. www.mysite.ca/posts.php?title=this is my post As you can see, my url setup is quite different than Groupon's. I am not sure if it's the correct way to do it; but it does work. The reason I have two different pages for posts are because I have two different css designs. I suppose my question is, is my method ok? And how do I make it so it looks like Groupon's way?
  5. Hi PHP Freaks! I'm one of the newer users here, yep. And this is my first post here ^.^ I have recently started working on my very simple script in PHP. Parse username/password, perform checks against array to see if username exists and if password is correct for specified user. Print out a message as a finish result. And here is what my problem is.. So far I have written this code (PHP): <?php // List of users and their password. $users = array(1 => 'admin', 2 => 'UserTwo', 3 => 'UserThree', 4 => 'UserFour'); $pass = array(1 => '1234', 2 => 'second', 3 => 'third', 4 => 'fourth'); // Compare username parameter against users list (check if user exists). if (in_array($_GET['username'], $users)) { // User is found. Compare password parameter against pass list corresponding to user ID in array. $userId = array_search($_GET['username'], $users); // Compare password parameter against pass list (using specific userId to check if password is valid). if ($_GET['password'] != $pass[userId]) { echo 'You have entered invalid password.'; } else { echo 'Welcome, '.$_GET['username'].'!'; } } else { // User is not found. echo 'You have entered invalid user name.'; } ?> I guess some of you experienced in PHP understand what I am doing up there Basically I wanted to parse username/password arguments to the URL. That works just fine ( echo $_GET['username'] . '<br>' . $_GET['password']; ) ( Just a note, I use Xampp, so it is http://localhost/login.php?username=admin&password=1234 ) Problem starts at line 9.. I am unsure about that part (I just written it out of my mind and little documentation I have found on their official website) with userId and then comparing it to correspond to the user (like like associating password to specific user id, users[0] = admin to have password 1234, users[1] , and so). Could somebody fix this and post up the code, much appreciated (excuse me for little English mistakes, it is not my native language, I do my best to keep it well) Also include a little description or just explain it in several words, what/where I messed up Thanks in advance. Regards, - OmegaExtern
  6. I have a html form in which the dropdown box is an array element now I have created a javascript function that get form as parameter . 1)I need to maniulate the values of the array present in the form in the below code sendmail is the form sname is the field array function addit(sendmail) { var x=document.sendmail.sname.length; //alert(x); while( x>0 ) { var skill=document.getElementById("sname[x]").value; //alert(skill); var anOption = document.createElement("OPTION"); anOption.innerText = skill; anOption.Value = skill; document.form.snames.options.add(anOption); x--; } }
  7. I receive the below error for my code Warning: mysql_fetch_array() expects parameter 1 to be resource Please help" <!DOCTYPE html> <html> <body> <?php $fname=$_POST['fname']; $lname=$_POST['lname']; $uname=$_POST['uname']; $pwd=$_POST['pwd']; $email=$_POST['email']; echo $fname."<br>"; echo $lname."<br>"; echo $uname."<br>"; echo $pwd."<br>"; echo $email."<br>"; mysql_connect("localhost","","") or die("Could not connect: " . mysql_error()); mysql_select_db("projecto"); $result = mysql_query("SELECT uname,firstname FROM udata"); while ($row = mysql_fetch_array($result, MYSQL_NUM)) { printf("ID: %s Name: %s", $row1[0], $row1[1]); } mysql_free_result($result); /* //$result = mysql_query("SELECT fname,password FROM udata"); if ($db_found) { $result = mysql_query("SELECT fname,password FROM udata"); while ( $db_field = mysql_fetch_assoc($result) ) { if ($db_field['uname']==$uname && $db_field['password']==$pwd) header( 'Location: www.youtube.com' ) ; print $db_field['fname'] . "<BR>"; print $db_field['lname'] . "<BR>"; print $db_field['uname'] . "<BR>"; print $db_field['password'] . "<BR>"; } } else { print "Database NOT Found "; mysql_close($db_handle); } */ mysql_close($con); ?> </body> </html>
  8. I am not able to successfully pass a JSON object as a parameter, i get an uncaught referenceError..any ideas? $.getJSON('./getMe.php', function(data){ $.each(data, function(key, pack){ var id = key.toLowerCase().replace(" ", "_"); $('#breadcrumbs').append(" <span id='" + id + " 'onclick='DoSomething(id, pack);'>" + key + "</span> "); }); $('#breadcrumbs').append('</br></br>'); }) .success(function(){ $('#loader').hide(); }); function DoSomething(id, pack){ $.each(pack, function(stage, items){ alert(stage); }); $('#packages').html('→ ' + id); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.