Jump to content

hazz995

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Posts posted by hazz995

  1. I'm just messing around with a website layout. I'm more of a developer than a designer but I want to boost my creative abilities so that I can actually create a decent looking website for those that are interested. More than a few times I've been assigned to create a website from scratch rather than playing around with server side code like I prefer. So here's to bolster my skills.

     

    I haven't put it online yet, it's just sitting on my local XAMPP server, so here's an image (for now):

    website.png

     

    Any ideas are welcome, any at all.

  2. If a client wants paypal integration then there are more than just buy now buttons that you can offer. In fact this is probably the worst kind of integration that you can offer for most dynamic websites as you usually will want to update your own database when a payment is made or rejected or whatever.

     

    For a simple buy now button all you need is to ask the client to generate the HTML themsleves and email it to you if they do not want to give you access to their account. You can talk them through it. It takes all of 2 minutes.

     

    For a proper solution, you do not need any customer details. Use the Paypal sandbox to test your implementation of Direct Pay, Express Checkout, or IPN integrations. As a developer you should have a Paypal sandbox account setup. If not, get one setup. Once you have the integration sorted you just need your client to give you the API username / password / key (not the same as the login details to Paypal) details for their account and add it to your code instead of the test details.

     

    For a proper integration customers should have a Paypal business account. If it is a small little home project HTML website selling cookies & cupcakes then a business account is not needed and a simple buy now button would suffice.

     

    You should not be setting up Paypal accounts for clients. It is their responsibility to read the documentation and familiarise themselves with Paypal if they are going to be using it for transactions from their business. You wouldn't have your friend open a bank account for you, would you? You can offer help on how to go about setting up the type of account they need, but never do it for them.

     

    Thank you, I was actually just looking into the PayPal sandbox feature the other day an I'm glad you brought it up since I'm now confident I can continue looking into it.

    Your overall post has been really helpful and I now have a better understanding on how to deal with PayPal with my clients.

     

    Thanks again :).

  3. Okay so a client wants PayPal integrated into their website, such as a buy button etc..etc...

    Easily done.

     

    But what's stumping me is how do you handle the PayPal details? Because as far as I know you access to the business PayPal account you're setting up products form. So the client will have to give me access to their PayPal so that I can add buttons etc to their site?

    What happens if they don't have a business PayPal account, do I just set one up in their stead?

     

    I know there's a few questions but I just started looking into PayPal for my clients and I find it hard accepting the fact that I have access to someone else's PayPal just to add buttons and stuff.

     

    Is this really necessary or are there other ways of doing it? Either way I would like to hear how other people deal with PayPal and their clients.

  4. Alright just started learning JS and I'm having a few problems.

    I'm trying to make some form validation code with the help of a timer but the page keeps going blank every time it runs (with the exception of the text that is told to be outputted).

     

    <script type="text/javascript">
    	var usererror = ""; //NULL STRING
    	var passerror = ""; //NULL STRING
    
    	function CheckUsername()
    	{	
    		usererror = "Test";
    	}
    	function UpdateError()
    	{
    		document.write(usererror);
    		t=setTimeout("UpdateError()",1000);
    	}
    </script>
    
    </head>
    <body>
    
    <div class = "template">
    <form action = "" method = "post" name = "formlogin">
    	<table>
    		<tr>
    			<td width = '30%'>Username</td>
    			<td width = '40%'><input type = "textfield" name = "username" onchange = "CheckUsername()"/></td>
    			<td width = '30%' style = "color:red;">
    				<script type="text/javascript">
    					UpdateError();
    				</script>				
    			</td>
    		</tr>
    	</table>
    </form>
    </div>
    

     

    Basically what I'm trying to tell it to do is to output the correct text when an error is made within the username textfield but it's obviously not working and I have no more ideas on how to fix it.

    Sure the code is not complete and doesn't show the exact errors yet but I'll get to that once I get it to output text correctly...

     

    Thanks ;)

  5. Hey as the title says I am a novice, basically i know the basics of PHP/Database Connectivity and just added Classes to the list.

    However I've never actually done a project with anyone before, I know I can work solo but I want to get some experience working with other people an hopefully it will help me improve as a PHP programmer.

     

    I'm looking for a team/person that has some experience with working in teams (and in PHP) so I have someone I can learn off. Its not really mandatory, after all my main objective is to experience what it is like to program along side another developer so pretty much anyone will fit the requirement.

    All I ask is that I'm not left doing all the programming or being the only programmer.

     

    Thanks for reading ;).

    If anyone is interested then throw me a PM, or email me at hazzy995@hotmail.com

  6. rewind($fh);

    fwrite($fh, "$new_contents");

    I've got it to write at the start of the file thanks to rewind but still one problem, if I open the file with r+ it overwrites existing data as it goes along instead of just nicely writing text at the start of the file without deleting anything.

     

    Start:

    existing text

     

    Run code: (inserting the text "hello" at the start)

    helloing text

     

    What I'm trying to achieve:

    helloexisting text

     

    I tried changing the r+ to w but that just wipes everything when writing.

    $string = "test text";
    $fp = fopen("test.php", 'r+');
    rewind($fp);
    fwrite($fp, $string);
    fclose($fp);
    

  7. I tried writing to a file, all existing code gets deleted.

    I tried appending but that only adds to the end of the file.

    How can I add to the start of the file without deleting the existing contents?

    Thanks.

  8. Alright I'm stuck on this one :/

    My poor attempt at trying to +15 mins onto the users last active time, basically how I'm trying to get it to work: if users last active time + 15 mins is higher than current time then they are logged on, else logged off. I tried a few other methods but nothing worked, the lastactive time is in the same format as $date also. (Y-m-d h/i/s)

    $date = date("Y-m-d h/i/s");
    if ($user['lastactive']+15 <=$date)
    

  9. Add a database field to the users table called, "Last Activity" if this value is less than 15 minutes show them as being online / logged in. If not show them as being logged out.

    I have a Last Login field which is a TIMESTAMP, so I'll just have to copy that field to Last Activity.

    I'll have to do some lookup on comparing time since I have no idea how.

  10. I want to display a field that says if a user is logged on or not, also depending on how long the user is inactive for then they will be identified as "logged out" (if the user comes back they are still logged in with the saved session though)

    Basically if the user has been inactive for 15 Min's then they are identified to other people as 'not online'.

    I'm not quite sure where to start with this so I just need a little nudge to get me started.

     

    Just the way to do it would be good enough, try to limit the amount of code because I want to try doing it myself, not saying I wouldn't mind some code to start me off though ;)

  11. your conditions are incorrectly written:

     

    if ($sort=0)

     

    you're evaluating whether $sort=0 is true. it always will be, since you're just checking whether $sort can be successfully assigned a value of 0. if you want to COMPARE the values, you need to use two equal signs. read up in the PHP manual on operators.

     

    *facepalm* It completely slipped my mind...

     

    Thanks :)

  12. Trying to sort a table out by certain tags, like username, date registered and member type...

    No matter how many times I click the links the data wont sort, I had it working with only sorting 2 table columns but it broke when I attempted to add a 3rd.

     

    This is the code that starts the sort of, it works by extracting the sort variable from the url then using it to decide what column is being sorted, unfortunately it does not work. :(

    <?php
    
    $sort = $_GET['sort'];
    $connect=mysql_connect("localhost","root","root") or die("Could not connect");
    mysql_select_db("dbmembers") or die("Could not find database");
    	if ($sort=0) 
    		{$query = "SELECT * FROM users ORDER BY date";}
    	if ($sort=1) 
    		{$query = "SELECT * FROM users ORDER BY username";}
    	if ($sort=2) 
    		{$query = "SELECT * FROM users ORDER BY admin";}
    
       echo "<center><table width=100% style=padding:5;><tr><td><b><a href='?sort=0'>Username</a></b></td><td><b><a href='?sort=1'>Date Registered</a></b></td>
       <td><b><a href='?sort=2'>Type</a></b></td>";
       
    //Rest of table code... 
    
       ?>
    

     

    Thanks.

  13. I'm having trouble creating a loop that will echo all members in the database.

    I'm trying to get every member in the database to come out like this:

     

    Name1 | Date Registered

    Name2 | Date Registered

    and so on...

     

    <?php
    $user="root";
    echo "Currently ";
    $connect=mysql_connect("localhost","dbuser","dbpass") or die("Could not connect");
    mysql_select_db("dbmembers") or die("Could not find database");
    
    $query = "SELECT * FROM users ORDER BY name DESC LIMIT 20";
    $res = mysql_query($query) or die("Couldn't execute query: ".mysql_error());
    $numrows = mysql_num_rows($query);
    
    echo "$numrows registered users."
    
     while ($user = mysql_fetch_assoc($res))
    {
      echo "
    	  ".$user["username"]." 
    	   ".$user["date"]."<br> 
    	   
    	   ";
    }
    ?>
    

  14. You can't exactly do that in PHP. You can in JavaScript, but if that's not what you're looking for you can use the $_GET superglobal with similar functionality. Example:

     

    <?php
    $var = isset($_GET['var']) ? $_GET['var'] : 'Not set';
    echo '$var is: ' . $var;
    ?>
    <a href="?var=somethingelse">Click!</a>

     

    Thanks a lot, I got the result I wanted.

  15. Alright thanks that part works now.

    Although now I am having trouble with a query:

    $query = "INSERT INTO hi VALUES('".$_GET["name"].",".$_GET["score"].",".$_GET["user_comment"]."')";
    

    I get this error: Couldn't execute INSERT INTO hi VALUES('test name,15,test comment'): Column count doesn't match value count at row 1

    I know for a matter of fact that they are all and the only Column's in the database since I have tested it using another simpler query which worked past this point.

  16. Is this the right place for this? (Sorry I'm new here)

     

    Anyways, I'm having trouble with:

    $query = "SELECT name, comment FROM hcdb";
    

    Is it possible to add another field 'score' to that so that it returns comment from hcdb and score from hcdb?

     

    Rest of the code for this part:

    $res = mysql_query($query)
    while ($user = mysql_fetch_assoc($res))
    {
    does loop stuff like showing a table with name, scores and comment.
    }
    

     

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