Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. .josh

    API Help

    API's are arbitrarily coded scripts. There's no universally defined syntax for how to send data to an API or receive data from it. So, the only way we can do more than make random guesses is by being able to see the API's documentation. Having said that.. based on what you've shown... the error says "invalid process name". I would start with making sure you are sending a valid process name in your request. It seems from your code you are setting it in $soapFunctionParameters. It seems you are using a value of "CompanyInsert". Are you sure that's the right value? Are you sure that's how you're actually supposed to supply the value, in an array structured like that, etc..?
  2. is session_start(); being called before all other output, including any whitespace that might be at the top of the file?
  3. Not enough code/info to go off of. It may be because of error level settings vs. what you're outputting and when. In general, you can't output headers before any other output, and for a Location header specifically, it should immediately be followed by exit(); if you don't want the rest of the code to execute.
  4. assuming your form names match the $_POST elements in your script, there's nothing "wrong" with your script (tested it on my own server). However, unless your "From: ... " name/email matches the email server, most email services (e.g. gmail) will likely put it in your spam/junk box or outright deny the email altogether (spam prevention measures).It's also possible your email server is mis-configured.
  5. I don't know how you can possibly take offense to my post. I think you're blowing my response way out of proportion, taking offense to something that isn't there. But, to each his own. Good luck with your issue.
  6. Looking at your code, I can confirm what mac_gyver said: you need to restructure your code to have header() be called before any output. Also, you will need to add exit(); immediately after the redirect, so that php will stop parsing/outputting the rest of the script. couple of sidenotes: - mysql_xxx functions are deprecated. You should at a minimum update your mysql functions to use the mysqli syntax. It has both object oriented and procedural syntax. The procedural syntax is very similar to the mysql procedural syntax you already used, so updating it is relatively painless. Better yet, look into using prepared statements, like with the PDO class. - I see a comment in your code to sanitize the user input but you aren't actually doing that. If you do not validate/sanitize the user input, you are begging for your site to be hacked. Switching to prepared statements will take care of this, but at a minimum you should be validating that the data is expected format/values.
  7. well if some of the emails have gone through, then it's probably not an issue with the email server. Probably an issue with your code. Yes, you will need to post code and provide details. I don't know how you think we can help without any details.
  8. .. unless you are asking for clarification about the job. Up until now, we have always made it to where people could not reply. We decided to give it a try because people have constantly asked that we allow it, so that they could respond with clarifications, and we're willing to see how that goes. But if all we see are people spamming their calling cards in the threads, we're going to issue a beat down and revert to no replying. Do not make us regret this decision. Do NOT post your 'resume' or willingness to work etc.. in the job thread. You must reply directly to the OP via email etc. IF YOU DO NOT FOLLOW THIS RULE, BAD THINGS WILL HAPPEN: You may get warned. You may get muted (mods must approve your posts before they are visible). You may be banned without warning. Ability to respond to the threads at all may be removed (for everybody). Action is at the sole discretion of moderators and admin. Any one or more of these may happen, even on your first offense. Update 2014.03.31 Welp, that didn't take long. I knew it would happen and sure enough, it did. This rule continues to be broken, even by people that we give warnings to instead of outright ban. So as of this date, you can no longer reply to threads in this forum (again). I apologize to the people who actually respected this rule, and I apologize to the OPs who can no longer even reply in their own threads to update info (there isn't an option to allow OP but not others), but you can thank the people who refuse to follow rules who instead think they will get somewhere by spamming their stupid calling cards on everybody's threads. I hate to be the guy that says "I told you so" but there you have it.
  9. We have made some updates to the Freelance forum. Previously it was just a forum in the Miscellaneous category, and there was no categorization of any kind. We have now broken it out into its own category, and have created separate forums for people looking to offer their services vs. offer work. In addition to this, we have relaxed posting restrictions: we will now allow for people to reply to threads in those forums. This will make it easier for people to post updates in their own threads, as well as offer feedback/review of others. People have been asking for this forever, and we figured may as well give it a shot and see how it turns out. Do not make us regret this decision! It is important to note that we have never and continue to not act as any kind of mediator or verification/compensation source for people/organizations who use those forums. We will not be held responsible/liable for any damages, loss, etc. that occur from use of those forums. If you hire someone and they rip you off, don't come crying to us. If someone hires you and they rip you off, don't come crying to us. Those forums are a convenience. If you want something more official that offers guarantees, go to a real freelance site! .josh
  10. GENERAL RULES AND GUIDELINES FOR POSTING This forum is not meant to be a formal freelance service system. It is available for those who wish to seek out services or work from other people, as a courtesy to the members of the phpfreaks community. phpfreaks.com does not specialize in freelance services. This forum is an informal mechanism, as a courtesy to the community. We have no formal mechanism in place (like escrow) to guarantee payment, refund, work done, etc... phpfreaks.com shall not be held responsible for any losses you incur. we have never and continue to not act as any kind of mediator or verification/compensation source for people/organizations who use those forums. We will not be held responsible/liable for any damages, loss, etc. that occur from use of those forums. If you hire someone and they rip you off, don't come crying to us. If someone hires you and they rip you off, don't come crying to us. Those forums are a convenience. If you want something more official that offers guarantees, go to a real freelance site! If you have any questions regarding the freelance forum, feel free to ask them here. RULES: WHERE TO POST:If you want to offer your services, post in the Service Offerings sub-forum.If you want to offer a job or position of employment, post in the Job Offerings sub-forum. People looking for work: DO NOT post your 'resume' in job posting threads. You must directly contact the person you wish to reply to. The only reason replies are allowed is to ask for clarification/details about the job. Failure to adhere to this rule will result in all kinds of things, like you getting banned, or us disallowing replies. People offering work: DO NOT make more than one thread for a specific job. You may make a new thread if it's a different job, but if you are just wanting to tweak the job specifications, edit/reply to your original post. GUIDELINES:When posting in the freelancing forum it's important that you provide a way for users to contact you. They will not be able to reply to your topics so they need a way to contact you privately, and separately from the PHP Freaks website. This can be using emails or any type of instant messaging service (MSN, Gtalk, AIM, Jabber, etc.) or however you see fit.Unless you're an experienced coder and are looking for an extra set of hands, don't assume the job you want done is something "quick" or "easy" or "shouldn't take too long" etc... maybe it is, maybe it isn't. That's like going to a mechanic and telling him you expect him to be done in 2 hours when you have no idea how to fix a car. The best way to get a feel for how long something should take, is to get multiple quotes. Don't expect to get a response from coders if you're offering like $20 for someone to build you xyz site. Do some research and find out what the going rate for sites, particular aspects of sites, scripts, hourly rates, etc.. whatever fits your needs. You may indeed find people willing to do something super cheap, but as with everything else in life, you get what you pay for. The moral of the story is this: Just because one person quotes $20 to build xyz.com from the ground up, or charges $2.15/hr, doesn't mean everybody else is way overcharging. You get what you pay for. Don't expect feedback from posting "You'll get x% of profits once income starts pouring in" deals. Use some common sense: if the coder has to wait until you start making money off his work, what does he need you for? You get what you pay for. Don't expect feedback from posting jobs as 'non-paid' or 'for free'. Would you expect someone to build you a house or fix your car for free? You might get lucky and find some altruistic coder, but more than likely, you won't. You get what you pay for. Even if you do get responses from posts like the above ones mentioned, more than likely the quality is going to be cheap. Cheap as in not a good deal, messy and poor coding, lack of communication, shady dealings, etc.. You get what you pay for. Make sure you know what you want, before looking for someone. Don't assume any part of your project or need, no matter how big or small, goes without saying. Because it doesn't. And I guarantee you you'll end up fighting with the coder about it.Though details vary from coder to coder, yes, it is normal to have to pay some kind of % up front for work you want done. It may sometimes be hard, but it is possible to recover or minimize monetary losses, should a deal go awry. It is not possible to recover work done. That is why the burden of payment is on the client. There are lots of sites/systems you can go through to protect yourself from potential fallouts. One thing you can do is search through the user's posts here. Just click on their name and at the bottom of their profile click the "show last posts of this person" link. This can be a useful research tool for getting a feel for the person's skill level. For instance, if you see their post claiming to have 10 years of php experience doing everything under the sun, but check their post history and see that they recently asked a bunch of really simple questions, chances are they are lying about their skills. Edit history: June 8 2017: Job postings need to include a way for users to contact the poster that does not involve the PHP Freaks forums: replies are discouraged and private messages are only enabled for established users.
  11. There are several methods for requesting something from another site, from fopen to file_get_contents to curl to sockets to using ftp. But there's nothing we can really do to help your specific issues with them, unless we know specific details about the problem. What does the remote server expect in the request? What does it give as a response? etc.. No, you don't have to post code, and we do in fact warn against posting code that you do not want to have publicly available. We provide free help when we are able, and the exchange for that is that it's public. That's how most "free" sites work. If you want private help, you will have to pay for it (e.g. hire a freelancer). So you can't post the code because it's private. But you can't get help without posting code. You are right; it is sort of a catch-22. But how on earth do you expect us to help when you don't? Are you really getting upset at us because we aren't psychic?
  12. One way: name.php is a php file that sets a variable to be used on main.php name.php <?php $name = 'LINEAR LTD'; ?> main.php include("name.php"); include ("../../../../../accounts/accounts/{$name}/PERIODIC/listofpdfs.php"); Another way: name.php is really just a text file with the name, and main.php retrieves its contents into a string name.php LINEAR LTD main.php $name = trim(file_get_contents('name.php')); include ("../../../../../accounts/accounts/{$name}/PERIODIC/listofpdfs.php");
  13. winthropite, here is why I think you're full of shit. You claim to have written that code yourself, which already has conditions and makes use of other php functions in it. And yet you can't understand how to incorporate one simple little php function into a condition. I told you what ctype_alpha does. I even gave you a link to the manual. To me, this is like someone who claims to know calculus and posted this big long complicated formula, and yet doesn't understand how to literally add 1+1 to it, even though that exact principle is shown in the formula they claimed to write. Or, claiming you built a car and yet don't know how to change a tire. Or, claiming you built a house and yet don't know how to put a lock on a door. Do you understand what I'm saying here? Or claiming to build radio from scratch but not know how to add a volume dial. I'm saying it is impossible for you to not know how to apply ctype_alpha to your code, if that is really your code that you wrote and fully understand, because the skill required to accomplish the code you posted demonstrates a greater comprehension of php than solving your issue necessitates. So here I am scratching my head wondering how it is possible that you can write that code and not understand what to do with ctype_alpha, and there's only 2 logical reasons: you're being lazy, or you didn't write that code. Now, you can make remarks about people being "unhelpful" or being on high horses all you want. I really don't care. We are here to help people, and we did provide help. I even showed you pseudocode showing the general structure for how to incorporate it into your code. But we are not here to do your work for you. And you will find that same attitude on any other free help forum you come across. Yes, you showed what you tried, before any help was given. But you have not shown what you have tried since help was given. All you've done is ask for someone to do it for you. Show me how you tried to incorporate ctype_alpha into your code. Where's that code?
  14. javascript cannot directly call a php function. You need to use ajax to make a request to a php script that will execute the function. Read up on ajax.
  15. // receive user input // is user input valid? if (ctype_alpha($string)) { // it's valid, do your caesar thing with the input. } else { // it's invalid, tell user it's invalid input. } "Help" involves us pointing you in the right direction, which I did. You aren't asking for help. You are telling us what you want the code to do, and then asking for someone to post the finished code according to your specs. That's not asking for help. That's asking for someone to do it for you. Look, I don't know you, but I do know that if you really did write that code above, there's no reason you shouldn't be able to do this yourself. So, either you are being lazy or you're lying about writing that code. I have helped you by pointing you in the right direction. But I am not going to alter your script for you.
  16. ctype_alpha evaluates the value you pass to it and returns true if it's all letters, false if not. If you really wrote all that code you posted, surely you can figure out how to incorporate a simple condition into it, especially since you use conditions elsewhere..
  17. if (ctype_alpha($string)) { // only letters } else { // not only letters }
  18. In addition to that.. it's looking like you probably have issues with scope. <?php function enroll() { if($_POST['action'] == 'call_this') { $data['title'] = $row['title']; $this->db->insert('class', $data); redirect(base_url() . 'index.php?student/classes/', 'refresh'); }} ?> your function doesn't know anything about $row. You need to expose it to your function. You either need to either declare it as a global variable first (bad idea) or expose it as a property for $this (or expose it via a getter method). Probably same thing to be said about $data. *technically* you can create $data['title'] on the fly, but I suspect you probably already have an existing array $data and adding an element to it, so you'll need to expose $data to your function as well, if that's the case
  19. yes, you are on the right track. One thing I see wrong is that in your $.ajax call you are again attempting to use a php function base_url() in a javascript (client-side) context. You need to wrap that in php tags like so: url: "<?php echo base_url().'index.php?student/classes/'; ?>", You can do this in this instance because you're making a call and echoing out the result on initial response. Though..sidenote.. I don't see anywhere where you are actually defining that php function. And yes.. it is kinda "cludggy" but that's how it is - even with .NET - it's just that .NET abstracts all this, puts it "under the hood". It outputs code similar to this in principle just the same. The difference is that it does it for you, vs. you having to do it yourself with php and other server-side languages.
  20. http is a stateless protocol, so there is no "direct calls to server-side functions", not even with .NET. It's just that .NET abstracts all that away and makes it seem like you're doing it directly. Under the hood it's still stateless and does it with ajax. IOW when .NET parses, it sees your server-side declared function and basically outputs a client-side javascript wrapper so when you make a call to your server-side function, what's really going on is you are making a call to a client-side javascript wrapper that makes an ajax call to the server and receives a response. So while it seems like you can use .NET to put a server-side function directly into an onclick, there's actually a middle-man under the hood, passing info back and forth. Which you're right, it's convenient. But there's no such thing built into php. But it's easy enough to replicate, and I'm sure there's a library or framework out there that does exactly that (I personally haven't looked)
  21. you need to have the link make an http request to the php script when it's clicked. Whether you put it as the target href (passing relevant values as query params) or use javascript to make an ajax call to the php script depends on what your goal is. The former will either reload the whole page or else open a new window. The latter will stay on the same page without a reload. But in either case, you can't directly call a php function from your link. It has to make a request to a script and you have to invoke the php function within the php script.
  22. So you are saying that $Basket_total has the total price, including shipping. IOW [product price] + [shipping price]. So you want to subtract [shipping price] from $Basket_total. So in order to do what you want to do, you need to know what [shipping price] is, so that you can subtract it from $Basket_total Example: // this is in principle what your existing code would have had to do to get your $Basket_total $Product_price = 10; $Shipping = 2; $Basket_total = $product_price + $shipping; // So later on in your code, you're wanting to be able to output this: echo $Product_price; // but the variable you currently have to work with is this: echo $Basket_total; // so you need to be able to do this: echo $Basket_total - $Shipping; If all you have to work with at this point is the value of $Basket_total, then you can't do what you're wanting to do. The original shipping price must somehow be exposed in order for you to do that, so that you can subtract it. unset won't do anything for you except delete the entire variable. You don't want to do that; you want to subtract a value from the variable, which is basic math operation. So that is essentially what Davidannis was saying when he said you didn't post enough code. We cannot tell you whether or not the postage price by itself is available, since we can't see your code as a whole. So.. do you have that value set in a variable in your script somewhere? Or perhaps it's stored in your database to query for as well? Without it, you will not be able to separate the two, any more than you'd be able to separate the following: // i have this... $total = 10 + 2; // how do I get just that 10 from $total? // you can't, unless you do this instead: $x = 10; $y = 2; $total = $x + $y; // then you can do this: echo $x; // or this: echo $total - $y; And as a sidenote, I echo Davidannis's last statement: displaying the price without the shipping is not the same thing as only charging the visitor the price. In order to only charge the visitor for actual price without shipping, you will need to update whatever code that actually charges the visitor.
  23. .josh

    link

    Your code is formatting the url wrong. You need to change that one thing.
  24. You may need to be more specific about what you are trying to do, but one thing that seems off to me is that you don't have anything inside your anchor tag, so unless you have some css marking up all links on your page, you aren't outputting anything to actually click on. So perhaps your issue is that you need to put something in your link tag so you have something to click on, ex: <a href="cloud.php?q=<?php echo $value; ?>">click me!</a>
  25. dude. You have received 2 different ways of doing this already. You need to go back and take time to understand the code. Stop making duplicate threads asking the same thing. If you don't understand what has been given to you, ask for clarification in your other thread(s). This is a fairly simple code solution. The problem is not the solutions that have been given to you. It's your understanding and/or application of them.
×
×
  • 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.