Jump to content

Arnsenal

Members
  • Posts

    34
  • Joined

  • Last visited

Posts posted by Arnsenal

  1. Im trying to use the HTMLPurifier's class's functions inside my class by extending my class from it.  :shrug:

    http://htmlpurifier.org/

     

    Here is what I get for an error.

     

     

    Warning: Passing a prototype to HTMLPurifier_Lexer::create() is deprecated, please instead use %Core.LexerImpl in C:\Users\Jerry\Desktop\Web Dev\Local Host - Web Dev\PHPTester\library\HTMLPurifier\Lexer.php on line 74

     

    Fatal error: Call to a member function get() on a non-object in C:\Users\Jerry\Desktop\Web Dev\Local Host - Web Dev\PHPTester\library\HTMLPurifier\Lexer.php on line 80

     

     

    Having a very hard time even seeking information, my knowledge of php is too limited to begin to know where to look.

     

    Do I need to provide more information?

     

    Thanks

     

    Jerry

  2. Can anyone tell me whats wrong, I think it has to do with my expression:

     

     if (!isset($value) || $value = '' || $value = NULL) {
       echo "<p class=\"unfilled-inputs\">$key</p>";
    }

     

    Here is my code:

     

    
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $company = $_POST['company'];
    $phone_number = $_POST['phone'];
    $user_name = $_POST['user_name'];
    $password = $_POST['password'];
    $re_password = $_POST['re-password'];
    $email = $_POST['email'];
    $ip = $_POST['ip'];
    $ip_range = $_POST['ip_range'];
    
    $req_post_array = array( 
    'first name' => $first_name, 
    'last name' => $last_name, 
    'user name' => $user_name, 
    'password' => $password, 
    're password' => $re_password, 
    'email' => $email, 
    'ip' => $ip);
    
    print_r ($req_post_array);   //to see what the array actually contains
    
    echo "The following fields needs to be filled out:<br />";
    
    function check_if_set($value, $key){
       if (!isset($value) || $value = '' || $value = NULL){
          echo "<p class=\"unfilled-inputs\">$key</p>";
       }
    }
    
    array_walk ($req_post_array, 'check_if_set');

     

    It outputs:


    Array ( [first name] => Jim [last name] => Beam [user name] => Jimmy [password] => Beam [re password] => => JimBeam@gmail.com [ip] => 192.168.0.1 )

    The following fields needs to be filled out:

    As we can see the function passed to the array_walk is not echoing what is should even though $req_post_array[re password] = ''; -- the if statement should be TRUE no?

     

    I noticed that if I change !isset to isset that it will echo every key in the array no matter if the values in the form are submitted or not.

     

     

    This is my HTML form if that matters....

     

                       

         <form id="create-account-form" action="../php/CreateUser.php" method="POST">
    		 	<fieldset>
    				<legend><em>Personal Information:</em></legend>
    				*First Name: <input name="first_name"type="text" maxlength="40" /><br />
    				*Last Name: <input name="last_name" type="text" maxlength="40" /><br />
    				Company: <input name="company" type="text" maxlength="40" /><br />
    				Phone #: <input name="phone" type="text" maxlength="14" /><br />
    			</fieldset><br />
    			<fieldset>
    				<legend><em>Vuln-Vult Account Information:</em></legend>
    				*User Name: <input name="user_name"type="text" maxlength="40" /><br />
    				*Password: <input name="password"type="text" maxlength="40" /><br />
    				*Re-enter Password: <input name="re-password" type="text" maxlength="40" /><br />
    				*Email: <input name="email" type="email" maxlength="40" /><br />
    			</fieldset><br />
    			<fieldset>
    				<legend><em>Scan Settings:</em></legend>
    				*I.P. Address (XXX.XXX.XXX.XXX)<input name="ip" type="text" maxlength="15" /><br />
    				I.P. Address Range (XXX.XXX.XXX.XXX-XXX.XXX.XXX.XXX)<input name="ip_range" type="text" maxlength="31" />
    			</fieldset><br />
    			<input type="submit" value="Submit" />
                          </form>

  3. Hello Masters

     

    I need to iterate through multiple $_POST[''] variables that have been submitted by a form, from the user, checking to see if they have been set or left unfilled.

     

    Having a tough time finding a tutorial online...

     

    I am a php noob... So I though that I would assign short variable names to the $_POST variables and put them into and array(with names for keys) , then use a for loop and isset() to echo any variable's key in which its value has not been set to the user.

     

    I have found out that I can not use variables as array values.... :(

     

    What is the best way to do this?

     

    Thanks to you in advance sirs.

  4. Can you post a link to page where we can look at it with firebug...?

     

    Do you have any other styles applied to the HTML Element that we see in your code?

     

    It hard to understand what exactly you want done with your description.

     

     

  5. Thank You for the Help!

     

    So I would have to create or edit Mod-rewrite in the . htaccess file for the file paths to be correct?

     

    Then I would have to copy the database and upload it to my local SQL, I guess I dont know where the database file is located. If I did find the database and exported it to my local MySQL would I have to create a user in my user table still?

     

    Thanks again for the help.

     

     

     

  6. <div style="margin-left:auto; margin-right:auto; background-color:#FF9; padding:15px; width:75%;">
    <p> <!-- Why is this p tage here?-->
    <ul id="menu">
    	<li class="active"><a href="#description">Inbox</a></li>
    	<li><a href="#usage">Sent</a></li>
    	<li><a href="#download">Compose</a></li>
    </ul>
    <div id="description" class="content">
    	<h2>Inbox</h2>
    </div>
    <div id="usage" class="content">
    	<h2>Tab Two</h2>
    </div>
    <div id="download" class="content">
    	<h2>Compose</h2>
    		<a href="http://mywebsite.com/uploader/compose.php">Compose a message here</a>.
    </div>
    	<script type="text/javascript">
    
    		$(document).ready(function () {
    			$('#menu').tabify();
    		});
    
    		// ]]>
    	</script>
    
    <hr  />
    <span style="font-size:12px;">Copyright 2011 All Rights Reserved. Contact Us. Using this service, you agree to the <a href="#">Terms and Conditions</a>. V 1.0.</span>
    </div>

     

    Try deleting that unnecessary <p> tag.

  7. Hi guys, PHP Noobie here. Sorry if I am not using the correct terminology.

     

     

    I am editing a site that was developed in php and all their page.php files are in one folder, the public_html folder.

     

    I downloaded the site locally and am using EasyPHP to view changes to the site.

     

     

    My initial problem is, when developing locally,  only some of the links work.

     

    The following link works.

     

        <a class="red" href="benefits.php">Click here</a>

     

    The following link does not work. Error 404

     

          <a class="red" href="/placement/">Click here</a>

     

    Also,  the links in the flash banner do not work...

     

    They request this url: http://127.0.0.1:8888/services.php

     

        If I type in: http://127.0.0.1:8888/MyCompany/services.php  ,  the browser will then render the page.

     

     

    Finally the scripts cant connect to the database and any user requesting information does not have access.

     

     

    Warning: mysql_query() [function.mysql-query]: Access denied for user ''@'localhost' (using password: NO) in C:\Program Files (x86)\EasyPHP-5.3.6.0\www\MyCompany\placement\index.php on line 108

     

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Program Files (x86)\EasyPHP-5.3.6.0\www\MyCompany\placement\index.php on line 108

     

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\EasyPHP-5.3.6.0\www\MyCompany\placement\index.php on line 109

     

     

    Any Ideas on this problem or and foresight on other problems I may run into... with the database maybe?

×
×
  • 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.